Merge lp:~julie-w/unifield-server/US-5663 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 5319
Proposed branch: lp:~julie-w/unifield-server/US-5663
Merge into: lp:unifield-server
Diff against target: 17 lines (+6/-1)
1 file modified
bin/addons/res_currency_functional/account_move_line_compute_currency.py (+6/-1)
To merge this branch: bzr merge lp:~julie-w/unifield-server/US-5663
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+366898@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/res_currency_functional/account_move_line_compute_currency.py'
2--- bin/addons/res_currency_functional/account_move_line_compute_currency.py 2019-01-09 17:26:04 +0000
3+++ bin/addons/res_currency_functional/account_move_line_compute_currency.py 2019-05-03 09:52:06 +0000
4@@ -576,7 +576,12 @@
5 # if ctxcurr.get('date', False):
6 # newvals['date'] = ctxcurr['date']
7
8- if vals.get('credit_currency') or vals.get('debit_currency'):
9+ if context.get('from_web_menu') and (vals.get('debit_currency', False) is not False or vals.get('credit_currency', False) is not False):
10+ # use case where one of the booking fields MANUALLY CHANGED IN THE INTERFACE has a value, EVEN IF IT IS 0.00
11+ newvals['amount_currency'] = vals.get('debit_currency') or 0.0 - vals.get('credit_currency') or 0.0
12+ newvals['debit'] = cur_obj.compute(cr, uid, currency_id, curr_fun, vals.get('debit_currency') or 0.0, round=True, context=ctxcurr)
13+ newvals['credit'] = cur_obj.compute(cr, uid, currency_id, curr_fun, vals.get('credit_currency') or 0.0, round=True, context=ctxcurr)
14+ elif vals.get('credit_currency') or vals.get('debit_currency'):
15 newvals['amount_currency'] = vals.get('debit_currency') or 0.0 - vals.get('credit_currency') or 0.0
16 newvals['debit'] = cur_obj.compute(cr, uid, currency_id, curr_fun, vals.get('debit_currency') or 0.0, round=True, context=ctxcurr)
17 newvals['credit'] = cur_obj.compute(cr, uid, currency_id, curr_fun, vals.get('credit_currency') or 0.0, round=True, context=ctxcurr)

Subscribers

People subscribed via source and target branches