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

Proposed by jftempo
Status: Merged
Merged at revision: 5198
Proposed branch: lp:~julie-w/unifield-server/US-5425
Merge into: lp:unifield-server
Diff against target: 68 lines (+24/-1)
4 files modified
bin/addons/msf_profile/data/patches.xml (+5/-0)
bin/addons/msf_profile/msf_profile.py (+17/-0)
bin/addons/res_currency_functional/account_move_line_compute_currency.py (+1/-1)
bin/addons/res_currency_functional/account_move_line_view.xml (+1/-0)
To merge this branch: bzr merge lp:~julie-w/unifield-server/US-5425
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+361129@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/msf_profile/data/patches.xml'
2--- bin/addons/msf_profile/data/patches.xml 2018-11-20 11:14:57 +0000
3+++ bin/addons/msf_profile/data/patches.xml 2019-01-07 13:53:45 +0000
4@@ -1,6 +1,11 @@
5 <?xml version="1.0" encoding="utf-8" ?>
6 <openerp>
7 <data>
8+ <!-- UF11.1 -->
9+ <record id="us_5425_reset_amount_currency" model="patch.scripts">
10+ <field name="method">us_5425_reset_amount_currency</field>
11+ </record>
12+
13 <!-- UF11.0 -->
14 <record id="us_5356_reset_ud_prod" model="patch.scripts">
15 <field name="method">us_5356_reset_ud_prod</field>
16
17=== modified file 'bin/addons/msf_profile/msf_profile.py'
18--- bin/addons/msf_profile/msf_profile.py 2018-11-20 11:14:57 +0000
19+++ bin/addons/msf_profile/msf_profile.py 2019-01-07 13:53:45 +0000
20@@ -51,6 +51,23 @@
21 'model': lambda *a: 'patch.scripts',
22 }
23
24+ # UF11.1
25+ def us_5425_reset_amount_currency(self, cr, uid, *a, **b):
26+ """
27+ Sets to zero the JI "amount_currency" which wrongly have a value
28+ Note: it fixes only the reval and FX entries where we forced the booking values to be exactly 0.00
29+ """
30+ update_ji_booking = """
31+ UPDATE account_move_line
32+ SET amount_currency = 0.0
33+ WHERE (debit_currency = 0.0 OR debit_currency IS NULL)
34+ AND (credit_currency = 0.0 OR credit_currency IS NULL)
35+ AND (amount_currency != 0.0 AND amount_currency IS NOT NULL)
36+ AND journal_id IN (SELECT id FROM account_journal WHERE type IN ('cur_adj', 'revaluation'));
37+ """
38+ cr.execute(update_ji_booking)
39+ self._logger.warn('amount_currency reset in %s JI.' % (cr.rowcount,))
40+
41 # UF11.0
42 def us_5356_reset_ud_prod(self, cr, uid, *a, **b):
43 instance_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.instance_id
44
45=== modified file 'bin/addons/res_currency_functional/account_move_line_compute_currency.py'
46--- bin/addons/res_currency_functional/account_move_line_compute_currency.py 2018-09-19 09:18:26 +0000
47+++ bin/addons/res_currency_functional/account_move_line_compute_currency.py 2019-01-07 13:53:45 +0000
48@@ -601,7 +601,7 @@
49 # or if it's a revaluation line (US-1682)
50 if vals.get('is_addendum_line', False) or \
51 (context.get('sync_update_execution', False) and 'is_revaluated_ok' in newvals and newvals['is_revaluated_ok']):
52- newvals.update({'debit_currency': 0.0, 'credit_currency': 0.0})
53+ newvals.update({'debit_currency': 0.0, 'credit_currency': 0.0, 'amount_currency': 0.0})
54 return newvals
55
56 def create(self, cr, uid, vals, context=None, check=True):
57
58=== modified file 'bin/addons/res_currency_functional/account_move_line_view.xml'
59--- bin/addons/res_currency_functional/account_move_line_view.xml 2018-09-20 07:55:18 +0000
60+++ bin/addons/res_currency_functional/account_move_line_view.xml 2019-01-07 13:53:45 +0000
61@@ -69,6 +69,7 @@
62 <field name="invoice" invisible="1"/>
63 <field name="purchase_order_id" invisible="1"/>
64 <field name="cheque_number" invisible="1"/>
65+ <field name="amount_currency" invisible="1"/>
66 </group>
67
68 <group col="6" colspan="4">

Subscribers

People subscribed via source and target branches