~unifield-team/unifield-wm/us-671-homere

« back to all changes in this revision

Viewing changes to msf_instance/add_instance.py

  • Committer: Fabien MORIN
  • Date: 2016-01-04 13:16:43 UTC
  • mto: This revision was merged to the branch mainline in revision 2735.
  • Revision ID: fabien.morin@tempo-consulting.fr-20160104131643-yg05m7g044qrom9w
SP-223 [FIX] After discussion with JFB, the way to introduce force_no_order
parameter was bad because it implies too heavy modifications on the whole code.
It is better to use existing 'order' parameter, 'limit' and 'count' as a
combination to get the same result and force removing 'ORDER BY' in the case
that doesnt need it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
249
249
            vals['instance_id'] = journal.get('instance_id')[0]
250
250
        return super(account_analytic_line, self).write(cr, uid, ids, vals, context=context)
251
251
 
252
 
    def search(self, cr, uid, args, offset=0, limit=None, order=None,
253
 
            force_no_order=False, context=None, count=False):
 
252
    def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
254
253
        """
255
254
        Filtering regarding context
256
255
        """
262
261
                instance_ids = [instance_ids]
263
262
            args.append(('instance_id', 'in', instance_ids))
264
263
        return super(account_analytic_line, self).search(cr, uid, args, offset,
265
 
                limit, order, force_no_order=force_no_order, context=context, count=count)
 
264
                limit, order, context=context, count=count)
266
265
 
267
266
account_analytic_line()
268
267
 
336
335
            vals['instance_id'] = journal.get('instance_id')[0]
337
336
        return super(account_move_line, self).write(cr, uid, ids, vals, context=context, check=check, update_check=update_check)
338
337
 
339
 
    def search(self, cr, uid, args, offset=0, limit=None, order=None,
340
 
            force_no_order=False, context=None, count=False):
 
338
    def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
341
339
        """
342
340
        Filtering regarding context
343
341
        """
349
347
                instance_ids = [instance_ids]
350
348
            args.append(('instance_id', 'in', instance_ids))
351
349
        return super(account_move_line, self).search(cr, uid, args, offset,
352
 
                limit, order, force_no_order=force_no_order, context=context, count=count)
 
350
                limit, order, context=context, count=count)
353
351
 
354
352
account_move_line()
355
353