Merge lp:~openerp-dev/openobject-addons/trunk-bug-784006-ara into lp:openobject-addons

Proposed by Ashvin Rathod (OpenERP)
Status: Merged
Merged at revision: 5082
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-784006-ara
Merge into: lp:openobject-addons
Diff against target: 18 lines (+6/-1)
1 file modified
account/account_move_line.py (+6/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-784006-ara
Reviewer Review Type Date Requested Status
Mustufa Rangwala (Open ERP) (community) Approve
Ashvin Rathod (OpenERP) (community) Needs Resubmitting
qdp (OpenERP) Pending
Review via email: mp+63517@code.launchpad.net

Description of the change

Hello,

Fix: account_move_line: improved account selection when partner changes

Thanks,
ara

To post a comment you must log in.
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

in line number 14 instead of using else you can use elif as given in the patch.
Because if the selected partner is not customer and not supplier then we can not propose the account.

Thanks,
mra

review: Needs Fixing
Revision history for this message
Ashvin Rathod (OpenERP) (ara-tinyerp) wrote :

Hello,

I have changed as you describe as above.

Thanks,
ara

review: Needs Resubmitting
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'account/account_move_line.py'
--- account/account_move_line.py 2011-07-01 23:41:24 +0000
+++ account/account_move_line.py 2011-07-05 06:23:11 +0000
@@ -650,8 +650,13 @@
650 #if jt in ('sale', 'purchase_refund', 'bank', 'cash'):650 #if jt in ('sale', 'purchase_refund', 'bank', 'cash'):
651 if jt in ('sale', 'purchase_refund'):651 if jt in ('sale', 'purchase_refund'):
652 val['account_id'] = fiscal_pos_obj.map_account(cr, uid, part and part.property_account_position or False, id2)652 val['account_id'] = fiscal_pos_obj.map_account(cr, uid, part and part.property_account_position or False, id2)
653 elif jt in ('purchase', 'sale_refund', 'expense', 'bank', 'cash'):653 elif jt in ('purchase', 'sale_refund'):
654 val['account_id'] = fiscal_pos_obj.map_account(cr, uid, part and part.property_account_position or False, id1)654 val['account_id'] = fiscal_pos_obj.map_account(cr, uid, part and part.property_account_position or False, id1)
655 elif jt in ('general', 'bank', 'cash'):
656 if part.customer and not part.supplier:
657 val['account_id'] = fiscal_pos_obj.map_account(cr, uid, part and part.property_account_position or False, id2)
658 elif part.supplier and not part.customer:
659 val['account_id'] = fiscal_pos_obj.map_account(cr, uid, part and part.property_account_position or False, id1)
655 if val.get('account_id', False):660 if val.get('account_id', False):
656 d = self.onchange_account_id(cr, uid, ids, val['account_id'])661 d = self.onchange_account_id(cr, uid, ids, val['account_id'])
657 val.update(d['value'])662 val.update(d['value'])

Subscribers

People subscribed via source and target branches

to all changes: