Merge lp:~arifmlpm/openobject-addons/arif-openobject-addons into lp:openobject-addons
Proposed by
Arif
Status: | Merged |
---|---|
Merged at revision: | 6613 |
Proposed branch: | lp:~arifmlpm/openobject-addons/arif-openobject-addons |
Merge into: | lp:openobject-addons |
Diff against target: |
19 lines (+5/-1) 1 file modified
sale/sale.py (+5/-1) |
To merge this branch: | bzr merge lp:~arifmlpm/openobject-addons/arif-openobject-addons |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
qdp (OpenERP) | Approve | ||
Review via email: mp+92968@code.launchpad.net |
Description of the change
It contain the bug fix for the confirmed bug
https:/
Kind Regds,
Arif
To post a comment you must log in.
Hello Arif,
Thanks for your contribution. I just improved your code in order to remove the extra loop, and to use a flag instead of a list.
FYI, here is the patch i merged
res[ sale.id] = True
res[ sale.id
=== modified file 'sale/sale.py'
--- sale/sale.py 2012-02-15 17:32:52 +0000
+++ sale/sale.py 2012-02-16 16:22:11 +0000
@@ -147,11 +147,14 @@
res = {}
for sale in self.browse(cursor, user, ids, context=context):
+ invoice_existence = False
for invoice in sale.invoice_ids:
- if invoice.state != 'paid':
- res[sale.id] = False
- break
- if not sale.invoice_ids:
+ if invoice.state != 'cancel':
+ invoice_existence = True
+ if invoice.state != 'paid':
+ res[sale.id] = False
+ break
+ if not invoice_existence: