Review: Needs Fixing

All invoices are already browsed (and put in the 'invoices' variable) so there 
is no need to browse again (and do it in a loop):
  for inv in invoice_obj.browse(cursor, user, [invoice_created.id], 
context=context)

There is a test
  if not picking.sale_id:
    continue

So no need to test again with 'picking.sale_id and ...'.

Especially if you move the lines
  sale_lines = picking.sale_id.order_line
  invoice_created = invoices[result[picking.id]]
before the test. Now the test is useless or you have introduced a bug.

The two writes can be done together.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-783255-ksa/+merge/81700
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-783255-ksa.

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : openerp-dev-gtk@lists.launchpad.net
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to