Merge lp:~jfb-tempo-consulting/unifield-server/US-10163 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 6275
Proposed branch: lp:~jfb-tempo-consulting/unifield-server/US-10163
Merge into: lp:unifield-server
Diff against target: 79 lines (+17/-8)
3 files modified
bin/addons/account_reconciliation/account_move_line.py (+5/-8)
bin/addons/msf_profile/data/patches.xml (+3/-0)
bin/addons/msf_profile/msf_profile.py (+9/-0)
To merge this branch: bzr merge lp:~jfb-tempo-consulting/unifield-server/US-10163
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+425931@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/account_reconciliation/account_move_line.py'
2--- bin/addons/account_reconciliation/account_move_line.py 2022-05-06 09:02:35 +0000
3+++ bin/addons/account_reconciliation/account_move_line.py 2022-07-11 12:06:33 +0000
4@@ -224,7 +224,7 @@
5 partner_obj = self.pool.get('res.partner')
6 lines = self.browse(cr, uid, ids, context=context)
7 unrec_lines = filter(lambda x: not x['reconcile_id'], lines)
8- credit = debit = func_debit = func_credit = currency = 0.0
9+ currency = 0.0
10 account_id = partner_id = False
11 current_company = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id
12 current_instance_level = current_company.instance_id.level
13@@ -257,21 +257,19 @@
14 different_level = False
15 multi_instance_level_creation = 'coordo'
16 partial_reconcile_ids = set()
17+ func_balance = 0
18+ book_balance = 0
19 for line in unrec_lines:
20 if line.state <> 'valid':
21 raise osv.except_osv(_('Error'),
22 _('Entry "%s" is not valid !') % line.name)
23- credit += line['credit_currency']
24- debit += line['debit_currency']
25- func_debit += line['debit']
26- func_credit += line['credit']
27+ book_balance += line['debit_currency'] - line['credit_currency']
28+ func_balance += line['debit'] - line['credit']
29 currency += line['amount_currency'] or 0.0
30 account_id = line['account_id']['id']
31 partner_id = (line['partner_id'] and line['partner_id']['id']) or False
32 if line.reconcile_partial_id:
33 partial_reconcile_ids.add(line.reconcile_partial_id)
34- func_balance = func_debit - func_credit
35- book_balance = debit - credit
36
37 cr.execute('SELECT account_id, reconcile_id '\
38 'FROM account_move_line '\
39@@ -313,7 +311,6 @@
40 'is_multi_instance': different_level,
41 'multi_instance_level_creation': multi_instance_level_creation,
42 })
43-
44 if partial_reconcile_ids:
45 # delete old partial rec
46 self.pool.get('account.move.reconcile').unlink(cr, uid, [x.id for x in partial_reconcile_ids], context=context)
47
48=== modified file 'bin/addons/msf_profile/data/patches.xml'
49--- bin/addons/msf_profile/data/patches.xml 2022-05-30 15:32:49 +0000
50+++ bin/addons/msf_profile/data/patches.xml 2022-07-11 12:06:33 +0000
51@@ -791,5 +791,8 @@
52 <field name="method">us_8259_remove_currency_table_wkf</field>
53 </record>
54
55+ <record id="fix_us_10163_ocbhq_funct_amount" model="patch.scripts">
56+ <field name="method">fix_us_10163_ocbhq_funct_amount</field>
57+ </record>
58 </data>
59 </openerp>
60
61=== modified file 'bin/addons/msf_profile/msf_profile.py'
62--- bin/addons/msf_profile/msf_profile.py 2022-05-30 15:32:49 +0000
63+++ bin/addons/msf_profile/msf_profile.py 2022-07-11 12:06:33 +0000
64@@ -56,6 +56,15 @@
65 'model': lambda *a: 'patch.scripts',
66 }
67
68+ def fix_us_10163_ocbhq_funct_amount(self, cr, uid, *a, **b):
69+ ''' OCBHQ: fix amounts on EOY-2021-14020-OCBVE101-VES'''
70+ instance = self.pool.get('res.users').browse(cr, uid, uid).company_id.instance_id
71+ if instance and instance.name == 'OCBHQ':
72+ cr.execute('''update account_move_line set credit_currency='636077529292.81' where id = (select res_id from ir_model_data where name='8e980ca1-dee3-11e5-a9b9-94659c5434c6/account_move_line/226517')''')
73+ cr.execute('''update account_move_line set debit_currency='636077529292.81' where id = (select res_id from ir_model_data where name='8e980ca1-dee3-11e5-a9b9-94659c5434c6/account_move_line/226518')''')
74+
75+ return True
76+
77 def us_8259_remove_currency_table_wkf(self, cr, uid, *a, **b):
78 cr.execute("delete from wkf_workitem where act_id in (select id from wkf_activity where wkf_id = (select id from wkf where name='wkf.res.currency.table' and osv='res.currency.table'))")
79 cr.execute("delete from wkf_activity where wkf_id = (select id from wkf where name='wkf.res.currency.table' and osv='res.currency.table')")

Subscribers

People subscribed via source and target branches