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

Proposed by jftempo
Status: Merged
Merged at revision: 4965
Proposed branch: lp:~julie-w/unifield-server/US-4721
Merge into: lp:unifield-server
Diff against target: 125 lines (+34/-10)
3 files modified
bin/addons/analytic_distribution/analytic_distribution_wizard_view.xml (+3/-0)
bin/addons/analytic_distribution/wizard/mass_reallocation_wizard.py (+22/-10)
bin/addons/msf_profile/i18n/fr_MF.po (+9/-0)
To merge this branch: bzr merge lp:~julie-w/unifield-server/US-4721
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+349123@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/analytic_distribution/analytic_distribution_wizard_view.xml'
2--- bin/addons/analytic_distribution/analytic_distribution_wizard_view.xml 2018-02-13 14:29:57 +0000
3+++ bin/addons/analytic_distribution/analytic_distribution_wizard_view.xml 2018-07-09 08:35:51 +0000
4@@ -195,6 +195,9 @@
5 <newline/>
6 <label string="- Unposted items" align="0.0"/>
7 <newline/>
8+ <label string='- Items booked on accounts set as "Prevent correction on analytic accounts"' align="0.0" colspan="4"/>
9+ <newline/>
10+ <label string="- Items booked on a Currency Adjustment Analytic Journal" align="0.0" colspan="4"/>
11 <html>
12 <br />
13 </html>
14
15=== modified file 'bin/addons/analytic_distribution/wizard/mass_reallocation_wizard.py'
16--- bin/addons/analytic_distribution/wizard/mass_reallocation_wizard.py 2018-02-22 14:55:29 +0000
17+++ bin/addons/analytic_distribution/wizard/mass_reallocation_wizard.py 2018-07-09 08:35:51 +0000
18@@ -213,6 +213,7 @@
19 # Some verifications
20 if context is None:
21 context = {}
22+ gl_acc_obj = self.pool.get('account.account')
23 # Default behaviour
24 res = super(mass_reallocation_wizard, self).default_get(cr, uid, fields, context=context)
25
26@@ -233,25 +234,29 @@
27 if context.get('active_ids', False) and context.get('active_model', False) == 'account.analytic.line':
28 res['line_ids'] = context.get('active_ids')
29 # Search which lines are eligible (add another criteria if we come from project)
30+ not_ad_correctable_acc_ids = gl_acc_obj.search(cr, uid, [('is_not_ad_correctable', '=', True)],
31+ order='NO_ORDER', context=context)
32 search_args = [
33- ('id', 'in', context.get('active_ids')), '|', '|', '|', '|', '|',
34+ ('id', 'in', context.get('active_ids')), '|', '|', '|', '|', '|', '|',
35 ('commitment_line_id', '!=', False), ('is_reallocated', '=', True),
36 ('is_reversal', '=', True),
37- ('journal_id.type', 'in', ['engagement', 'revaluation']),
38+ ('journal_id.type', 'in', ['engagement', 'revaluation', 'cur_adj']),
39 ('from_write_off', '=', True),
40 ('move_state', '=', 'draft'),
41+ ('general_account_id', 'in', not_ad_correctable_acc_ids),
42 ]
43 company = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id
44 if company and company.instance_id and company.instance_id.level == 'project':
45 search_args = [
46- ('id', 'in', context.get('active_ids')), '|', '|', '|', '|', '|', '|', '|',
47+ ('id', 'in', context.get('active_ids')), '|', '|', '|', '|', '|', '|', '|', '|',
48 ('commitment_line_id', '!=', False), ('is_reallocated', '=', True),
49 ('is_reversal', '=', True),
50- ('journal_id.type', 'in', ['engagement', 'revaluation']),
51+ ('journal_id.type', 'in', ['engagement', 'revaluation', 'cur_adj']),
52 ('from_write_off', '=', True),
53 ('move_state', '=', 'draft'),
54 ('move_id', '=', False),
55- ('move_id.corrected_upstream', '=', True)
56+ ('move_id.corrected_upstream', '=', True),
57+ ('general_account_id', 'in', not_ad_correctable_acc_ids),
58 ]
59
60 search_ns_ids = self.pool.get('account.analytic.line').search(cr, uid, search_args, context=context)
61@@ -326,6 +331,7 @@
62 process_ids = []
63 account_id = False
64 date = False
65+ gl_acc_obj = self.pool.get('account.account')
66 company = self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id
67 level = company and company.instance_id and company.instance_id.level or ''
68 # Browse given wizard
69@@ -341,28 +347,34 @@
70 # - that have been reversed
71 # - that come from an engagement journal
72 # - that come from a write-off (is_write_off = True)
73+ # - that are booked on G/L account set as is_not_ad_correctable
74+ # - that are booked on a Currency Adj. Analytic Journal
75 account_field_name = 'account_id'
76 if wiz.account_id.category == 'OC':
77 account_field_name = 'cost_center_id'
78+ not_ad_correctable_acc_ids = gl_acc_obj.search(cr, uid, [('is_not_ad_correctable', '=', True)],
79+ order='NO_ORDER', context=context)
80 search_args = [
81- ('id', 'in', to_process), '|', '|', '|', '|', '|', '|',
82+ ('id', 'in', to_process), '|', '|', '|', '|', '|', '|', '|',
83 (account_field_name, '=', account_id),
84 ('commitment_line_id', '!=', False), ('is_reallocated', '=', True),
85 ('is_reversal', '=', True),
86- ('journal_id.type', '=', 'engagement'),
87+ ('journal_id.type', 'in', ['engagement', 'cur_adj']),
88 ('from_write_off', '=', True),
89 ('move_state', '=', 'draft'),
90+ ('general_account_id', 'in', not_ad_correctable_acc_ids),
91 ]
92 if level == 'project':
93 search_args = [
94- ('id', 'in', context.get('active_ids')), '|', '|', '|', '|', '|', '|', '|',
95+ ('id', 'in', context.get('active_ids')), '|', '|', '|', '|', '|', '|', '|', '|',
96 ('commitment_line_id', '!=', False), ('is_reallocated', '=', True),
97 ('is_reversal', '=', True),
98- ('journal_id.type', 'in', ['engagement', 'revaluation']),
99+ ('journal_id.type', 'in', ['engagement', 'revaluation', 'cur_adj']),
100 ('from_write_off', '=', True),
101 ('move_state', '=', 'draft'),
102 ('move_id', '=', False),
103- ('move_id.corrected_upstream', '=', True)
104+ ('move_id.corrected_upstream', '=', True),
105+ ('general_account_id', 'in', not_ad_correctable_acc_ids),
106 ]
107 search_ns_ids = self.pool.get('account.analytic.line').search(cr, uid, search_args)
108 if search_ns_ids:
109
110=== modified file 'bin/addons/msf_profile/i18n/fr_MF.po'
111--- bin/addons/msf_profile/i18n/fr_MF.po 2018-06-15 12:30:42 +0000
112+++ bin/addons/msf_profile/i18n/fr_MF.po 2018-07-09 08:35:51 +0000
113@@ -101265,3 +101265,12 @@
114 msgid "Not Invoice"
115 msgstr "Pas de Facture"
116
117+#. module: analytic_distribution
118+#: view:mass.reallocation.wizard:0
119+msgid "- Items booked on accounts set as \"Prevent correction on analytic accounts\""
120+msgstr "- Ecritures enregistrées sur des comptes définis comme \"Empêcher la correction sur les comptes analytiques\""
121+
122+#. module: analytic_distribution
123+#: view:mass.reallocation.wizard:0
124+msgid "- Items booked on a Currency Adjustment Analytic Journal"
125+msgstr "- Ecritures enregistrées sur un Journal Analytique de type Ajustement de Devise"

Subscribers

People subscribed via source and target branches