Meera Trambadia (OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-bug-929373-mtr into
lp:openobject-addons.
Requested reviews:
OpenERP Core Team (openerp)
Related bugs:
Bug #929373 in OpenERP Addons: "Sales order couldn't get paid after once an
Invoice cancellation"
https://bugs.launchpad.net/openobject-addons/+bug/929373
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-929373-mtr/+merge/93167
Sale: Paid(boolean) now works correctly if SO has more than one invoice in
different states
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-929373-mtr/+merge/93167
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-bug-929373-mtr.
=== modified file 'sale/sale.py'
--- sale/sale.py 2012-02-14 12:25:20 +0000
+++ sale/sale.py 2012-02-15 09:56:09 +0000
@@ -147,11 +147,15 @@
res = {}
for sale in self.browse(cursor, user, ids, context=context):
res[sale.id] = True
+ invoices = []
for invoice in sale.invoice_ids:
+ if invoice.state != 'cancel':
+ invoices.append(invoice)
+ for invoice in invoices:
if invoice.state != 'paid':
res[sale.id] = False
break
- if not sale.invoice_ids:
+ if not invoices:
res[sale.id] = False
return res
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp