~unifield-team/unifield-wm/us-826

« back to all changes in this revision

Viewing changes to account_override/invoice.py

  • Committer: Fabien MORIN
  • Date: 2016-01-15 13:38:04 UTC
  • mto: This revision was merged to the branch mainline in revision 2735.
  • Revision ID: fabien.morin@tempo-consulting.fr-20160115133804-1jkrggrdszy8egf7
SP-223 [IMP] sorry for going back on this change again and again, but using
  limit=1 in combination with order='NO_ORDER' is more logic than using with
  count=True. This also not imply adding a new condition in the search and
  reusing existing code as much as possible. This is a minor modification and
  should not alter current behaviour and performances (or perhaps improve a
them
  just a bit as there is less if in the search)

Show diffs side-by-side

added added

removed removed

Lines of Context:
554
554
                        args = [('price_include', '=', '1'),
555
555
                                ('id', '=', tax_line[2]['account_tax_id'])]
556
556
                        tax_ids = tax_obj.search(cr, uid, args, limit=1,
557
 
                                count=True, context=context)
 
557
                                order='NO_ORDER', context=context)
558
558
                        if tax_ids:
559
559
                            raise osv.except_osv(_('Error'),
560
560
                                                 _('Tax included in price can not be tied to the whole invoice.'))