Merge lp:~akretion-team/openerp-connector-magento/7-fix-invoice-binding into lp:~openerp-connector-core-editors/openerp-connector-magento/7.0-next-release
Proposed by
David BEAL (ak)
Status: | Merged |
---|---|
Approved by: | Guewen Baconnier @ Camptocamp |
Approved revision: | 981 |
Merged at revision: | 982 |
Proposed branch: | lp:~akretion-team/openerp-connector-magento/7-fix-invoice-binding |
Merge into: | lp:~openerp-connector-core-editors/openerp-connector-magento/7.0-next-release |
Diff against target: |
13 lines (+3/-0) 1 file modified
magentoerpconnect/invoice.py (+3/-0) |
To merge this branch: | bzr merge lp:~akretion-team/openerp-connector-magento/7-fix-invoice-binding |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Romain Deheele - Camptocamp (community) | code review | Approve | |
Guewen Baconnier @ Camptocamp | code review | Approve | |
Review via email: mp+217605@code.launchpad.net |
Description of the change
prevent create a second binding in invoice if invoice is cancel and yet validate (with account cancel)
To post a comment you must log in.
Hi,
Following the logic of the code, if several magento. account. invoice bindings could be created for an invoice (several sales orders or linked with several backends). Even if this situation is highly improbable, I think it is important to follow the same logic.
So the check should be done in the inner(-inner) loop.
Also, I prefer when a condition returns eagerly than when it pushes all a block of an indentation level (avoid long lines, improve readability, reduce diff size hence conflicts).
In that case, it would have been:
if invoice. magento_ bind_ids:
return
Or in the inner loop
if [condition]:
continue
thanks