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
1=== modified file 'account/account_move_line.py'
2--- account/account_move_line.py 2011-07-01 23:41:24 +0000
3+++ account/account_move_line.py 2011-07-05 06:23:11 +0000
4@@ -650,8 +650,13 @@
5 #if jt in ('sale', 'purchase_refund', 'bank', 'cash'):
6 if jt in ('sale', 'purchase_refund'):
7 val['account_id'] = fiscal_pos_obj.map_account(cr, uid, part and part.property_account_position or False, id2)
8- elif jt in ('purchase', 'sale_refund', 'expense', 'bank', 'cash'):
9+ elif jt in ('purchase', 'sale_refund'):
10 val['account_id'] = fiscal_pos_obj.map_account(cr, uid, part and part.property_account_position or False, id1)
11+ elif jt in ('general', 'bank', 'cash'):
12+ if part.customer and not part.supplier:
13+ val['account_id'] = fiscal_pos_obj.map_account(cr, uid, part and part.property_account_position or False, id2)
14+ elif part.supplier and not part.customer:
15+ val['account_id'] = fiscal_pos_obj.map_account(cr, uid, part and part.property_account_position or False, id1)
16 if val.get('account_id', False):
17 d = self.onchange_account_id(cr, uid, ids, val['account_id'])
18 val.update(d['value'])

Subscribers

People subscribed via source and target branches

to all changes: