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

Proposed by jftempo
Status: Merged
Merged at revision: 5655
Proposed branch: lp:~julie-w/unifield-server/US-7247
Merge into: lp:unifield-server
Diff against target: 84 lines (+18/-6)
2 files modified
bin/addons/msf_doc_import/account.py (+12/-6)
bin/addons/msf_profile/i18n/fr_MF.po (+6/-0)
To merge this branch: bzr merge lp:~julie-w/unifield-server/US-7247
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+380497@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_doc_import/account.py'
2--- bin/addons/msf_doc_import/account.py 2019-12-12 15:19:07 +0000
3+++ bin/addons/msf_doc_import/account.py 2020-03-10 17:00:40 +0000
4@@ -92,7 +92,7 @@
5 move_vals = {
6 'currency_id': currency_id,
7 'manual_currency_id': currency_id,
8- 'journal_id': journal_id,
9+ 'journal_id': journal_id, # the instance_id will be the instance of this journal i.e. the current one
10 'document_date': document_date,
11 'date': w.date,
12 'period_id': period_id,
13@@ -130,7 +130,7 @@
14 'period_id': period_id,
15 'document_date': l.document_date,
16 'date': l.date,
17- 'journal_id': journal_id,
18+ 'journal_id': journal_id, # the instance_id will be the instance of this journal i.e. the current one
19 'debit_currency': l.debit,
20 'credit_currency': l.credit,
21 'currency_id': currency_id,
22@@ -187,7 +187,7 @@
23 created = 0
24 processed = 0
25 errors = []
26- current_instance = self.pool.get('res.users').browse(cr, uid, uid).company_id.instance_id.id or False
27+ current_instance = self.pool.get('res.users').browse(cr, uid, uid).company_id.instance_id or False
28
29 current_line_num = None
30 try:
31@@ -232,7 +232,9 @@
32 self.write(cr, uid, [wiz.id], {'message': _('Reading headers…'), 'progression': 5.00})
33 # Use the first row to find which column to use
34 cols = {}
35- col_names = ['Journal Code', 'Description', 'Reference', 'Document Date', 'Posting Date', 'Period', 'G/L Account', 'Partner', 'Employee', 'Journal', 'Destination', 'Cost Centre', 'Funding Pool', 'Booking Debit', 'Booking Credit', 'Booking Currency']
36+ col_names = ['Proprietary Instance', 'Journal Code', 'Description', 'Reference', 'Document Date', 'Posting Date', 'Period',
37+ 'G/L Account', 'Partner', 'Employee', 'Journal', 'Destination', 'Cost Centre', 'Funding Pool', 'Booking Debit',
38+ 'Booking Credit', 'Booking Currency']
39 for num, r in enumerate(rows):
40 header = [x and x.data for x in r.iter_cells()]
41 for el in col_names:
42@@ -281,6 +283,10 @@
43
44 self._format_special_char(line)
45
46+ file_prop_inst = line[cols['Proprietary Instance']] or ''
47+ if current_instance and current_instance.code != file_prop_inst.strip():
48+ errors.append(_('Line %s. The Proprietary Instance must be the current instance %s.') % (current_line_num, current_instance.code))
49+ continue
50 # Check document date
51 if not line[cols['Document Date']]:
52 errors.append(_('Line %s. No document date specified!') % (current_line_num,))
53@@ -364,7 +370,7 @@
54 continue
55 else:
56 # check for a valid journal code
57- aj_ids = aj_obj.search(cr, uid, [('code', '=', line[cols['Journal Code']]), ('instance_id', '=', current_instance)])
58+ aj_ids = aj_obj.search(cr, uid, [('code', '=', line[cols['Journal Code']]), ('instance_id', '=', current_instance.id)])
59 if not aj_ids:
60 errors.append(_('Line %s. Journal Code not found: %s.') % (current_line_num, line[cols['Journal Code']]))
61 continue
62@@ -413,7 +419,7 @@
63 else:
64 r_employee = tp_ids[0]
65 if line[cols['Journal']]:
66- tp_ids = self.pool.get('account.journal').search(cr, uid, ['|', ('name', '=', line[cols['Journal']]), ('code', '=', line[cols['Journal']]), ('instance_id', '=', current_instance)])
67+ tp_ids = self.pool.get('account.journal').search(cr, uid, ['|', ('name', '=', line[cols['Journal']]), ('code', '=', line[cols['Journal']]), ('instance_id', '=', current_instance.id)])
68 if not tp_ids:
69 tp_label = _('Journal')
70 tp_content = line[cols['Journal']]
71
72=== modified file 'bin/addons/msf_profile/i18n/fr_MF.po'
73--- bin/addons/msf_profile/i18n/fr_MF.po 2020-02-25 13:42:01 +0000
74+++ bin/addons/msf_profile/i18n/fr_MF.po 2020-03-10 17:00:40 +0000
75@@ -108985,3 +108985,9 @@
76 #: field:replenishment.segment.line,list_fmc:0
77 msgid "more FMC"
78 msgstr "plus de PCM"
79+
80+#. module: msf_doc_import
81+#: code:addons/msf_doc_import/account.py:287
82+#, python-format
83+msgid "Line %s. The Proprietary Instance must be the current instance %s."
84+msgstr "Ligne %s. L'Instance Propriétaire doit être l'instance actuelle %s."

Subscribers

People subscribed via source and target branches