Merge lp:~julie-w/unifield-server/US-5771 into lp:unifield-server
- US-5771
- Merge into trunk
Proposed by
jftempo
Status: | Merged |
---|---|
Merged at revision: | 5372 |
Proposed branch: | lp:~julie-w/unifield-server/US-5771 |
Merge into: | lp:unifield-server |
Diff against target: |
1509 lines (+707/-170) 22 files modified
bin/addons/account_corrections/wizard/analytic_distribution_wizard.py (+6/-0) bin/addons/account_hq_entries/hq_entries.py (+10/-0) bin/addons/analytic_distribution/account.py (+5/-75) bin/addons/analytic_distribution/analytic_account_view.xml (+75/-4) bin/addons/analytic_distribution/analytic_distribution.py (+26/-1) bin/addons/analytic_distribution/analytic_distribution_wizard_view.xml (+10/-4) bin/addons/analytic_distribution/analytic_line.py (+16/-6) bin/addons/analytic_distribution/report/funding_pool.py (+0/-27) bin/addons/analytic_distribution/report/funding_pool.rml (+28/-28) bin/addons/analytic_distribution/wizard/analytic_distribution_wizard.py (+26/-4) bin/addons/analytic_override/analytic_account.py (+90/-0) bin/addons/msf_doc_import/account.py (+5/-0) bin/addons/msf_doc_import/msf_import_export.py (+123/-4) bin/addons/msf_doc_import/msf_import_export_conf.py (+91/-5) bin/addons/msf_homere_interface/hr.py (+25/-1) bin/addons/msf_homere_interface/hr_payroll.py (+7/-0) bin/addons/msf_homere_interface/hr_payroll_wizard.xml (+5/-2) bin/addons/msf_homere_interface/hr_view.xml (+1/-1) bin/addons/msf_profile/data/patches.xml (+5/-0) bin/addons/msf_profile/i18n/fr_MF.po (+134/-8) bin/addons/msf_profile/msf_profile.py (+18/-0) bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv (+1/-0) |
To merge this branch: | bzr merge lp:~julie-w/unifield-server/US-5771 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Reviewer Team | Pending | ||
Review via email: mp+366989@code.launchpad.net |
Commit message
Description of the change
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_corrections/wizard/analytic_distribution_wizard.py' | |||
2 | --- bin/addons/account_corrections/wizard/analytic_distribution_wizard.py 2018-09-28 16:00:25 +0000 | |||
3 | +++ bin/addons/account_corrections/wizard/analytic_distribution_wizard.py 2019-05-06 14:14:05 +0000 | |||
4 | @@ -148,6 +148,7 @@ | |||
5 | 148 | context = {} | 148 | context = {} |
6 | 149 | # Prepare some values | 149 | # Prepare some values |
7 | 150 | wizard = self.browse(cr, uid, wizard_id) | 150 | wizard = self.browse(cr, uid, wizard_id) |
8 | 151 | ad_obj = self.pool.get('analytic.distribution') | ||
9 | 151 | company_currency_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.currency_id.id | 152 | company_currency_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.currency_id.id |
10 | 152 | ml = wizard.move_line_id | 153 | ml = wizard.move_line_id |
11 | 153 | orig_date = ml.source_date or ml.date | 154 | orig_date = ml.source_date or ml.date |
12 | @@ -240,6 +241,11 @@ | |||
13 | 240 | break | 241 | break |
14 | 241 | 242 | ||
15 | 242 | for wiz_line in self.pool.get('analytic.distribution.wizard.fp.lines').browse(cr, uid, wiz_line_ids): | 243 | for wiz_line in self.pool.get('analytic.distribution.wizard.fp.lines').browse(cr, uid, wiz_line_ids): |
16 | 244 | if not ad_obj.check_dest_cc_compatibility(cr, uid, wiz_line.destination_id.id, wiz_line.cost_center_id.id, context=context): | ||
17 | 245 | raise osv.except_osv(_('Error'), | ||
18 | 246 | _('The Cost Center %s is not compatible with the Destination %s.') % | ||
19 | 247 | (wiz_line.cost_center_id.code or '', wiz_line.destination_id.code or '')) | ||
20 | 248 | |||
21 | 243 | if not wiz_line.distribution_line_id or wiz_line.distribution_line_id.id not in old_line_ids: | 249 | if not wiz_line.distribution_line_id or wiz_line.distribution_line_id.id not in old_line_ids: |
22 | 244 | # new distribution line | 250 | # new distribution line |
23 | 245 | #if self.pool.get('account.analytic.account').is_blocked_by_a_contract(cr, uid, [wiz_line.analytic_id.id]): | 251 | #if self.pool.get('account.analytic.account').is_blocked_by_a_contract(cr, uid, [wiz_line.analytic_id.id]): |
24 | 246 | 252 | ||
25 | === modified file 'bin/addons/account_hq_entries/hq_entries.py' | |||
26 | --- bin/addons/account_hq_entries/hq_entries.py 2019-03-07 10:00:29 +0000 | |||
27 | +++ bin/addons/account_hq_entries/hq_entries.py 2019-05-06 14:14:05 +0000 | |||
28 | @@ -42,6 +42,7 @@ | |||
29 | 42 | # Prepare some values | 42 | # Prepare some values |
30 | 43 | res = {} | 43 | res = {} |
31 | 44 | logger = netsvc.Logger() | 44 | logger = netsvc.Logger() |
32 | 45 | ad_obj = self.pool.get('analytic.distribution') | ||
33 | 45 | # Search MSF Private Fund element, because it's valid with all accounts | 46 | # Search MSF Private Fund element, because it's valid with all accounts |
34 | 46 | try: | 47 | try: |
35 | 47 | fp_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'analytic_distribution', | 48 | fp_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'analytic_distribution', |
36 | @@ -57,6 +58,7 @@ | |||
37 | 57 | # E/ DEST in list of available DEST in ACCOUNT | 58 | # E/ DEST in list of available DEST in ACCOUNT |
38 | 58 | # F/ Check posting date with cost center and destination if exists | 59 | # F/ Check posting date with cost center and destination if exists |
39 | 59 | # G/ Check document date with funding pool | 60 | # G/ Check document date with funding pool |
40 | 61 | # H/ Check Cost Center / Destination compatibility | ||
41 | 60 | ## CASES where FP is filled in (or not) and/or DEST is filled in (or not). | 62 | ## CASES where FP is filled in (or not) and/or DEST is filled in (or not). |
42 | 61 | ## CC is mandatory, so always available: | 63 | ## CC is mandatory, so always available: |
43 | 62 | # 1/ no FP, no DEST => Distro = valid | 64 | # 1/ no FP, no DEST => Distro = valid |
44 | @@ -132,6 +134,14 @@ | |||
45 | 132 | res[line.id] = 'invalid' | 134 | res[line.id] = 'invalid' |
46 | 133 | logger.notifyChannel('account_hq_entries', netsvc.LOG_WARNING, _('%s: DEST (%s) not compatible with account (%s)') % (line.id or '', line.destination_id.code or '', account.code or '')) | 135 | logger.notifyChannel('account_hq_entries', netsvc.LOG_WARNING, _('%s: DEST (%s) not compatible with account (%s)') % (line.id or '', line.destination_id.code or '', account.code or '')) |
47 | 134 | continue | 136 | continue |
48 | 137 | # H check | ||
49 | 138 | if line.destination_id and line.cost_center_id and \ | ||
50 | 139 | not ad_obj.check_dest_cc_compatibility(cr, uid, line.destination_id.id, line.cost_center_id.id, context=context): | ||
51 | 140 | res[line.id] = 'invalid' | ||
52 | 141 | logger.notifyChannel('account_hq_entries', netsvc.LOG_WARNING, | ||
53 | 142 | _('%s: CC (%s) not compatible with DEST (%s)') % | ||
54 | 143 | (line.id or '', line.cost_center_id.code or '', line.destination_id.code or '')) | ||
55 | 144 | continue | ||
56 | 135 | return res | 145 | return res |
57 | 136 | 146 | ||
58 | 137 | def _get_cc_changed(self, cr, uid, ids, field_name, arg, context=None): | 147 | def _get_cc_changed(self, cr, uid, ids, field_name, arg, context=None): |
59 | 138 | 148 | ||
60 | === modified file 'bin/addons/analytic_distribution/account.py' | |||
61 | --- bin/addons/analytic_distribution/account.py 2018-09-18 12:25:20 +0000 | |||
62 | +++ bin/addons/analytic_distribution/account.py 2019-05-06 14:14:05 +0000 | |||
63 | @@ -120,80 +120,9 @@ | |||
64 | 120 | _columns = { | 120 | _columns = { |
65 | 121 | 'account_id': fields.many2one('account.account', "G/L Account"), | 121 | 'account_id': fields.many2one('account.account', "G/L Account"), |
66 | 122 | 'funding_pool_id': fields.many2one('account.analytic.account', 'Funding Pool'), | 122 | 'funding_pool_id': fields.many2one('account.analytic.account', 'Funding Pool'), |
67 | 123 | 'destination_id': fields.many2one('account.analytic.account', 'Destination'), | ||
68 | 123 | } | 124 | } |
69 | 124 | 125 | ||
70 | 125 | def fields_get(self, cr, uid, fields=None, context=None, with_uom_rounding=False): | ||
71 | 126 | fields = super(account_destination_summary, self).fields_get(cr, uid, fields, context) | ||
72 | 127 | dest_obj = self.pool.get('account.analytic.account') | ||
73 | 128 | destination_ids = dest_obj.search(cr, uid, [('type', '!=', 'view'), ('category', '=', 'DEST'), ('parent_id', '!=', False)]) | ||
74 | 129 | for dest in dest_obj.read(cr, uid, destination_ids, ['name']): | ||
75 | 130 | fields['dest_%s'%(dest['id'])] = {'type': 'boolean', 'string': dest['name']} | ||
76 | 131 | return fields | ||
77 | 132 | |||
78 | 133 | def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): | ||
79 | 134 | view = super(account_destination_summary, self).fields_view_get(cr, uid, view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu) | ||
80 | 135 | if view_type == 'tree': | ||
81 | 136 | fields_to_add = [] | ||
82 | 137 | form = etree.fromstring(view['arch']) | ||
83 | 138 | tree = form.xpath('//tree') | ||
84 | 139 | for field in view.get('fields', {}): | ||
85 | 140 | if field.startswith('dest_'): | ||
86 | 141 | fields_to_add.append(int(field.split('_')[1])) | ||
87 | 142 | |||
88 | 143 | if fields_to_add: | ||
89 | 144 | for dest_order in self.pool.get('account.analytic.account').search(cr, uid, [('id', 'in', fields_to_add)], order='name'): | ||
90 | 145 | new_field = etree.Element('field', attrib={'name': 'dest_%d'%dest_order}) | ||
91 | 146 | tree[0].append(new_field) | ||
92 | 147 | view['arch'] = etree.tostring(form) | ||
93 | 148 | return view | ||
94 | 149 | |||
95 | 150 | def read(self, cr, uid, ids, fields_to_read=None, context=None, load='_classic_read'): | ||
96 | 151 | first = False | ||
97 | 152 | if isinstance(ids, (int, long)): | ||
98 | 153 | ids = [ids] | ||
99 | 154 | first = True | ||
100 | 155 | if fields_to_read is None: | ||
101 | 156 | fields_to_read = [] | ||
102 | 157 | ret = super(account_destination_summary, self).read(cr, uid, ids, fields_to_read, context, load) | ||
103 | 158 | f_to_read = [] | ||
104 | 159 | for field in fields_to_read: | ||
105 | 160 | if field.startswith('dest_'): | ||
106 | 161 | f_to_read.append(field) | ||
107 | 162 | |||
108 | 163 | if f_to_read: | ||
109 | 164 | cr.execute(''' | ||
110 | 165 | SELECT | ||
111 | 166 | sum.id, | ||
112 | 167 | l.destination_id | ||
113 | 168 | FROM | ||
114 | 169 | account_destination_link l, | ||
115 | 170 | account_destination_summary sum, | ||
116 | 171 | funding_pool_associated_destinations d | ||
117 | 172 | WHERE | ||
118 | 173 | l.disabled = 'f' and | ||
119 | 174 | d.tuple_id = l.id and | ||
120 | 175 | sum.account_id = l.account_id and | ||
121 | 176 | sum.funding_pool_id = d.funding_pool_id and | ||
122 | 177 | sum.id in %s | ||
123 | 178 | ''',(tuple(ids),) | ||
124 | 179 | ) | ||
125 | 180 | tmp_result = {} | ||
126 | 181 | for x in cr.fetchall(): | ||
127 | 182 | tmp_result.setdefault(x[0], []).append(x[1]) | ||
128 | 183 | |||
129 | 184 | for x in ret: | ||
130 | 185 | for dest in tmp_result.get(x['id'], []): | ||
131 | 186 | x['dest_%s'%(dest,)] = True | ||
132 | 187 | for false_value in f_to_read: | ||
133 | 188 | if false_value not in x: | ||
134 | 189 | x[false_value] = False | ||
135 | 190 | |||
136 | 191 | if first: | ||
137 | 192 | return ret[0] | ||
138 | 193 | return ret | ||
139 | 194 | |||
140 | 195 | |||
141 | 196 | |||
142 | 197 | def init(self, cr): | 126 | def init(self, cr): |
143 | 198 | # test if id exists in funding_pool_associated_destinations or create it | 127 | # test if id exists in funding_pool_associated_destinations or create it |
144 | 199 | cr.execute("SELECT attr.attname FROM pg_attribute attr, pg_class class WHERE attr.attrelid = class.oid AND class.relname = 'funding_pool_associated_destinations' AND attr.attname='id'") | 128 | cr.execute("SELECT attr.attname FROM pg_attribute attr, pg_class class WHERE attr.attrelid = class.oid AND class.relname = 'funding_pool_associated_destinations' AND attr.attname='id'") |
145 | @@ -206,7 +135,8 @@ | |||
146 | 206 | SELECT | 135 | SELECT |
147 | 207 | min(d.id) AS id, | 136 | min(d.id) AS id, |
148 | 208 | l.account_id AS account_id, | 137 | l.account_id AS account_id, |
150 | 209 | d.funding_pool_id AS funding_pool_id | 138 | d.funding_pool_id AS funding_pool_id, |
151 | 139 | l.destination_id AS destination_id | ||
152 | 210 | FROM | 140 | FROM |
153 | 211 | account_destination_link l, | 141 | account_destination_link l, |
154 | 212 | funding_pool_associated_destinations d | 142 | funding_pool_associated_destinations d |
155 | @@ -214,10 +144,10 @@ | |||
156 | 214 | d.tuple_id = l.id and | 144 | d.tuple_id = l.id and |
157 | 215 | l.disabled = 'f' | 145 | l.disabled = 'f' |
158 | 216 | GROUP BY | 146 | GROUP BY |
160 | 217 | l.account_id,d.funding_pool_id | 147 | l.account_id, d.funding_pool_id, l.destination_id |
161 | 218 | ) | 148 | ) |
162 | 219 | """) | 149 | """) |
164 | 220 | _order = 'account_id' | 150 | _order = 'funding_pool_id, account_id, destination_id' |
165 | 221 | account_destination_summary() | 151 | account_destination_summary() |
166 | 222 | 152 | ||
167 | 223 | class account_account(osv.osv): | 153 | class account_account(osv.osv): |
168 | 224 | 154 | ||
169 | === modified file 'bin/addons/analytic_distribution/analytic_account_view.xml' | |||
170 | --- bin/addons/analytic_distribution/analytic_account_view.xml 2018-04-03 13:02:04 +0000 | |||
171 | +++ bin/addons/analytic_distribution/analytic_account_view.xml 2019-05-06 14:14:05 +0000 | |||
172 | @@ -97,9 +97,6 @@ | |||
173 | 97 | <separator/> | 97 | <separator/> |
174 | 98 | <field name="tuple_destination_account_ids" nolabel="1" context="{'dest_in_use':tuple_destination_account_ids}"/> | 98 | <field name="tuple_destination_account_ids" nolabel="1" context="{'dest_in_use':tuple_destination_account_ids}"/> |
175 | 99 | </page> | 99 | </page> |
176 | 100 | <page string="Destinations by accounts" attrs="{'invisible': [('category', '!=', 'FUNDING')]}"> | ||
177 | 101 | <field name="tuple_destination_summary" nolabel="1" readonly="1"/> | ||
178 | 102 | </page> | ||
179 | 103 | <page string="Expense accounts" attrs="{'invisible': [('category', '!=', 'DEST')]}"> | 100 | <page string="Expense accounts" attrs="{'invisible': [('category', '!=', 'DEST')]}"> |
180 | 104 | <field name="destination_ids" nolabel="1" domain="[('type', '!=', 'view'), ('is_analytic_addicted', '=', True)]" context="{'destination_id': record_id}"> | 101 | <field name="destination_ids" nolabel="1" domain="[('type', '!=', 'view'), ('is_analytic_addicted', '=', True)]" context="{'destination_id': record_id}"> |
181 | 105 | <tree string="Expenses accounts list" colors="red:inactivated_for_dest"> | 102 | <tree string="Expenses accounts list" colors="red:inactivated_for_dest"> |
182 | @@ -111,6 +108,17 @@ | |||
183 | 111 | </tree> | 108 | </tree> |
184 | 112 | </field> | 109 | </field> |
185 | 113 | </page> | 110 | </page> |
186 | 111 | <page string="Cost Centers" attrs="{'invisible': [('category', '!=', 'DEST')]}"> | ||
187 | 112 | <field name="allow_all_cc" colspan="4" on_change="on_change_allow_all_cc(allow_all_cc, dest_cc_ids)"/> | ||
188 | 113 | <button name="button_dest_cc_clear" type="object" string="Remove all" icon="gtk-clear" colspan="4"/> | ||
189 | 114 | <separator/> | ||
190 | 115 | <field name="dest_cc_ids" nolabel="1" colspan="4" on_change="on_change_dest_cc_ids(dest_cc_ids)"> | ||
191 | 116 | <tree string="Cost Centers"> | ||
192 | 117 | <field name="code"/> | ||
193 | 118 | <field name="name"/> | ||
194 | 119 | </tree> | ||
195 | 120 | </field> | ||
196 | 121 | </page> | ||
197 | 114 | </page> | 122 | </page> |
198 | 115 | </data> | 123 | </data> |
199 | 116 | </field> | 124 | </field> |
200 | @@ -121,8 +129,10 @@ | |||
201 | 121 | <field name="model">account.destination.summary</field> | 129 | <field name="model">account.destination.summary</field> |
202 | 122 | <field name="type">tree</field> | 130 | <field name="type">tree</field> |
203 | 123 | <field name="arch" type="xml"> | 131 | <field name="arch" type="xml"> |
205 | 124 | <tree string="Destinations by accounts"> | 132 | <tree string="Destinations by accounts" hide_new_button="1" hide_edit_button="1" hide_delete_button="1"> |
206 | 133 | <field name="funding_pool_id"/> | ||
207 | 125 | <field name="account_id" /> | 134 | <field name="account_id" /> |
208 | 135 | <field name="destination_id"/> | ||
209 | 126 | </tree> | 136 | </tree> |
210 | 127 | </field> | 137 | </field> |
211 | 128 | </record> | 138 | </record> |
212 | @@ -275,6 +285,67 @@ | |||
213 | 275 | <field name="context">{'search_default_active': 1, 'filter_inactive_accounts': 1, 'from_web': True, 'display_disabled': 1}</field> | 285 | <field name="context">{'search_default_active': 1, 'filter_inactive_accounts': 1, 'from_web': True, 'display_disabled': 1}</field> |
214 | 276 | </record> | 286 | </record> |
215 | 277 | 287 | ||
216 | 288 | <!-- Destinations by accounts Search view --> | ||
217 | 289 | <record id="view_account_destination_summary_search" model="ir.ui.view"> | ||
218 | 290 | <field name="name">account.destination.summary.search</field> | ||
219 | 291 | <field name="model">account.destination.summary</field> | ||
220 | 292 | <field name="type">search</field> | ||
221 | 293 | <field name="priority" eval="16"/> | ||
222 | 294 | <field name="arch" type="xml"> | ||
223 | 295 | <search> | ||
224 | 296 | <group> | ||
225 | 297 | <field name="funding_pool_id" domain="[('type', '!=', 'view'), ('category', '=', 'FUNDING')]"/> | ||
226 | 298 | <field name="account_id" domain="[('type', '!=', 'view'), ('is_analytic_addicted', '=', True)]"/> | ||
227 | 299 | <field name="destination_id" domain="[('type', '!=', 'view'), ('category', '=', 'DEST')]"/> | ||
228 | 300 | </group> | ||
229 | 301 | <newline/> | ||
230 | 302 | <group expand="1" string="Group By..."> | ||
231 | 303 | <filter string="Funding Pool" name="group_funding_pool_id" | ||
232 | 304 | icon="terp-folder-blue" domain="[]" context="{'group_by':'funding_pool_id'}"/> | ||
233 | 305 | <separator orientation="vertical"/> | ||
234 | 306 | <filter string="G/L account" name="group_account_id" | ||
235 | 307 | icon="terp-folder-orange" domain="[]" context="{'group_by':'account_id'}"/> | ||
236 | 308 | <separator orientation="vertical"/> | ||
237 | 309 | <filter string="Destination" name="group_destination_id" | ||
238 | 310 | icon="terp-folder-violet" domain="[]" context="{'group_by':'destination_id'}"/> | ||
239 | 311 | </group> | ||
240 | 312 | </search> | ||
241 | 313 | </field> | ||
242 | 314 | </record> | ||
243 | 315 | |||
244 | 316 | <!-- Destinations by accounts Form view --> | ||
245 | 317 | <record id="view_account_destination_summary_form" model="ir.ui.view"> | ||
246 | 318 | <field name="name">account.destination.summary.form</field> | ||
247 | 319 | <field name="model">account.destination.summary</field> | ||
248 | 320 | <field name="type">form</field> | ||
249 | 321 | <field name="priority" eval="16"/> | ||
250 | 322 | <field name="arch" type="xml"> | ||
251 | 323 | <!-- this form must be read-only: acc/dest links must be created in the Destination tab of the FP --> | ||
252 | 324 | <form noteditable="1" hide_delete_button="1" hide_new_button="1"> | ||
253 | 325 | <field name="funding_pool_id"/> | ||
254 | 326 | <newline/> | ||
255 | 327 | <field name="account_id"/> | ||
256 | 328 | <field name="destination_id"/> | ||
257 | 329 | </form> | ||
258 | 330 | </field> | ||
259 | 331 | </record> | ||
260 | 332 | |||
261 | 333 | <!-- Destinations by accounts Menu entry --> | ||
262 | 334 | <record id="action_analytic_acc_dest_summary" model="ir.actions.server"> | ||
263 | 335 | <field name="name">Destinations by accounts</field> | ||
264 | 336 | <field name="model_id" ref="model_account_analytic_account"/> | ||
265 | 337 | <field name="state">code</field> | ||
266 | 338 | <field name="code">action = obj.get_destinations_by_accounts(context=context)</field> | ||
267 | 339 | </record> | ||
268 | 340 | <record id="ir_destinations_by_accounts_search" model="ir.values"> | ||
269 | 341 | <field name="key2">client_action_relate</field> | ||
270 | 342 | <field name="model">account.analytic.account</field> | ||
271 | 343 | <field name="name">destinations_by_accounts</field> | ||
272 | 344 | <field eval="'ir.actions.server,%d'%action_analytic_acc_dest_summary" name="value"/> | ||
273 | 345 | <field eval="True" name="object"/> | ||
274 | 346 | <field name="sequence" eval="110"/> | ||
275 | 347 | </record> | ||
276 | 348 | |||
277 | 278 | <menuitem action="action_account_analytic_account_form" | 349 | <menuitem action="action_account_analytic_account_form" |
278 | 279 | id="account.account_analytic_def_account" | 350 | id="account.account_analytic_def_account" |
279 | 280 | parent="account.menu_analytic_accounting" | 351 | parent="account.menu_analytic_accounting" |
280 | 281 | 352 | ||
281 | === modified file 'bin/addons/analytic_distribution/analytic_distribution.py' | |||
282 | --- bin/addons/analytic_distribution/analytic_distribution.py 2019-03-28 15:40:47 +0000 | |||
283 | +++ bin/addons/analytic_distribution/analytic_distribution.py 2019-05-06 14:14:05 +0000 | |||
284 | @@ -26,6 +26,22 @@ | |||
285 | 26 | _name = 'analytic.distribution' | 26 | _name = 'analytic.distribution' |
286 | 27 | _inherit = 'analytic.distribution' | 27 | _inherit = 'analytic.distribution' |
287 | 28 | 28 | ||
288 | 29 | def check_dest_cc_compatibility(self, cr, uid, destination_id, cost_center_id, context=None): | ||
289 | 30 | """ | ||
290 | 31 | Checks the compatibility between the Destination and the Cost Center (cf. CC tab in the Destination form). | ||
291 | 32 | Returns False if they aren't compatible. | ||
292 | 33 | """ | ||
293 | 34 | if context is None: | ||
294 | 35 | context = {} | ||
295 | 36 | analytic_acc_obj = self.pool.get('account.analytic.account') | ||
296 | 37 | if destination_id and cost_center_id: | ||
297 | 38 | dest = analytic_acc_obj.browse(cr, uid, destination_id, fields_to_fetch=['category', 'allow_all_cc', 'dest_cc_ids'], context=context) | ||
298 | 39 | cc = analytic_acc_obj.browse(cr, uid, cost_center_id, fields_to_fetch=['category'], context=context) | ||
299 | 40 | if dest and cc and dest.category == 'DEST' and cc.category == 'OC' and not dest.allow_all_cc and \ | ||
300 | 41 | cc.id not in [c.id for c in dest.dest_cc_ids]: | ||
301 | 42 | return False | ||
302 | 43 | return True | ||
303 | 44 | |||
304 | 29 | def _get_distribution_state(self, cr, uid, distrib_id, parent_id, account_id, context=None): | 45 | def _get_distribution_state(self, cr, uid, distrib_id, parent_id, account_id, context=None): |
305 | 30 | """ | 46 | """ |
306 | 31 | Return distribution state | 47 | Return distribution state |
307 | @@ -51,17 +67,23 @@ | |||
308 | 51 | except ValueError: | 67 | except ValueError: |
309 | 52 | fp_id = 0 | 68 | fp_id = 0 |
310 | 53 | account = self.pool.get('account.account').read(cr, uid, account_id, ['destination_ids']) | 69 | account = self.pool.get('account.account').read(cr, uid, account_id, ['destination_ids']) |
312 | 54 | # Check Cost Center lines with destination/account link | 70 | # Check Cost Center lines regarding destination/account and destination/CC links |
313 | 55 | for cc_line in distrib.cost_center_lines: | 71 | for cc_line in distrib.cost_center_lines: |
314 | 56 | if cc_line.destination_id.id not in account.get('destination_ids', []): | 72 | if cc_line.destination_id.id not in account.get('destination_ids', []): |
315 | 57 | return 'invalid' | 73 | return 'invalid' |
316 | 74 | if not self.check_dest_cc_compatibility(cr, uid, cc_line.destination_id.id, | ||
317 | 75 | cc_line.analytic_id and cc_line.analytic_id.id or False, context=context): | ||
318 | 76 | return 'invalid' | ||
319 | 58 | # Check Funding pool lines regarding: | 77 | # Check Funding pool lines regarding: |
320 | 59 | # - destination / account | 78 | # - destination / account |
321 | 79 | # - destination / cost center | ||
322 | 60 | # - If analytic account is MSF Private funds | 80 | # - If analytic account is MSF Private funds |
323 | 61 | # - Cost center and funding pool compatibility | 81 | # - Cost center and funding pool compatibility |
324 | 62 | for fp_line in distrib.funding_pool_lines: | 82 | for fp_line in distrib.funding_pool_lines: |
325 | 63 | if fp_line.destination_id.id not in account.get('destination_ids', []): | 83 | if fp_line.destination_id.id not in account.get('destination_ids', []): |
326 | 64 | return 'invalid' | 84 | return 'invalid' |
327 | 85 | if not self.check_dest_cc_compatibility(cr, uid, fp_line.destination_id.id, fp_line.cost_center_id.id, context=context): | ||
328 | 86 | return 'invalid' | ||
329 | 65 | # If fp_line is MSF Private Fund, all is ok | 87 | # If fp_line is MSF Private Fund, all is ok |
330 | 66 | if fp_line.analytic_id.id == fp_id: | 88 | if fp_line.analytic_id.id == fp_id: |
331 | 67 | continue | 89 | continue |
332 | @@ -96,6 +118,9 @@ | |||
333 | 96 | # Check that destination is compatible with account | 118 | # Check that destination is compatible with account |
334 | 97 | if destination_id not in [x.id for x in account.destination_ids]: | 119 | if destination_id not in [x.id for x in account.destination_ids]: |
335 | 98 | return 'invalid', _('Destination not compatible with account') | 120 | return 'invalid', _('Destination not compatible with account') |
336 | 121 | # Check that Destination and Cost Center are compatible | ||
337 | 122 | if not self.check_dest_cc_compatibility(cr, uid, destination_id, cost_center_id, context=context): | ||
338 | 123 | return 'invalid', _('Cost Center not compatible with destination') | ||
339 | 99 | if not is_private_fund: | 124 | if not is_private_fund: |
340 | 100 | # Check that cost center is compatible with FP (except if FP is MSF Private Fund) | 125 | # Check that cost center is compatible with FP (except if FP is MSF Private Fund) |
341 | 101 | if cost_center_id not in [x.id for x in fp.cost_center_ids]: | 126 | if cost_center_id not in [x.id for x in fp.cost_center_ids]: |
342 | 102 | 127 | ||
343 | === modified file 'bin/addons/analytic_distribution/analytic_distribution_wizard_view.xml' | |||
344 | --- bin/addons/analytic_distribution/analytic_distribution_wizard_view.xml 2018-06-22 09:57:41 +0000 | |||
345 | +++ bin/addons/analytic_distribution/analytic_distribution_wizard_view.xml 2019-05-06 14:14:05 +0000 | |||
346 | @@ -10,8 +10,10 @@ | |||
347 | 10 | <field name="arch" type='xml'> | 10 | <field name="arch" type='xml'> |
348 | 11 | <tree string="" editable="top"> | 11 | <tree string="" editable="top"> |
349 | 12 | <field name="is_percentage_amount_touched" invisible="1" /> | 12 | <field name="is_percentage_amount_touched" invisible="1" /> |
350 | 13 | <field name="analytic_id" domain="[('type', '!=', 'view'), ('category', '=', 'OC'), ('state', '=', 'open')]" | ||
351 | 14 | string="Cost Center" | ||
352 | 15 | context="{'search_default_active': 1, 'hide_inactive': 1, 'date': context.get('posting_date')}"/> | ||
353 | 13 | <field name="destination_id" context="{'search_default_active': 1, 'hide_inactive': 1, 'date': context.get('posting_date')}"/> | 16 | <field name="destination_id" context="{'search_default_active': 1, 'hide_inactive': 1, 'date': context.get('posting_date')}"/> |
354 | 14 | <field name="analytic_id" domain="[('type', '!=', 'view'), ('category', '=', 'OC'), ('state', '=', 'open')]" string="Cost Center" context="{'search_default_active': 1, 'hide_inactive': 1, 'date': context.get('posting_date')}"/> | ||
355 | 15 | <field name="percentage" sum="Total Percentage" digits="(16,2)"/> | 17 | <field name="percentage" sum="Total Percentage" digits="(16,2)"/> |
356 | 16 | <field name="amount" sum="Total Amount"/> | 18 | <field name="amount" sum="Total Amount"/> |
357 | 17 | </tree> | 19 | </tree> |
358 | @@ -25,9 +27,13 @@ | |||
359 | 25 | <field name="arch" type='xml'> | 27 | <field name="arch" type='xml'> |
360 | 26 | <tree string="" editable="top"> | 28 | <tree string="" editable="top"> |
361 | 27 | <field name="is_percentage_amount_touched" invisible="1" /> | 29 | <field name="is_percentage_amount_touched" invisible="1" /> |
365 | 28 | <field name="destination_id" on_change="onchange_destination(destination_id, analytic_id, parent.account_id)" context="{'search_default_active': 1, 'hide_inactive': 1, 'date': context.get('posting_date')}"/> | 30 | <field name="cost_center_id" on_change="onchange_cost_center(cost_center_id, analytic_id)" |
366 | 29 | <field name="cost_center_id" on_change="onchange_cost_center(cost_center_id, analytic_id)" context="{'search_default_active': 1, 'hide_inactive': 1, 'date': context.get('posting_date')}"/> | 31 | context="{'search_default_active': 1, 'hide_inactive': 1, 'date': context.get('posting_date')}"/> |
367 | 30 | <field name="analytic_id" domain="[('type', '!=', 'view'), ('category', '=', 'FUNDING'), ('state', '=', 'open'), ('cost_center_ids', '=', cost_center_id)]" string="Funding Pool" context="{'search_default_active': 1, 'hide_inactive': 1, 'date': context.get('document_date')}"/> | 32 | <field name="destination_id" on_change="onchange_destination(destination_id, analytic_id, parent.account_id)" |
368 | 33 | context="{'search_default_active': 1, 'hide_inactive': 1, 'date': context.get('posting_date')}"/> | ||
369 | 34 | <field name="analytic_id" | ||
370 | 35 | domain="[('type', '!=', 'view'), ('category', '=', 'FUNDING'), ('state', '=', 'open'), ('cost_center_ids', '=', cost_center_id)]" | ||
371 | 36 | string="Funding Pool" context="{'search_default_active': 1, 'hide_inactive': 1, 'date': context.get('document_date')}"/> | ||
372 | 31 | <field name="percentage" sum="Total Percentage" digits="(16,2)"/> | 37 | <field name="percentage" sum="Total Percentage" digits="(16,2)"/> |
373 | 32 | <field name="amount" sum="Total Amount"/> | 38 | <field name="amount" sum="Total Amount"/> |
374 | 33 | </tree> | 39 | </tree> |
375 | 34 | 40 | ||
376 | === modified file 'bin/addons/analytic_distribution/analytic_line.py' | |||
377 | --- bin/addons/analytic_distribution/analytic_line.py 2018-08-21 13:08:14 +0000 | |||
378 | +++ bin/addons/analytic_distribution/analytic_line.py 2019-05-06 14:14:05 +0000 | |||
379 | @@ -401,6 +401,7 @@ | |||
380 | 401 | if isinstance(ids, (int, long)): | 401 | if isinstance(ids, (int, long)): |
381 | 402 | ids = [ids] | 402 | ids = [ids] |
382 | 403 | # Prepare some value | 403 | # Prepare some value |
383 | 404 | ad_obj = self.pool.get('analytic.distribution') | ||
384 | 404 | account = self.pool.get('account.analytic.account').read(cr, uid, account_id, ['category', 'date_start', 'date'], context=context) | 405 | account = self.pool.get('account.analytic.account').read(cr, uid, account_id, ['category', 'date_start', 'date'], context=context) |
385 | 405 | account_type = account and account.get('category', False) or False | 406 | account_type = account and account.get('category', False) or False |
386 | 406 | res = [] | 407 | res = [] |
387 | @@ -442,12 +443,13 @@ | |||
388 | 442 | check_accounts = self.pool.get('account.analytic.account').is_blocked_by_a_contract(cr, uid, [aline.account_id.id]) | 443 | check_accounts = self.pool.get('account.analytic.account').is_blocked_by_a_contract(cr, uid, [aline.account_id.id]) |
389 | 443 | if check_accounts and aline.account_id.id in check_accounts: | 444 | if check_accounts and aline.account_id.id in check_accounts: |
390 | 444 | continue | 445 | continue |
396 | 445 | 446 | if ad_obj.check_dest_cc_compatibility(cr, uid, aline.destination_id and aline.destination_id.id or False, | |
397 | 446 | if aline.account_id and aline.account_id.id == msf_private_fund: | 447 | account_id, context=context): |
398 | 447 | res.append(aline.id) | 448 | if aline.account_id and aline.account_id.id == msf_private_fund: |
394 | 448 | elif aline.account_id and aline.cost_center_id and aline.account_id.cost_center_ids: | ||
395 | 449 | if account_id in [x and x.id for x in aline.account_id.cost_center_ids] or aline.account_id.id == msf_private_fund: | ||
399 | 450 | res.append(aline.id) | 449 | res.append(aline.id) |
400 | 450 | elif aline.account_id and aline.cost_center_id and aline.account_id.cost_center_ids: | ||
401 | 451 | if account_id in [x and x.id for x in aline.account_id.cost_center_ids] or aline.account_id.id == msf_private_fund: | ||
402 | 452 | res.append(aline.id) | ||
403 | 451 | elif account_type == 'FUNDING': | 453 | elif account_type == 'FUNDING': |
404 | 452 | fp = self.pool.get('account.analytic.account').read(cr, uid, account_id, ['cost_center_ids', 'tuple_destination_account_ids'], context=context) | 454 | fp = self.pool.get('account.analytic.account').read(cr, uid, account_id, ['cost_center_ids', 'tuple_destination_account_ids'], context=context) |
405 | 453 | cc_ids = fp and fp.get('cost_center_ids', []) or [] | 455 | cc_ids = fp and fp.get('cost_center_ids', []) or [] |
406 | @@ -473,7 +475,8 @@ | |||
407 | 473 | res.append(aline.id) | 475 | res.append(aline.id) |
408 | 474 | elif account_type == "DEST": | 476 | elif account_type == "DEST": |
409 | 475 | for aline in self.browse(cr, uid, ids, context=context): | 477 | for aline in self.browse(cr, uid, ids, context=context): |
411 | 476 | if aline.general_account_id and account_id in [x.id for x in aline.general_account_id.destination_ids]: | 478 | if ad_obj.check_dest_cc_compatibility(cr, uid, account_id, aline.cost_center_id and aline.cost_center_id.id or False, context=context) and \ |
412 | 479 | aline.general_account_id and account_id in [x.id for x in aline.general_account_id.destination_ids]: | ||
413 | 477 | res.append(aline.id) | 480 | res.append(aline.id) |
414 | 478 | else: | 481 | else: |
415 | 479 | # Case of FREE1 and FREE2 lines | 482 | # Case of FREE1 and FREE2 lines |
416 | @@ -507,6 +510,7 @@ | |||
417 | 507 | new_dest_id, new_dest_br, | 510 | new_dest_id, new_dest_br, |
418 | 508 | new_cc_id, new_cc_br, | 511 | new_cc_id, new_cc_br, |
419 | 509 | new_fp_id, new_fp_br): | 512 | new_fp_id, new_fp_br): |
420 | 513 | ad_obj = self.pool.get('analytic.distribution') | ||
421 | 510 | if not general_account_br.is_analytic_addicted: | 514 | if not general_account_br.is_analytic_addicted: |
422 | 511 | res.append((id, entry_sequence, '')) | 515 | res.append((id, entry_sequence, '')) |
423 | 512 | return False | 516 | return False |
424 | @@ -518,6 +522,12 @@ | |||
425 | 518 | res.append((id, entry_sequence, _('DEST'))) | 522 | res.append((id, entry_sequence, _('DEST'))) |
426 | 519 | return False | 523 | return False |
427 | 520 | 524 | ||
428 | 525 | # check cost center with destination | ||
429 | 526 | if new_dest_id and new_cc_id: | ||
430 | 527 | if not ad_obj.check_dest_cc_compatibility(cr, uid, new_dest_id, new_cc_id, context=context): | ||
431 | 528 | res.append((id, entry_sequence, _('CC/DEST'))) | ||
432 | 529 | return False | ||
433 | 530 | |||
434 | 521 | # check funding pool (expect for MSF Private Fund) | 531 | # check funding pool (expect for MSF Private Fund) |
435 | 522 | if not new_fp_id == msf_pf_id: # all OK for MSF Private Fund | 532 | if not new_fp_id == msf_pf_id: # all OK for MSF Private Fund |
436 | 523 | # - cost center and funding pool compatibility | 533 | # - cost center and funding pool compatibility |
437 | 524 | 534 | ||
438 | === modified file 'bin/addons/analytic_distribution/report/funding_pool.py' | |||
439 | --- bin/addons/analytic_distribution/report/funding_pool.py 2014-10-29 16:27:26 +0000 | |||
440 | +++ bin/addons/analytic_distribution/report/funding_pool.py 2019-05-06 14:14:05 +0000 | |||
441 | @@ -21,7 +21,6 @@ | |||
442 | 21 | 21 | ||
443 | 22 | from report import report_sxw | 22 | from report import report_sxw |
444 | 23 | import locale | 23 | import locale |
445 | 24 | import pooler | ||
446 | 25 | import time | 24 | import time |
447 | 26 | 25 | ||
448 | 27 | class funding(report_sxw.rml_parse): | 26 | class funding(report_sxw.rml_parse): |
449 | @@ -29,37 +28,11 @@ | |||
450 | 29 | super(funding, self).__init__(cr, uid, name, context=context) | 28 | super(funding, self).__init__(cr, uid, name, context=context) |
451 | 30 | self.localcontext.update({ | 29 | self.localcontext.update({ |
452 | 31 | 'locale': locale, | 30 | 'locale': locale, |
453 | 32 | 'getDest': self.getDestinations, | ||
454 | 33 | 'getBoolDest': self.getBoolDest, | ||
455 | 34 | 'today': self.today, | 31 | 'today': self.today, |
456 | 35 | }) | 32 | }) |
457 | 36 | 33 | ||
458 | 37 | def today(self): | 34 | def today(self): |
459 | 38 | return time.strftime('%Y-%m-%d',time.localtime()) | 35 | return time.strftime('%Y-%m-%d',time.localtime()) |
460 | 39 | 36 | ||
461 | 40 | def getDestinations(self): | ||
462 | 41 | """ | ||
463 | 42 | Fetch destination analytic account: | ||
464 | 43 | * ID | ||
465 | 44 | * code | ||
466 | 45 | Then sort by code | ||
467 | 46 | """ | ||
468 | 47 | res = [('Code', False), ('Name', False)] # We need the 2 first column header name | ||
469 | 48 | pool = pooler.get_pool(self.cr.dbname) | ||
470 | 49 | destination_ids = pool.get('account.analytic.account').search(self.cr, self.uid, [('category', '=', 'DEST'), ('type', '!=', 'view')], order='id') | ||
471 | 50 | data = pool.get('account.analytic.account').read(self.cr, self.uid, destination_ids, ['code']) | ||
472 | 51 | res += [(x.get('code'), x.get('id')) for x in data] | ||
473 | 52 | return res | ||
474 | 53 | |||
475 | 54 | def getBoolDest(self, line, o): | ||
476 | 55 | pool = pooler.get_pool(self.cr.dbname) | ||
477 | 56 | fields = [] | ||
478 | 57 | for field in pool.get('account.destination.summary').fields_get(self.cr, self.uid, ['account_id']): | ||
479 | 58 | fields.append(field) | ||
480 | 59 | r = pool.get('account.destination.summary').read(self.cr, self.uid, line.id, fields) | ||
481 | 60 | if r[o]: | ||
482 | 61 | return 'x' | ||
483 | 62 | return '' | ||
484 | 63 | |||
485 | 64 | report_sxw.report_sxw('report.funding.pool', 'account.analytic.account', 'addons/analytic_distribution/report/funding_pool.rml', parser=funding) | 37 | report_sxw.report_sxw('report.funding.pool', 'account.analytic.account', 'addons/analytic_distribution/report/funding_pool.rml', parser=funding) |
486 | 65 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | 38 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
487 | 66 | 39 | ||
488 | === modified file 'bin/addons/analytic_distribution/report/funding_pool.rml' | |||
489 | --- bin/addons/analytic_distribution/report/funding_pool.rml 2017-08-28 12:25:59 +0000 | |||
490 | +++ bin/addons/analytic_distribution/report/funding_pool.rml 2019-05-06 14:14:05 +0000 | |||
491 | @@ -62,13 +62,7 @@ | |||
492 | 62 | <blockTableStyle id="Table4"> | 62 | <blockTableStyle id="Table4"> |
493 | 63 | <blockAlignment value="LEFT"/> | 63 | <blockAlignment value="LEFT"/> |
494 | 64 | <blockValign value="TOP"/> | 64 | <blockValign value="TOP"/> |
502 | 65 | <lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="0,0"/> | 65 | <lineStyle kind="LINEBELOW" colorName="#000000" start="0,0" stop="-1,0"/> |
496 | 66 | <lineStyle kind="LINEBELOW" colorName="#000000" start="1,0" stop="1,0"/> | ||
497 | 67 | <lineStyle kind="LINEBELOW" colorName="#000000" start="2,0" stop="2,0"/> | ||
498 | 68 | <lineStyle kind="LINEBELOW" colorName="#000000" start="3,0" stop="3,0"/> | ||
499 | 69 | <lineStyle kind="LINEBELOW" colorName="#000000" start="4,0" stop="4,0"/> | ||
500 | 70 | <lineStyle kind="LINEBELOW" colorName="#000000" start="5,0" stop="5,0"/> | ||
501 | 71 | <lineStyle kind="LINEBELOW" colorName="#000000" start="6,0" stop="6,0"/> | ||
503 | 72 | </blockTableStyle> | 66 | </blockTableStyle> |
504 | 73 | <blockTableStyle id="Table5"> | 67 | <blockTableStyle id="Table5"> |
505 | 74 | <blockAlignment value="LEFT"/> | 68 | <blockAlignment value="LEFT"/> |
506 | @@ -202,22 +196,22 @@ | |||
507 | 202 | </para> | 196 | </para> |
508 | 203 | <para style="P6">Cost centers:</para> | 197 | <para style="P6">Cost centers:</para> |
509 | 204 | 198 | ||
511 | 205 | <blockTable colWidths="260.0,258.0" style="Table11" repeatRows="1"> | 199 | <blockTable colWidths="260.0,260.0" style="Table11" repeatRows="1"> |
512 | 206 | <tr> | 200 | <tr> |
513 | 207 | <td> | 201 | <td> |
515 | 208 | <para style="P2" alignment="LEFT">Cost center name</para> | 202 | <para style="P8">Cost center code</para> |
516 | 209 | </td> | 203 | </td> |
517 | 210 | <td> | 204 | <td> |
519 | 211 | <para style="P2" alignment="LEFT">Cost center code</para> | 205 | <para style="P8">Cost center name</para> |
520 | 212 | </td> | 206 | </td> |
521 | 213 | </tr> | 207 | </tr> |
522 | 214 | <tr> | 208 | <tr> |
523 | 215 | <para style="P17">[[repeatIn(o.cost_center_ids,'line')]]</para> | 209 | <para style="P17">[[repeatIn(o.cost_center_ids,'line')]]</para> |
524 | 216 | <td> | 210 | <td> |
526 | 217 | <para style="P3" alignment="LEFT">[[ line.name ]]</para> | 211 | <para style="P7">[[ line.code or '' ]]</para> |
527 | 218 | </td> | 212 | </td> |
528 | 219 | <td> | 213 | <td> |
530 | 220 | <para style="P3" alignment="LEFT">[[ line.code ]]</para> | 214 | <para style="P7">[[ line.name or '' ]]</para> |
531 | 221 | </td> | 215 | </td> |
532 | 222 | </tr> | 216 | </tr> |
533 | 223 | </blockTable> | 217 | </blockTable> |
534 | @@ -228,31 +222,37 @@ | |||
535 | 228 | <para style="P8"> | 222 | <para style="P8"> |
536 | 229 | <font color="white"> </font> | 223 | <font color="white"> </font> |
537 | 230 | </para> | 224 | </para> |
539 | 231 | <para style="P6">Accounts:</para> | 225 | <para style="P6">Account/Destination:</para> |
540 | 232 | 226 | ||
546 | 233 | <!-- Seems that its not possible to change colWidths regarding a condition. | 227 | <blockTable repeatRows="1" style="Table4" colWidths="95.0,165.0,95.0,165.0"> |
542 | 234 | Cf. https://www.odoo.com/forum/help-1/question/reportlab-conditional-table-header-15143 | ||
543 | 235 | Previous colWidths: colWidths="40.0,260.0,55.0,55.0,55.0,55.0" | ||
544 | 236 | --> | ||
545 | 237 | <blockTable repeatRows="1" style="Table4"> | ||
547 | 238 | <tr> | 228 | <tr> |
548 | 239 | <td> | 229 | <td> |
551 | 240 | [[repeatIn(getDest(),'dest_data','td')]] | 230 | <para style="P8">Account code</para> |
552 | 241 | <para style="P24" alignment="CENTER">[[ dest_data[0] ]]</para> | 231 | </td> |
553 | 232 | <td> | ||
554 | 233 | <para style="P8">Account name</para> | ||
555 | 234 | </td> | ||
556 | 235 | <td> | ||
557 | 236 | <para style="P8">Destination code</para> | ||
558 | 237 | </td> | ||
559 | 238 | <td> | ||
560 | 239 | <para style="P8">Destination name</para> | ||
561 | 242 | </td> | 240 | </td> |
562 | 243 | </tr> | 241 | </tr> |
563 | 244 | 242 | ||
564 | 245 | <tr> | 243 | <tr> |
565 | 246 | [[repeatIn(o.tuple_destination_summary,'line')]] | 244 | [[repeatIn(o.tuple_destination_summary,'line')]] |
566 | 247 | <td> | 245 | <td> |
575 | 248 | <para style="P16" alignment="LEFT">[[ line.account_id and line.account_id.code ]]</para> | 246 | <para style="P7">[[ line.account_id and line.account_id.code or '' ]]</para> |
576 | 249 | </td> | 247 | </td> |
577 | 250 | <td> | 248 | <td> |
578 | 251 | <para style="P11" alignment="LEFT">[[ line.account_id and line.account_id.name ]]</para> | 249 | <para style="P7">[[ line.account_id and line.account_id.name or '' ]]</para> |
579 | 252 | </td> | 250 | </td> |
580 | 253 | <td> | 251 | <td> |
581 | 254 | [[repeatIn(getDest()[2:],'dest_data','td')]] | 252 | <para style="P7">[[ line.destination_id and line.destination_id.code or '' ]]</para> |
582 | 255 | <para style="P28" alignment="CENTER">[[ getBoolDest(line,'dest_'+ str(dest_data[1])) ]]</para> | 253 | </td> |
583 | 254 | <td> | ||
584 | 255 | <para style="P7">[[ line.destination_id and line.destination_id.name or '' ]]</para> | ||
585 | 256 | </td> | 256 | </td> |
586 | 257 | </tr> | 257 | </tr> |
587 | 258 | </blockTable> | 258 | </blockTable> |
588 | 259 | 259 | ||
589 | === modified file 'bin/addons/analytic_distribution/wizard/analytic_distribution_wizard.py' | |||
590 | --- bin/addons/analytic_distribution/wizard/analytic_distribution_wizard.py 2018-09-28 16:00:25 +0000 | |||
591 | +++ bin/addons/analytic_distribution/wizard/analytic_distribution_wizard.py 2019-05-06 14:14:05 +0000 | |||
592 | @@ -159,6 +159,18 @@ | |||
593 | 159 | percentage = abs((amount / total_amount) * 100) | 159 | percentage = abs((amount / total_amount) * 100) |
594 | 160 | return {'value': {'percentage': percentage, 'is_percentage_amount_touched': True}} | 160 | return {'value': {'percentage': percentage, 'is_percentage_amount_touched': True}} |
595 | 161 | 161 | ||
596 | 162 | def _dest_compatible_with_cc_domain_part(self, tree): | ||
597 | 163 | """ | ||
598 | 164 | Returns the domain condition to restrict the destination regarding the cost_center_id (for finance views), | ||
599 | 165 | or if this field doesn't exist in the view, to the analytic_id (Cost Center in Supply views) | ||
600 | 166 | """ | ||
601 | 167 | dom_part = "" | ||
602 | 168 | if tree.xpath('/tree/field[@name="cost_center_id"]'): | ||
603 | 169 | dom_part = "('dest_compatible_with_cc_ids', '=', cost_center_id)" | ||
604 | 170 | elif tree.xpath('/tree/field[@name="analytic_id"]'): | ||
605 | 171 | dom_part = "('dest_compatible_with_cc_ids', '=', analytic_id)" | ||
606 | 172 | return dom_part | ||
607 | 173 | |||
608 | 162 | def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): | 174 | def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): |
609 | 163 | """ | 175 | """ |
610 | 164 | Rewrite view in order: | 176 | Rewrite view in order: |
611 | @@ -195,9 +207,14 @@ | |||
612 | 195 | or (context.get('direct_invoice_id', False) and isinstance(context.get('direct_invoice_id'), int)) \ | 207 | or (context.get('direct_invoice_id', False) and isinstance(context.get('direct_invoice_id'), int)) \ |
613 | 196 | or (context.get('from_move', False) and isinstance(context.get('from_move'), int)) \ | 208 | or (context.get('from_move', False) and isinstance(context.get('from_move'), int)) \ |
614 | 197 | or (context.get('from_cash_return', False) and isinstance(context.get('from_cash_return'), int)): | 209 | or (context.get('from_cash_return', False) and isinstance(context.get('from_cash_return'), int)): |
616 | 198 | field.set('domain', "[('type', '!=', 'view'), ('state', '=', 'open'), ('category', '=', 'DEST')]") | 210 | domain_part = self._dest_compatible_with_cc_domain_part(tree) |
617 | 211 | domain = "[('type', '!=', 'view'), ('category', '=', 'DEST') %s]" % (domain_part and ', %s' % domain_part or '') | ||
618 | 212 | field.set('domain', domain) | ||
619 | 199 | else: | 213 | else: |
621 | 200 | field.set('domain', "[('type', '!=', 'view'), ('state', '=', 'open'), ('category', '=', 'DEST'), ('destination_ids', '=', parent.account_id)]") | 214 | domain_part = self._dest_compatible_with_cc_domain_part(tree) |
622 | 215 | domain = "[('type', '!=', 'view'), ('category', '=', 'DEST'), " \ | ||
623 | 216 | "('destination_ids', '=', parent.account_id) %s]" % (domain_part and ', %s' % domain_part or '') | ||
624 | 217 | field.set('domain', domain) | ||
625 | 201 | ## FUNDING POOL | 218 | ## FUNDING POOL |
626 | 202 | if line_type == 'analytic.distribution.wizard.fp.lines': | 219 | if line_type == 'analytic.distribution.wizard.fp.lines': |
627 | 203 | # Change OC field | 220 | # Change OC field |
628 | @@ -235,9 +252,14 @@ | |||
629 | 235 | or (context.get('from_move', False) and isinstance(context.get('from_move'), int)) \ | 252 | or (context.get('from_move', False) and isinstance(context.get('from_move'), int)) \ |
630 | 236 | or (context.get('from_cash_return', False) and isinstance(context.get('from_cash_return'), int)): | 253 | or (context.get('from_cash_return', False) and isinstance(context.get('from_cash_return'), int)): |
631 | 237 | 254 | ||
633 | 238 | field.set('domain', "[('type', '!=', 'view'), ('state', '=', 'open'), ('category', '=', 'DEST')]") | 255 | domain_part = self._dest_compatible_with_cc_domain_part(tree) |
634 | 256 | domain = "[('type', '!=', 'view'), ('category', '=', 'DEST') %s]" % (domain_part and ', %s' % domain_part or '') | ||
635 | 257 | field.set('domain', domain) | ||
636 | 239 | else: | 258 | else: |
638 | 240 | field.set('domain', "[('type', '!=', 'view'), ('state', '=', 'open'), ('category', '=', 'DEST'), ('destination_ids', '=', parent.account_id)]") | 259 | domain_part = self._dest_compatible_with_cc_domain_part(tree) |
639 | 260 | domain = "[('type', '!=', 'view'), ('category', '=', 'DEST'), " \ | ||
640 | 261 | "('destination_ids', '=', parent.account_id) %s]" % (domain_part and ', %s' % domain_part or '') | ||
641 | 262 | field.set('domain', domain) | ||
642 | 241 | 263 | ||
643 | 242 | ## FREE 1 | 264 | ## FREE 1 |
644 | 243 | if line_type == 'analytic.distribution.wizard.f1.lines': | 265 | if line_type == 'analytic.distribution.wizard.f1.lines': |
645 | 244 | 266 | ||
646 | === modified file 'bin/addons/analytic_override/analytic_account.py' | |||
647 | --- bin/addons/analytic_override/analytic_account.py 2019-03-20 10:39:41 +0000 | |||
648 | +++ bin/addons/analytic_override/analytic_account.py 2019-05-06 14:14:05 +0000 | |||
649 | @@ -211,6 +211,28 @@ | |||
650 | 211 | account_ids += tmp_ids | 211 | account_ids += tmp_ids |
651 | 212 | return account_ids | 212 | return account_ids |
652 | 213 | 213 | ||
653 | 214 | def _search_dest_compatible_with_cc_ids(self, cr, uid, obj, name, args, context=None): | ||
654 | 215 | """ | ||
655 | 216 | Returns a domain with all destinations compatible with the selected Cost Center | ||
656 | 217 | Ex: to get the dest. compatible with the CC 2, use the dom [('dest_compatible_with_cc_ids', '=', 2)] | ||
657 | 218 | """ | ||
658 | 219 | dom = [] | ||
659 | 220 | if context is None: | ||
660 | 221 | context = {} | ||
661 | 222 | for arg in args: | ||
662 | 223 | if arg[0] == 'dest_compatible_with_cc_ids': | ||
663 | 224 | operator = arg[1] | ||
664 | 225 | cc = arg[2] | ||
665 | 226 | if operator != '=' or not isinstance(cc, (int, long)): | ||
666 | 227 | raise osv.except_osv(_('Error'), _('Filter not implemented on Destinations.')) | ||
667 | 228 | all_dest_ids = self.search(cr, uid, [('category', '=', 'DEST')], context=context) | ||
668 | 229 | compatible_dest_ids = [] | ||
669 | 230 | for dest in self.browse(cr, uid, all_dest_ids, fields_to_fetch=['allow_all_cc', 'dest_cc_ids'], context=context): | ||
670 | 231 | if dest.allow_all_cc or (cc and cc in [c.id for c in dest.dest_cc_ids]): | ||
671 | 232 | compatible_dest_ids.append(dest.id) | ||
672 | 233 | dom.append(('id', 'in', compatible_dest_ids)) | ||
673 | 234 | return dom | ||
674 | 235 | |||
675 | 214 | _columns = { | 236 | _columns = { |
676 | 215 | 'name': fields.char('Name', size=128, required=True, translate=1), | 237 | 'name': fields.char('Name', size=128, required=True, translate=1), |
677 | 216 | 'code': fields.char('Code', size=24), | 238 | 'code': fields.char('Code', size=24), |
678 | @@ -228,11 +250,20 @@ | |||
679 | 228 | 'filter_active': fields.function(_get_active, fnct_search=_search_filter_active, type="boolean", method=True, store=False, string="Show only active analytic accounts",), | 250 | 'filter_active': fields.function(_get_active, fnct_search=_search_filter_active, type="boolean", method=True, store=False, string="Show only active analytic accounts",), |
680 | 229 | 'intermission_restricted': fields.function(_get_fake, type="boolean", method=True, store=False, string="Domain to restrict intermission cc"), | 251 | 'intermission_restricted': fields.function(_get_fake, type="boolean", method=True, store=False, string="Domain to restrict intermission cc"), |
681 | 230 | 'balance': fields.function(_debit_credit_bal_qtty, method=True, type='float', string='Balance', digits_compute=dp.get_precision('Account'), multi='debit_credit_bal_qtty'), | 252 | 'balance': fields.function(_debit_credit_bal_qtty, method=True, type='float', string='Balance', digits_compute=dp.get_precision('Account'), multi='debit_credit_bal_qtty'), |
682 | 253 | 'dest_cc_ids': fields.many2many('account.analytic.account', 'destination_cost_center_rel', | ||
683 | 254 | 'destination_id', 'cost_center_id', string='Cost Centers', | ||
684 | 255 | domain="[('type', '!=', 'view'), ('category', '=', 'OC')]"), | ||
685 | 256 | 'allow_all_cc': fields.boolean(string="Allow all Cost Centers"), | ||
686 | 257 | 'dest_compatible_with_cc_ids': fields.function(_get_fake, method=True, store=False, | ||
687 | 258 | string='Destinations compatible with the Cost Center', | ||
688 | 259 | type='many2many', relation='account.analytic.account', | ||
689 | 260 | fnct_search=_search_dest_compatible_with_cc_ids), | ||
690 | 231 | } | 261 | } |
691 | 232 | 262 | ||
692 | 233 | _defaults ={ | 263 | _defaults ={ |
693 | 234 | 'date_start': lambda *a: (datetime.today() + relativedelta(months=-3)).strftime('%Y-%m-%d'), | 264 | 'date_start': lambda *a: (datetime.today() + relativedelta(months=-3)).strftime('%Y-%m-%d'), |
694 | 235 | 'for_fx_gain_loss': lambda *a: False, | 265 | 'for_fx_gain_loss': lambda *a: False, |
695 | 266 | 'allow_all_cc': lambda *a: False, | ||
696 | 236 | } | 267 | } |
697 | 237 | 268 | ||
698 | 238 | def _check_code_unicity(self, cr, uid, ids, context=None): | 269 | def _check_code_unicity(self, cr, uid, ids, context=None): |
699 | @@ -304,6 +335,30 @@ | |||
700 | 304 | res['domain']['parent_id'] = [('category', '=', category), ('type', '=', 'view')] | 335 | res['domain']['parent_id'] = [('category', '=', category), ('type', '=', 'view')] |
701 | 305 | return res | 336 | return res |
702 | 306 | 337 | ||
703 | 338 | def on_change_allow_all_cc(self, cr, uid, ids, allow_all_cc, dest_cc_ids, context=None): | ||
704 | 339 | """ | ||
705 | 340 | If the user tries to tick the box "Allow all Cost Centers" whereas CC are selected, | ||
706 | 341 | informs him that he has to remove the CC first | ||
707 | 342 | """ | ||
708 | 343 | res = {} | ||
709 | 344 | if allow_all_cc and dest_cc_ids and dest_cc_ids[0][2]: # e.g. [(6, 0, [1, 2])] | ||
710 | 345 | warning = { | ||
711 | 346 | 'title': _('Warning!'), | ||
712 | 347 | 'message': _('Please remove the Cost Centers linked to the Destination before ticking this box.') | ||
713 | 348 | } | ||
714 | 349 | res['warning'] = warning | ||
715 | 350 | res['value'] = {'allow_all_cc': False, } | ||
716 | 351 | return res | ||
717 | 352 | |||
718 | 353 | def on_change_dest_cc_ids(self, cr, uid, ids, dest_cc_ids, context=None): | ||
719 | 354 | """ | ||
720 | 355 | If at least a CC is selected, unticks the box "Allow all Cost Centers" | ||
721 | 356 | """ | ||
722 | 357 | res = {} | ||
723 | 358 | if dest_cc_ids and dest_cc_ids[0][2]: # e.g. [(6, 0, [1, 2])] | ||
724 | 359 | res['value'] = {'allow_all_cc': False, } | ||
725 | 360 | return res | ||
726 | 361 | |||
727 | 307 | def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): | 362 | def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): |
728 | 308 | if not context: | 363 | if not context: |
729 | 309 | context = {} | 364 | context = {} |
730 | @@ -377,6 +432,8 @@ | |||
731 | 377 | if 'category' in vals: | 432 | if 'category' in vals: |
732 | 378 | if vals['category'] != 'DEST': | 433 | if vals['category'] != 'DEST': |
733 | 379 | vals['destination_ids'] = [(6, 0, [])] | 434 | vals['destination_ids'] = [(6, 0, [])] |
734 | 435 | vals['dest_cc_ids'] = [(6, 0, [])] | ||
735 | 436 | vals['allow_all_cc'] = False # default value | ||
736 | 380 | if vals['category'] != 'FUNDING': | 437 | if vals['category'] != 'FUNDING': |
737 | 381 | vals['tuple_destination_account_ids'] = [(6, 0, [])] | 438 | vals['tuple_destination_account_ids'] = [(6, 0, [])] |
738 | 382 | vals['cost_center_ids'] = [(6, 0, [])] | 439 | vals['cost_center_ids'] = [(6, 0, [])] |
739 | @@ -408,6 +465,7 @@ | |||
740 | 408 | default['child_ids'] = [] # do not copy the child_ids | 465 | default['child_ids'] = [] # do not copy the child_ids |
741 | 409 | default['tuple_destination_summary'] = [] | 466 | default['tuple_destination_summary'] = [] |
742 | 410 | default['line_ids'] = [] | 467 | default['line_ids'] = [] |
743 | 468 | default['dest_cc_ids'] = [] | ||
744 | 411 | return super(analytic_account, self).copy(cr, uid, a_id, default, context=context) | 469 | return super(analytic_account, self).copy(cr, uid, a_id, default, context=context) |
745 | 412 | 470 | ||
746 | 413 | def _check_name_unicity(self, cr, uid, ids, context=None): | 471 | def _check_name_unicity(self, cr, uid, ids, context=None): |
747 | @@ -568,9 +626,41 @@ | |||
748 | 568 | self.write(cr, uid, ids, {'cost_center_ids':[(6, 0, [])]}, context=context) | 626 | self.write(cr, uid, ids, {'cost_center_ids':[(6, 0, [])]}, context=context) |
749 | 569 | return True | 627 | return True |
750 | 570 | 628 | ||
751 | 629 | def button_dest_cc_clear(self, cr, uid, ids, context=None): | ||
752 | 630 | """ | ||
753 | 631 | Removes all Cost Centers selected in the Destination view | ||
754 | 632 | """ | ||
755 | 633 | self.write(cr, uid, ids, {'dest_cc_ids': [(6, 0, [])]}, context=context) | ||
756 | 634 | return True | ||
757 | 635 | |||
758 | 571 | def button_dest_clear(self, cr, uid, ids, context=None): | 636 | def button_dest_clear(self, cr, uid, ids, context=None): |
759 | 572 | self.write(cr, uid, ids, {'tuple_destination_account_ids':[(6, 0, [])]}, context=context) | 637 | self.write(cr, uid, ids, {'tuple_destination_account_ids':[(6, 0, [])]}, context=context) |
760 | 573 | return True | 638 | return True |
761 | 574 | 639 | ||
762 | 640 | def get_destinations_by_accounts(self, cr, uid, ids, context=None): | ||
763 | 641 | """ | ||
764 | 642 | Returns a view with the Destinations by accounts (for the FP selected if any, otherwise for all the FP) | ||
765 | 643 | """ | ||
766 | 644 | if context is None: | ||
767 | 645 | context = {} | ||
768 | 646 | ir_model_obj = self.pool.get('ir.model.data') | ||
769 | 647 | active_ids = context.get('active_ids', []) | ||
770 | 648 | if active_ids: | ||
771 | 649 | analytic_acc_category = self.browse(cr, uid, active_ids[0], fields_to_fetch=['category'], context=context).category or '' | ||
772 | 650 | if analytic_acc_category == 'FUNDING': | ||
773 | 651 | context.update({'search_default_funding_pool_id': active_ids[0]}) | ||
774 | 652 | search_view_id = ir_model_obj.get_object_reference(cr, uid, 'analytic_distribution', 'view_account_destination_summary_search') | ||
775 | 653 | search_view_id = search_view_id and search_view_id[1] or False | ||
776 | 654 | return { | ||
777 | 655 | 'name': _('Destinations by accounts'), | ||
778 | 656 | 'type': 'ir.actions.act_window', | ||
779 | 657 | 'res_model': 'account.destination.summary', | ||
780 | 658 | 'view_type': 'form', | ||
781 | 659 | 'view_mode': 'tree,form', | ||
782 | 660 | 'search_view_id': [search_view_id], | ||
783 | 661 | 'context': context, | ||
784 | 662 | 'target': 'current', | ||
785 | 663 | } | ||
786 | 664 | |||
787 | 575 | analytic_account() | 665 | analytic_account() |
788 | 576 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: | 666 | # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
789 | 577 | 667 | ||
790 | === modified file 'bin/addons/msf_doc_import/account.py' | |||
791 | --- bin/addons/msf_doc_import/account.py 2019-01-03 09:17:52 +0000 | |||
792 | +++ bin/addons/msf_doc_import/account.py 2019-05-06 14:14:05 +0000 | |||
793 | @@ -194,6 +194,7 @@ | |||
794 | 194 | self.pool.get('msf.doc.import.accounting.lines').unlink(cr, uid, old_lines_ids) | 194 | self.pool.get('msf.doc.import.accounting.lines').unlink(cr, uid, old_lines_ids) |
795 | 195 | 195 | ||
796 | 196 | # Check wizard data | 196 | # Check wizard data |
797 | 197 | ad_obj = self.pool.get('analytic.distribution') | ||
798 | 197 | period_obj = self.pool.get('account.period') | 198 | period_obj = self.pool.get('account.period') |
799 | 198 | period_ctx = context.copy() | 199 | period_ctx = context.copy() |
800 | 199 | period_ctx['extend_december'] = True | 200 | period_ctx['extend_december'] = True |
801 | @@ -485,6 +486,10 @@ | |||
802 | 485 | errors.append(_('Line %s. The destination %s is not compatible with the account %s.') % | 486 | errors.append(_('Line %s. The destination %s is not compatible with the account %s.') % |
803 | 486 | (current_line_num, line[cols['Destination']], line[cols['G/L Account']])) | 487 | (current_line_num, line[cols['Destination']], line[cols['G/L Account']])) |
804 | 487 | continue | 488 | continue |
805 | 489 | if not ad_obj.check_dest_cc_compatibility(cr, uid, r_destination, r_cc, context=context): | ||
806 | 490 | errors.append(_('Line %s. The Cost Center %s is not compatible with the Destination %s.') % | ||
807 | 491 | (current_line_num, line[cols['Cost Centre']], line[cols['Destination']])) | ||
808 | 492 | continue | ||
809 | 488 | # if the Fund. Pool used is NOT "PF" check the compatibility with the (account, dest) and the CC | 493 | # if the Fund. Pool used is NOT "PF" check the compatibility with the (account, dest) and the CC |
810 | 489 | if r_fp != msf_fp_id: | 494 | if r_fp != msf_fp_id: |
811 | 490 | fp_fields = ['tuple_destination_account_ids', 'cost_center_ids'] | 495 | fp_fields = ['tuple_destination_account_ids', 'cost_center_ids'] |
812 | 491 | 496 | ||
813 | === modified file 'bin/addons/msf_doc_import/msf_import_export.py' | |||
814 | --- bin/addons/msf_doc_import/msf_import_export.py 2018-11-16 10:06:13 +0000 | |||
815 | +++ bin/addons/msf_doc_import/msf_import_export.py 2019-05-06 14:14:05 +0000 | |||
816 | @@ -633,6 +633,7 @@ | |||
817 | 633 | model = MODEL_DICT[import_brw.model_list_selection]['model'] | 633 | model = MODEL_DICT[import_brw.model_list_selection]['model'] |
818 | 634 | impobj = self.pool.get(model) | 634 | impobj = self.pool.get(model) |
819 | 635 | acc_obj = self.pool.get('account.account') | 635 | acc_obj = self.pool.get('account.account') |
820 | 636 | acc_analytic_obj = self.pool.get('account.analytic.account') | ||
821 | 636 | acc_dest_obj = self.pool.get('account.destination.link') | 637 | acc_dest_obj = self.pool.get('account.destination.link') |
822 | 637 | 638 | ||
823 | 638 | import_data_obj = self.pool.get('import_data') | 639 | import_data_obj = self.pool.get('import_data') |
824 | @@ -930,11 +931,20 @@ | |||
825 | 930 | if len(ids_to_update) > 1: | 931 | if len(ids_to_update) > 1: |
826 | 931 | raise Exception('%d records found for rule=%s, model=%s' % (len(ids_to_update), data.get('name'), data.get('model_id'))) | 932 | raise Exception('%d records found for rule=%s, model=%s' % (len(ids_to_update), data.get('name'), data.get('model_id'))) |
827 | 932 | 933 | ||
830 | 933 | # Analytic Accounts | 934 | # Funding Pools |
831 | 934 | if import_brw.model_list_selection == 'analytic_accounts': | 935 | if import_brw.model_list_selection == 'funding_pools': |
832 | 935 | context['from_import_menu'] = True | 936 | context['from_import_menu'] = True |
833 | 937 | data['category'] = 'FUNDING' | ||
834 | 938 | # Parent Analytic Account | ||
835 | 939 | if data.get('parent_id'): | ||
836 | 940 | parent_id = acc_analytic_obj.browse(cr, uid, data['parent_id'], | ||
837 | 941 | fields_to_fetch=['type', 'category'], context=context) | ||
838 | 942 | parent_type = parent_id.type or '' | ||
839 | 943 | parent_category = parent_id.category or '' | ||
840 | 944 | if parent_type != 'view' or parent_category != 'FUNDING': | ||
841 | 945 | raise Exception(_('The Parent Analytic Account must be a View type Funding Pool.')) | ||
842 | 936 | # Cost Centers | 946 | # Cost Centers |
844 | 937 | if data.get('cost_center_ids') and data.get('category', '') == 'FUNDING': | 947 | if data.get('cost_center_ids'): |
845 | 938 | cc_list = [] | 948 | cc_list = [] |
846 | 939 | for cost_center in data.get('cost_center_ids').split(','): | 949 | for cost_center in data.get('cost_center_ids').split(','): |
847 | 940 | cc = cost_center.strip() | 950 | cc = cost_center.strip() |
848 | @@ -949,7 +959,7 @@ | |||
849 | 949 | else: | 959 | else: |
850 | 950 | data['cost_center_ids'] = [(6, 0, [])] | 960 | data['cost_center_ids'] = [(6, 0, [])] |
851 | 951 | # Account/Destination | 961 | # Account/Destination |
853 | 952 | if data.get('tuple_destination_account_ids') and data.get('category', '') == 'FUNDING': | 962 | if data.get('tuple_destination_account_ids'): |
854 | 953 | dest_acc_list = [] | 963 | dest_acc_list = [] |
855 | 954 | for destination_account in data.get('tuple_destination_account_ids').split(','): | 964 | for destination_account in data.get('tuple_destination_account_ids').split(','): |
856 | 955 | dest_acc_ids = [] | 965 | dest_acc_ids = [] |
857 | @@ -969,6 +979,115 @@ | |||
858 | 969 | else: | 979 | else: |
859 | 970 | data['tuple_destination_account_ids'] = [(6, 0, [])] | 980 | data['tuple_destination_account_ids'] = [(6, 0, [])] |
860 | 971 | 981 | ||
861 | 982 | # Destinations | ||
862 | 983 | if import_brw.model_list_selection == 'destinations': | ||
863 | 984 | context['from_import_menu'] = True | ||
864 | 985 | data['category'] = 'DEST' | ||
865 | 986 | # Parent Analytic Account | ||
866 | 987 | if data.get('parent_id'): | ||
867 | 988 | parent_id = acc_analytic_obj.browse(cr, uid, data['parent_id'], fields_to_fetch=['type', 'category'], context=context) | ||
868 | 989 | parent_type = parent_id.type or '' | ||
869 | 990 | parent_category = parent_id.category or '' | ||
870 | 991 | if parent_type != 'view' or parent_category != 'DEST': | ||
871 | 992 | raise Exception(_('The Parent Analytic Account must be a View type Destination.')) | ||
872 | 993 | # Type | ||
873 | 994 | if data['type'] not in ['normal', 'view']: | ||
874 | 995 | raise Exception(_('The Type must be either "Normal" or "View".')) | ||
875 | 996 | # Cost Centers | ||
876 | 997 | if data.get('dest_cc_ids'): | ||
877 | 998 | if data.get('allow_all_cc'): | ||
878 | 999 | raise Exception(_("Please either list the Cost Centers to allow, or allow all Cost Centers.")) | ||
879 | 1000 | dest_cc_list = [] | ||
880 | 1001 | for cost_center in data.get('dest_cc_ids').split(','): | ||
881 | 1002 | cc = cost_center.strip() | ||
882 | 1003 | cc_dom = [('category', '=', 'OC'), ('type', '=', 'normal'), | ||
883 | 1004 | '|', ('code', '=', cc), ('name', '=', cc)] | ||
884 | 1005 | cc_ids = impobj.search(cr, uid, cc_dom, order='id', limit=1, context=context) | ||
885 | 1006 | if cc_ids: | ||
886 | 1007 | dest_cc_list.append(cc_ids[0]) | ||
887 | 1008 | else: | ||
888 | 1009 | raise Exception(_('Cost Center "%s" not found.') % cc) | ||
889 | 1010 | data['dest_cc_ids'] = [(6, 0, dest_cc_list)] | ||
890 | 1011 | else: | ||
891 | 1012 | data['dest_cc_ids'] = [(6, 0, [])] | ||
892 | 1013 | # Accounts | ||
893 | 1014 | if data.get('destination_ids'): # "destinations_ids" corresponds to G/L accounts... | ||
894 | 1015 | acc_list = [] | ||
895 | 1016 | for account in data.get('destination_ids').split(','): | ||
896 | 1017 | acc = account.strip() | ||
897 | 1018 | acc_dom = [('type', '!=', 'view'), ('is_analytic_addicted', '=', True), ('code', '=', acc)] | ||
898 | 1019 | acc_ids = acc_obj.search(cr, uid, acc_dom, order='id', limit=1, context=context) | ||
899 | 1020 | if acc_ids: | ||
900 | 1021 | acc_list.append(acc_ids[0]) | ||
901 | 1022 | else: | ||
902 | 1023 | raise Exception(_("Account code \"%s\" doesn't exist or isn't allowed.") % acc) | ||
903 | 1024 | data['destination_ids'] = [(6, 0, acc_list)] | ||
904 | 1025 | else: | ||
905 | 1026 | data['destination_ids'] = [(6, 0, [])] | ||
906 | 1027 | # if the code matches with an existing destination: update it | ||
907 | 1028 | if data.get('code'): | ||
908 | 1029 | ids_to_update = impobj.search(cr, uid, [('category', '=', 'DEST'), ('code', '=', data['code'])], | ||
909 | 1030 | limit=1, context=context) | ||
910 | 1031 | if ids_to_update: | ||
911 | 1032 | # in case of empty columns on non-required fields, existing values should be deleted | ||
912 | 1033 | if 'date' not in data: | ||
913 | 1034 | data['date'] = False | ||
914 | 1035 | if 'dest_cc_ids' not in data: | ||
915 | 1036 | data['dest_cc_ids'] = [(6, 0, [])] | ||
916 | 1037 | if 'allow_all_cc' not in data: | ||
917 | 1038 | data['allow_all_cc'] = False | ||
918 | 1039 | if 'destination_ids' not in data: | ||
919 | 1040 | data['destination_ids'] = [(6, 0, [])] | ||
920 | 1041 | elif data['destination_ids'][0][2]: | ||
921 | 1042 | # accounts already linked to the destination: | ||
922 | 1043 | # - if they don't appear in the new list: will be automatically de-activated | ||
923 | 1044 | # - if they appear in the list: must be re-activated if they are currently disabled | ||
924 | 1045 | link_ids = acc_dest_obj.search(cr, uid, | ||
925 | 1046 | [('account_id', 'in', data['destination_ids'][0][2]), | ||
926 | 1047 | ('destination_id', '=', ids_to_update[0]), | ||
927 | 1048 | ('disabled', '=', True)], context=context) | ||
928 | 1049 | if link_ids: | ||
929 | 1050 | acc_dest_obj.write(cr, uid, link_ids, {'disabled': False}, context=context) | ||
930 | 1051 | |||
931 | 1052 | # Cost Centers | ||
932 | 1053 | if import_brw.model_list_selection == 'cost_centers': | ||
933 | 1054 | context['from_import_menu'] = True | ||
934 | 1055 | data['category'] = 'OC' | ||
935 | 1056 | # Parent Analytic Account | ||
936 | 1057 | if data.get('parent_id'): | ||
937 | 1058 | parent_id = acc_analytic_obj.browse(cr, uid, data['parent_id'], | ||
938 | 1059 | fields_to_fetch=['type', 'category'], context=context) | ||
939 | 1060 | parent_type = parent_id.type or '' | ||
940 | 1061 | parent_category = parent_id.category or '' | ||
941 | 1062 | if parent_type != 'view' or parent_category != 'OC': | ||
942 | 1063 | raise Exception(_('The Parent Analytic Account must be a View type Cost Center.')) | ||
943 | 1064 | |||
944 | 1065 | # Free 1 | ||
945 | 1066 | if import_brw.model_list_selection == 'free1': | ||
946 | 1067 | context['from_import_menu'] = True | ||
947 | 1068 | data['category'] = 'FREE1' | ||
948 | 1069 | # Parent Analytic Account | ||
949 | 1070 | if data.get('parent_id'): | ||
950 | 1071 | parent_id = acc_analytic_obj.browse(cr, uid, data['parent_id'], | ||
951 | 1072 | fields_to_fetch=['type', 'category'], context=context) | ||
952 | 1073 | parent_type = parent_id.type or '' | ||
953 | 1074 | parent_category = parent_id.category or '' | ||
954 | 1075 | if parent_type != 'view' or parent_category != 'FREE1': | ||
955 | 1076 | raise Exception(_('The Parent Analytic Account must be a View type Free 1 account.')) | ||
956 | 1077 | |||
957 | 1078 | # Free 2 | ||
958 | 1079 | if import_brw.model_list_selection == 'free2': | ||
959 | 1080 | context['from_import_menu'] = True | ||
960 | 1081 | data['category'] = 'FREE2' | ||
961 | 1082 | # Parent Analytic Account | ||
962 | 1083 | if data.get('parent_id'): | ||
963 | 1084 | parent_id = acc_analytic_obj.browse(cr, uid, data['parent_id'], | ||
964 | 1085 | fields_to_fetch=['type', 'category'], context=context) | ||
965 | 1086 | parent_type = parent_id.type or '' | ||
966 | 1087 | parent_category = parent_id.category or '' | ||
967 | 1088 | if parent_type != 'view' or parent_category != 'FREE2': | ||
968 | 1089 | raise Exception(_('The Parent Analytic Account must be a View type Free 2 account.')) | ||
969 | 1090 | |||
970 | 972 | if import_brw.model_list_selection == 'record_rules': | 1091 | if import_brw.model_list_selection == 'record_rules': |
971 | 973 | if not data.get('groups'): | 1092 | if not data.get('groups'): |
972 | 974 | data['groups'] = [(6, 0, [])] | 1093 | data['groups'] = [(6, 0, [])] |
973 | 975 | 1094 | ||
974 | === modified file 'bin/addons/msf_doc_import/msf_import_export_conf.py' | |||
975 | --- bin/addons/msf_doc_import/msf_import_export_conf.py 2018-10-03 14:41:22 +0000 | |||
976 | +++ bin/addons/msf_doc_import/msf_import_export_conf.py 2019-05-06 14:14:05 +0000 | |||
977 | @@ -95,8 +95,28 @@ | |||
978 | 95 | 'domain_type': 'finance', | 95 | 'domain_type': 'finance', |
979 | 96 | 'model': 'account.journal' | 96 | 'model': 'account.journal' |
980 | 97 | }, | 97 | }, |
983 | 98 | 'analytic_accounts': { | 98 | 'funding_pools': { |
984 | 99 | 'name': 'Analytic Accounts', | 99 | 'name': 'Funding Pools', |
985 | 100 | 'domain_type': 'finance', | ||
986 | 101 | 'model': 'account.analytic.account' | ||
987 | 102 | }, | ||
988 | 103 | 'destinations': { | ||
989 | 104 | 'name': 'Destinations', | ||
990 | 105 | 'domain_type': 'finance', | ||
991 | 106 | 'model': 'account.analytic.account' | ||
992 | 107 | }, | ||
993 | 108 | 'cost_centers': { | ||
994 | 109 | 'name': 'Cost Centers', | ||
995 | 110 | 'domain_type': 'finance', | ||
996 | 111 | 'model': 'account.analytic.account' | ||
997 | 112 | }, | ||
998 | 113 | 'free1': { | ||
999 | 114 | 'name': 'Free 1', | ||
1000 | 115 | 'domain_type': 'finance', | ||
1001 | 116 | 'model': 'account.analytic.account' | ||
1002 | 117 | }, | ||
1003 | 118 | 'free2': { | ||
1004 | 119 | 'name': 'Free 2', | ||
1005 | 100 | 'domain_type': 'finance', | 120 | 'domain_type': 'finance', |
1006 | 101 | 'model': 'account.analytic.account' | 121 | 'model': 'account.analytic.account' |
1007 | 102 | }, | 122 | }, |
1008 | @@ -466,11 +486,10 @@ | |||
1009 | 466 | 'analytic_journal_id.name', | 486 | 'analytic_journal_id.name', |
1010 | 467 | ], | 487 | ], |
1011 | 468 | }, | 488 | }, |
1013 | 469 | 'analytic_accounts': { | 489 | 'funding_pools': { |
1014 | 470 | 'header_list': [ | 490 | 'header_list': [ |
1015 | 471 | 'name', | 491 | 'name', |
1016 | 472 | 'code', | 492 | 'code', |
1017 | 473 | 'category', | ||
1018 | 474 | 'parent_id.code', | 493 | 'parent_id.code', |
1019 | 475 | 'type', | 494 | 'type', |
1020 | 476 | 'date_start', | 495 | 'date_start', |
1021 | @@ -482,7 +501,74 @@ | |||
1022 | 482 | 'required_field_list': [ | 501 | 'required_field_list': [ |
1023 | 483 | 'name', | 502 | 'name', |
1024 | 484 | 'code', | 503 | 'code', |
1026 | 485 | 'category', | 504 | 'parent_id.code', |
1027 | 505 | 'date_start', | ||
1028 | 506 | ], | ||
1029 | 507 | }, | ||
1030 | 508 | 'cost_centers': { | ||
1031 | 509 | 'header_list': [ | ||
1032 | 510 | 'name', | ||
1033 | 511 | 'code', | ||
1034 | 512 | 'parent_id.code', | ||
1035 | 513 | 'type', | ||
1036 | 514 | 'date_start', | ||
1037 | 515 | 'date', # "inactive from" | ||
1038 | 516 | ], | ||
1039 | 517 | 'required_field_list': [ | ||
1040 | 518 | 'name', | ||
1041 | 519 | 'code', | ||
1042 | 520 | 'parent_id.code', | ||
1043 | 521 | 'date_start', | ||
1044 | 522 | ], | ||
1045 | 523 | }, | ||
1046 | 524 | 'destinations': { | ||
1047 | 525 | 'header_list': [ | ||
1048 | 526 | 'name', | ||
1049 | 527 | 'code', | ||
1050 | 528 | 'parent_id.code', | ||
1051 | 529 | 'type', | ||
1052 | 530 | 'date_start', | ||
1053 | 531 | 'date', # "inactive from" | ||
1054 | 532 | 'dest_cc_ids', | ||
1055 | 533 | 'destination_ids', | ||
1056 | 534 | 'allow_all_cc', | ||
1057 | 535 | ], | ||
1058 | 536 | 'required_field_list': [ | ||
1059 | 537 | 'name', | ||
1060 | 538 | 'code', | ||
1061 | 539 | 'parent_id.code', | ||
1062 | 540 | 'type', | ||
1063 | 541 | 'date_start', | ||
1064 | 542 | ], | ||
1065 | 543 | }, | ||
1066 | 544 | 'free1': { | ||
1067 | 545 | 'header_list': [ | ||
1068 | 546 | 'name', | ||
1069 | 547 | 'code', | ||
1070 | 548 | 'parent_id.code', | ||
1071 | 549 | 'type', | ||
1072 | 550 | 'date_start', | ||
1073 | 551 | 'date', # "inactive from" | ||
1074 | 552 | ], | ||
1075 | 553 | 'required_field_list': [ | ||
1076 | 554 | 'name', | ||
1077 | 555 | 'code', | ||
1078 | 556 | 'parent_id.code', | ||
1079 | 557 | 'date_start', | ||
1080 | 558 | ], | ||
1081 | 559 | }, | ||
1082 | 560 | 'free2': { | ||
1083 | 561 | 'header_list': [ | ||
1084 | 562 | 'name', | ||
1085 | 563 | 'code', | ||
1086 | 564 | 'parent_id.code', | ||
1087 | 565 | 'type', | ||
1088 | 566 | 'date_start', | ||
1089 | 567 | 'date', # "inactive from" | ||
1090 | 568 | ], | ||
1091 | 569 | 'required_field_list': [ | ||
1092 | 570 | 'name', | ||
1093 | 571 | 'code', | ||
1094 | 486 | 'parent_id.code', | 572 | 'parent_id.code', |
1095 | 487 | 'date_start', | 573 | 'date_start', |
1096 | 488 | ], | 574 | ], |
1097 | 489 | 575 | ||
1098 | === modified file 'bin/addons/msf_homere_interface/hr.py' | |||
1099 | --- bin/addons/msf_homere_interface/hr.py 2019-02-06 09:47:00 +0000 | |||
1100 | +++ bin/addons/msf_homere_interface/hr.py 2019-05-06 14:14:05 +0000 | |||
1101 | @@ -208,6 +208,22 @@ | |||
1102 | 208 | (_check_unicity, "Another employee has the same Identification No.", ['identification_id']), | 208 | (_check_unicity, "Another employee has the same Identification No.", ['identification_id']), |
1103 | 209 | ] | 209 | ] |
1104 | 210 | 210 | ||
1105 | 211 | def _check_employe_dest_cc_compatibility(self, cr, uid, employee_id, context=None): | ||
1106 | 212 | """ | ||
1107 | 213 | Raises an error in case the employee Destination and Cost Center are not compatible | ||
1108 | 214 | """ | ||
1109 | 215 | if context is None: | ||
1110 | 216 | context = {} | ||
1111 | 217 | ad_obj = self.pool.get('analytic.distribution') | ||
1112 | 218 | employee_fields = ['destination_id', 'cost_center_id', 'name_resource'] | ||
1113 | 219 | employee = self.browse(cr, uid, employee_id, fields_to_fetch=employee_fields, context=context) | ||
1114 | 220 | emp_dest = employee.destination_id | ||
1115 | 221 | emp_cc = employee.cost_center_id | ||
1116 | 222 | if emp_dest and emp_cc: | ||
1117 | 223 | if not ad_obj.check_dest_cc_compatibility(cr, uid, emp_dest.id, emp_cc.id, context=context): | ||
1118 | 224 | raise osv.except_osv(_('Error'), _('Employee %s: the Cost Center %s is not compatible with the Destination %s.') % | ||
1119 | 225 | (employee.name_resource, emp_cc.code or '', emp_dest.code or '')) | ||
1120 | 226 | |||
1121 | 211 | def create(self, cr, uid, vals, context=None): | 227 | def create(self, cr, uid, vals, context=None): |
1122 | 212 | """ | 228 | """ |
1123 | 213 | Block creation for local staff if no 'from' in context | 229 | Block creation for local staff if no 'from' in context |
1124 | @@ -228,7 +244,9 @@ | |||
1125 | 228 | # Raise an error if employee is created manually | 244 | # Raise an error if employee is created manually |
1126 | 229 | if (not context.get('from', False) or context.get('from') not in ['yaml', 'import']) and not context.get('sync_update_execution', False) and not allow_edition: | 245 | if (not context.get('from', False) or context.get('from') not in ['yaml', 'import']) and not context.get('sync_update_execution', False) and not allow_edition: |
1127 | 230 | raise osv.except_osv(_('Error'), _('You are not allowed to create a local staff! Please use Import to create local staff.')) | 246 | raise osv.except_osv(_('Error'), _('You are not allowed to create a local staff! Please use Import to create local staff.')) |
1129 | 231 | return super(hr_employee, self).create(cr, uid, vals, context) | 247 | employee_id = super(hr_employee, self).create(cr, uid, vals, context) |
1130 | 248 | self._check_employe_dest_cc_compatibility(cr, uid, employee_id, context=context) | ||
1131 | 249 | return employee_id | ||
1132 | 232 | 250 | ||
1133 | 233 | def write(self, cr, uid, ids, vals, context=None): | 251 | def write(self, cr, uid, ids, vals, context=None): |
1134 | 234 | """ | 252 | """ |
1135 | @@ -277,6 +295,7 @@ | |||
1136 | 277 | employee_id = super(hr_employee, self).write(cr, uid, emp.id, new_vals, context) | 295 | employee_id = super(hr_employee, self).write(cr, uid, emp.id, new_vals, context) |
1137 | 278 | if employee_id: | 296 | if employee_id: |
1138 | 279 | res.append(employee_id) | 297 | res.append(employee_id) |
1139 | 298 | self._check_employe_dest_cc_compatibility(cr, uid, emp.id, context=context) | ||
1140 | 280 | return res | 299 | return res |
1141 | 281 | 300 | ||
1142 | 282 | def unlink(self, cr, uid, ids, context=None): | 301 | def unlink(self, cr, uid, ids, context=None): |
1143 | @@ -322,6 +341,11 @@ | |||
1144 | 322 | fields = form.xpath('/' + view_type + '//field[@name="cost_center_id"]') | 341 | fields = form.xpath('/' + view_type + '//field[@name="cost_center_id"]') |
1145 | 323 | for field in fields: | 342 | for field in fields: |
1146 | 324 | field.set('domain', "[('type', '!=', 'view'), ('state', '=', 'open'), ('id', 'child_of', [%s])]" % oc_id) | 343 | field.set('domain', "[('type', '!=', 'view'), ('state', '=', 'open'), ('id', 'child_of', [%s])]" % oc_id) |
1147 | 344 | # Change DEST field | ||
1148 | 345 | dest_fields = form.xpath('/' + view_type + '//field[@name="destination_id"]') | ||
1149 | 346 | for dest_field in dest_fields: | ||
1150 | 347 | dest_field.set('domain', "[('category', '=', 'DEST'), ('type', '!=', 'view'), " | ||
1151 | 348 | "('dest_compatible_with_cc_ids', '=', cost_center_id)]") | ||
1152 | 325 | # Change FP field | 349 | # Change FP field |
1153 | 326 | try: | 350 | try: |
1154 | 327 | fp_id = data_obj.get_object_reference(cr, uid, 'analytic_distribution', 'analytic_account_msf_private_funds')[1] | 351 | fp_id = data_obj.get_object_reference(cr, uid, 'analytic_distribution', 'analytic_account_msf_private_funds')[1] |
1155 | 328 | 352 | ||
1156 | === modified file 'bin/addons/msf_homere_interface/hr_payroll.py' | |||
1157 | --- bin/addons/msf_homere_interface/hr_payroll.py 2018-10-30 15:33:33 +0000 | |||
1158 | +++ bin/addons/msf_homere_interface/hr_payroll.py 2019-05-06 14:14:05 +0000 | |||
1159 | @@ -42,6 +42,7 @@ | |||
1160 | 42 | ids = [ids] | 42 | ids = [ids] |
1161 | 43 | # Prepare some values | 43 | # Prepare some values |
1162 | 44 | res = {} | 44 | res = {} |
1163 | 45 | ad_obj = self.pool.get('analytic.distribution') | ||
1164 | 45 | # Search MSF Private Fund element, because it's valid with all accounts | 46 | # Search MSF Private Fund element, because it's valid with all accounts |
1165 | 46 | try: | 47 | try: |
1166 | 47 | fp_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'analytic_distribution', | 48 | fp_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'analytic_distribution', |
1167 | @@ -57,6 +58,7 @@ | |||
1168 | 57 | # E/ DEST in list of available DEST in ACCOUNT | 58 | # E/ DEST in list of available DEST in ACCOUNT |
1169 | 58 | # F/ Check posting date with cost center and destination if exists | 59 | # F/ Check posting date with cost center and destination if exists |
1170 | 59 | # G/ Check document date with funding pool | 60 | # G/ Check document date with funding pool |
1171 | 61 | # H/ Check Cost Center / Destination compatibility | ||
1172 | 60 | ## CASES where FP is filled in (or not) and/or DEST is filled in (or not). | 62 | ## CASES where FP is filled in (or not) and/or DEST is filled in (or not). |
1173 | 61 | ## CC is mandatory, so always available: | 63 | ## CC is mandatory, so always available: |
1174 | 62 | # 1/ no FP, no DEST => Distro = valid | 64 | # 1/ no FP, no DEST => Distro = valid |
1175 | @@ -124,6 +126,11 @@ | |||
1176 | 124 | if line.destination_id.id not in [x.id for x in account.destination_ids]: | 126 | if line.destination_id.id not in [x.id for x in account.destination_ids]: |
1177 | 125 | res[line.id] = 'invalid' | 127 | res[line.id] = 'invalid' |
1178 | 126 | continue | 128 | continue |
1179 | 129 | # H check | ||
1180 | 130 | if line.destination_id and line.cost_center_id and \ | ||
1181 | 131 | not ad_obj.check_dest_cc_compatibility(cr, uid, line.destination_id.id, line.cost_center_id.id, context=context): | ||
1182 | 132 | res[line.id] = 'invalid' | ||
1183 | 133 | continue | ||
1184 | 127 | return res | 134 | return res |
1185 | 128 | 135 | ||
1186 | 129 | def _get_third_parties(self, cr, uid, ids, field_name=None, arg=None, context=None): | 136 | def _get_third_parties(self, cr, uid, ids, field_name=None, arg=None, context=None): |
1187 | 130 | 137 | ||
1188 | === modified file 'bin/addons/msf_homere_interface/hr_payroll_wizard.xml' | |||
1189 | --- bin/addons/msf_homere_interface/hr_payroll_wizard.xml 2019-01-21 09:53:32 +0000 | |||
1190 | +++ bin/addons/msf_homere_interface/hr_payroll_wizard.xml 2019-05-06 14:14:05 +0000 | |||
1191 | @@ -13,8 +13,11 @@ | |||
1192 | 13 | <field name="arch" type="xml"> | 13 | <field name="arch" type="xml"> |
1193 | 14 | <form string="Analytic Reallocation"> | 14 | <form string="Analytic Reallocation"> |
1194 | 15 | <group colspan="6" col="6"> | 15 | <group colspan="6" col="6"> |
1197 | 16 | <field name="destination_id" context="{'search_default_active': 1, 'hide_inactive': 1}"/> | 16 | <field name="cost_center_id" on_change="onchange_cost_center(cost_center_id, funding_pool_id)" |
1198 | 17 | <field name="cost_center_id" on_change="onchange_cost_center(cost_center_id, funding_pool_id)" context="{'search_default_active': 1, 'hide_inactive': 1}"/> | 17 | context="{'search_default_active': 1, 'hide_inactive': 1}"/> |
1199 | 18 | <field name="destination_id" context="{'search_default_active': 1, 'hide_inactive': 1}" | ||
1200 | 19 | domain="[('category', '=', 'DEST'), ('type', '!=', 'view'), | ||
1201 | 20 | ('dest_compatible_with_cc_ids', '=', cost_center_id)]"/> | ||
1202 | 18 | <field name="funding_pool_id" context="{'search_default_active': 1, 'hide_inactive': 1}"/> | 21 | <field name="funding_pool_id" context="{'search_default_active': 1, 'hide_inactive': 1}"/> |
1203 | 19 | </group> | 22 | </group> |
1204 | 20 | <newline/> | 23 | <newline/> |
1205 | 21 | 24 | ||
1206 | === modified file 'bin/addons/msf_homere_interface/hr_view.xml' | |||
1207 | --- bin/addons/msf_homere_interface/hr_view.xml 2018-08-21 19:39:57 +0000 | |||
1208 | +++ bin/addons/msf_homere_interface/hr_view.xml 2019-05-06 14:14:05 +0000 | |||
1209 | @@ -27,8 +27,8 @@ | |||
1210 | 27 | <field name="homere_codeterrain" invisible="1"/> | 27 | <field name="homere_codeterrain" invisible="1"/> |
1211 | 28 | </group> | 28 | </group> |
1212 | 29 | <group colspan="4" col="8"> | 29 | <group colspan="4" col="8"> |
1213 | 30 | <field name="destination_id" context="{'search_default_active': 1, 'hide_inactive': 1}"/> | ||
1214 | 31 | <field name="cost_center_id" on_change="onchange_cc(cost_center_id, funding_pool_id)" context="{'search_default_active': 1, 'hide_inactive': 1}"/> | 30 | <field name="cost_center_id" on_change="onchange_cc(cost_center_id, funding_pool_id)" context="{'search_default_active': 1, 'hide_inactive': 1}"/> |
1215 | 31 | <field name="destination_id" context="{'search_default_active': 1, 'hide_inactive': 1}"/> | ||
1216 | 32 | <field name="funding_pool_id" context="{'search_default_active': 1, 'hide_inactive': 1}"/> | 32 | <field name="funding_pool_id" context="{'search_default_active': 1, 'hide_inactive': 1}"/> |
1217 | 33 | <newline /> | 33 | <newline /> |
1218 | 34 | <field name="free1_id" context="{'search_default_active': 1, 'hide_inactive': 1}"/> | 34 | <field name="free1_id" context="{'search_default_active': 1, 'hide_inactive': 1}"/> |
1219 | 35 | 35 | ||
1220 | === modified file 'bin/addons/msf_profile/data/patches.xml' | |||
1221 | --- bin/addons/msf_profile/data/patches.xml 2019-03-28 13:22:15 +0000 | |||
1222 | +++ bin/addons/msf_profile/data/patches.xml 2019-05-06 14:14:05 +0000 | |||
1223 | @@ -411,5 +411,10 @@ | |||
1224 | 411 | <field name="method">us_5667_remove_contract_workflow</field> | 411 | <field name="method">us_5667_remove_contract_workflow</field> |
1225 | 412 | </record> | 412 | </record> |
1226 | 413 | 413 | ||
1227 | 414 | <!-- UF13.0 --> | ||
1228 | 415 | <record id="us_5771_allow_all_cc_in_default_dest" model="patch.scripts"> | ||
1229 | 416 | <field name="method">us_5771_allow_all_cc_in_default_dest</field> | ||
1230 | 417 | </record> | ||
1231 | 418 | |||
1232 | 414 | </data> | 419 | </data> |
1233 | 415 | </openerp> | 420 | </openerp> |
1234 | 416 | 421 | ||
1235 | === modified file 'bin/addons/msf_profile/i18n/fr_MF.po' | |||
1236 | --- bin/addons/msf_profile/i18n/fr_MF.po 2019-04-08 09:30:07 +0000 | |||
1237 | +++ bin/addons/msf_profile/i18n/fr_MF.po 2019-05-06 14:14:05 +0000 | |||
1238 | @@ -5227,8 +5227,9 @@ | |||
1239 | 5227 | msgid "Close period (Mission)" | 5227 | msgid "Close period (Mission)" |
1240 | 5228 | msgstr "Clôturer la Période (Mission)" | 5228 | msgstr "Clôturer la Période (Mission)" |
1241 | 5229 | 5229 | ||
1243 | 5230 | #. module: msf_budget | 5230 | #. modules: msf_budget, analytic_distribution |
1244 | 5231 | #: report:addons/msf_budget/report/report_local_expenses_xls.mako:116 | 5231 | #: report:addons/msf_budget/report/report_local_expenses_xls.mako:116 |
1245 | 5232 | #: report:funding.pool:0 | ||
1246 | 5232 | msgid "Account name" | 5233 | msgid "Account name" |
1247 | 5233 | msgstr "Nom du compte" | 5234 | msgstr "Nom du compte" |
1248 | 5234 | 5235 | ||
1249 | @@ -16477,6 +16478,7 @@ | |||
1250 | 16477 | #: view:threshold.value:0 | 16478 | #: view:threshold.value:0 |
1251 | 16478 | #: view:international.transport.cost.report:0 | 16479 | #: view:international.transport.cost.report:0 |
1252 | 16479 | #: view:local.transport.cost.report:0 | 16480 | #: view:local.transport.cost.report:0 |
1253 | 16481 | #: view:account.destination.summary:0 | ||
1254 | 16480 | msgid "Group By..." | 16482 | msgid "Group By..." |
1255 | 16481 | msgstr "Grouper Par..." | 16483 | msgstr "Grouper Par..." |
1256 | 16482 | 16484 | ||
1257 | @@ -16779,7 +16781,7 @@ | |||
1258 | 16779 | #. module: analytic_distribution | 16781 | #. module: analytic_distribution |
1259 | 16780 | #: view:account.analytic.account:0 | 16782 | #: view:account.analytic.account:0 |
1260 | 16781 | msgid "Remove all" | 16783 | msgid "Remove all" |
1262 | 16782 | msgstr "Remove all" | 16784 | msgstr "Tout supprimer" |
1263 | 16783 | 16785 | ||
1264 | 16784 | #. module: vertical_integration | 16786 | #. module: vertical_integration |
1265 | 16785 | #: code:addons/vertical_integration/report/hq_report_oca.py:176 | 16787 | #: code:addons/vertical_integration/report/hq_report_oca.py:176 |
1266 | @@ -31372,9 +31374,10 @@ | |||
1267 | 31372 | msgid "Type of file" | 31374 | msgid "Type of file" |
1268 | 31373 | msgstr "Type de fichier" | 31375 | msgstr "Type de fichier" |
1269 | 31374 | 31376 | ||
1271 | 31375 | #. module: msf_budget | 31377 | #. modules: msf_budget, analytic_distribution |
1272 | 31376 | #: report:addons/msf_budget/report/report_local_expenses_xls.mako:115 | 31378 | #: report:addons/msf_budget/report/report_local_expenses_xls.mako:115 |
1273 | 31377 | #: field:msf.budget.line,account_code:0 | 31379 | #: field:msf.budget.line,account_code:0 |
1274 | 31380 | #: report:funding.pool:0 | ||
1275 | 31378 | msgid "Account code" | 31381 | msgid "Account code" |
1276 | 31379 | msgstr "Code du compte" | 31382 | msgstr "Code du compte" |
1277 | 31380 | 31383 | ||
1278 | @@ -38475,6 +38478,7 @@ | |||
1279 | 38475 | #: field:hr.payroll.msf,funding_pool_id:0 | 38478 | #: field:hr.payroll.msf,funding_pool_id:0 |
1280 | 38476 | #: field:account.invoice.line,funding_pool_id:0 | 38479 | #: field:account.invoice.line,funding_pool_id:0 |
1281 | 38477 | #: report:addons/account/report/free_allocation_report.mako:208 | 38480 | #: report:addons/account/report/free_allocation_report.mako:208 |
1282 | 38481 | #: view:account.destination.summary:0 | ||
1283 | 38478 | #, python-format | 38482 | #, python-format |
1284 | 38479 | msgid "Funding Pool" | 38483 | msgid "Funding Pool" |
1285 | 38480 | msgstr "Funding Pool" | 38484 | msgstr "Funding Pool" |
1286 | @@ -47675,10 +47679,11 @@ | |||
1287 | 47675 | msgid "America/Sitka" | 47679 | msgid "America/Sitka" |
1288 | 47676 | msgstr "America/Sitka" | 47680 | msgstr "America/Sitka" |
1289 | 47677 | 47681 | ||
1291 | 47678 | #. module: account | 47682 | #. modules: account, analytic_distribution |
1292 | 47679 | #: view:account.analytic.line:0 | 47683 | #: view:account.analytic.line:0 |
1293 | 47684 | #: view:account.destination.summary:0 | ||
1294 | 47680 | msgid "G/L account" | 47685 | msgid "G/L account" |
1296 | 47681 | msgstr "G/L account" | 47686 | msgstr "Compte Grand Livre" |
1297 | 47682 | 47687 | ||
1298 | 47683 | #. modules: account, register_accounting | 47688 | #. modules: account, register_accounting |
1299 | 47684 | #: help:account.invoice,state:0 | 47689 | #: help:account.invoice,state:0 |
1300 | @@ -67403,6 +67408,7 @@ | |||
1301 | 67403 | #: view:msf.instance:0 | 67408 | #: view:msf.instance:0 |
1302 | 67404 | #: report:addons/account/report/free_allocation_report.mako:176 | 67409 | #: report:addons/account/report/free_allocation_report.mako:176 |
1303 | 67405 | #: field:free.allocation.wizard,cost_center_ids:0 | 67410 | #: field:free.allocation.wizard,cost_center_ids:0 |
1304 | 67411 | #: field:account.analytic.account,dest_cc_ids:0 | ||
1305 | 67406 | msgid "Cost Centers" | 67412 | msgid "Cost Centers" |
1306 | 67407 | msgstr "Centres de Coût" | 67413 | msgstr "Centres de Coût" |
1307 | 67408 | 67414 | ||
1308 | @@ -86607,10 +86613,12 @@ | |||
1309 | 86607 | msgid "Total weight:" | 86613 | msgid "Total weight:" |
1310 | 86608 | msgstr "Total weight:" | 86614 | msgstr "Total weight:" |
1311 | 86609 | 86615 | ||
1313 | 86610 | #. module: analytic_distribution | 86616 | #. modules: analytic_distribution, analytic_override |
1314 | 86611 | #: view:account.analytic.account:0 | 86617 | #: view:account.analytic.account:0 |
1315 | 86612 | #: view:account.destination.summary:0 | 86618 | #: view:account.destination.summary:0 |
1316 | 86613 | #: model:ir.model,name:analytic_distribution.model_account_destination_summary | 86619 | #: model:ir.model,name:analytic_distribution.model_account_destination_summary |
1317 | 86620 | #: model:ir.actions.server,name:analytic_distribution.action_analytic_acc_dest_summary | ||
1318 | 86621 | #: code:addons/analytic_override/analytic_account.py:652 | ||
1319 | 86614 | msgid "Destinations by accounts" | 86622 | msgid "Destinations by accounts" |
1320 | 86615 | msgstr "Destinations par Compte" | 86623 | msgstr "Destinations par Compte" |
1321 | 86616 | 86624 | ||
1322 | @@ -91150,8 +91158,8 @@ | |||
1323 | 91150 | 91158 | ||
1324 | 91151 | #. module: analytic_distribution | 91159 | #. module: analytic_distribution |
1325 | 91152 | #: report:funding.pool:0 | 91160 | #: report:funding.pool:0 |
1328 | 91153 | msgid "Accounts:" | 91161 | msgid "Account/Destination:" |
1329 | 91154 | msgstr "Comptes:" | 91162 | msgstr "Compte / Destination :" |
1330 | 91155 | 91163 | ||
1331 | 91156 | #. module: msf_outgoing | 91164 | #. module: msf_outgoing |
1332 | 91157 | #: help:return.pack.shipment.processor,address_id:0 | 91165 | #: help:return.pack.shipment.processor,address_id:0 |
1333 | @@ -96457,6 +96465,8 @@ | |||
1334 | 96457 | #: view:sync.client.message_to_send:0 | 96465 | #: view:sync.client.message_to_send:0 |
1335 | 96458 | #: report:addons/account/report/free_allocation_report.mako:202 | 96466 | #: report:addons/account/report/free_allocation_report.mako:202 |
1336 | 96459 | #: report:addons/stock_override/report/report_stock_move_xls.mako:143 | 96467 | #: report:addons/stock_override/report/report_stock_move_xls.mako:143 |
1337 | 96468 | #: field:account.destination.summary,destination_id:0 | ||
1338 | 96469 | #: view:account.destination.summary:0 | ||
1339 | 96460 | #, python-format | 96470 | #, python-format |
1340 | 96461 | msgid "Destination" | 96471 | msgid "Destination" |
1341 | 96462 | msgstr "Destination" | 96472 | msgstr "Destination" |
1342 | @@ -102110,6 +102120,12 @@ | |||
1343 | 102110 | msgstr "%s: DEST (%s) incompatible avec le compte (%s)" | 102120 | msgstr "%s: DEST (%s) incompatible avec le compte (%s)" |
1344 | 102111 | 102121 | ||
1345 | 102112 | #. module: account_hq_entries | 102122 | #. module: account_hq_entries |
1346 | 102123 | #: code:addons/account_hq_entries/hq_entries.py:142 | ||
1347 | 102124 | #, python-format | ||
1348 | 102125 | msgid "%s: CC (%s) not compatible with DEST (%s)" | ||
1349 | 102126 | msgstr "%s : CC (%s) non compatible avec la DEST (%s)" | ||
1350 | 102127 | |||
1351 | 102128 | #. module: account_hq_entries | ||
1352 | 102113 | #: code:addons/account_hq_entries/hq_entries.py:103 | 102129 | #: code:addons/account_hq_entries/hq_entries.py:103 |
1353 | 102114 | #, python-format | 102130 | #, python-format |
1354 | 102115 | msgid "%s: No CC" | 102131 | msgid "%s: No CC" |
1355 | @@ -105388,3 +105404,113 @@ | |||
1356 | 105388 | #, python-format | 105404 | #, python-format |
1357 | 105389 | msgid "Product %s, BN: %s not enough stock to process quantity %s %s (stock level: %s)" | 105405 | msgid "Product %s, BN: %s not enough stock to process quantity %s %s (stock level: %s)" |
1358 | 105390 | msgstr "Produit %s, Lot: %s, pas assez de stock pour traiter la qantité %s %s (quantité en stock: %s)" | 105406 | msgstr "Produit %s, Lot: %s, pas assez de stock pour traiter la qantité %s %s (quantité en stock: %s)" |
1359 | 105407 | |||
1360 | 105408 | #. module: analytic_distribution | ||
1361 | 105409 | #: code:addons/analytic_distribution/analytic_distribution.py:123 | ||
1362 | 105410 | #, python-format | ||
1363 | 105411 | msgid "Cost Center not compatible with destination" | ||
1364 | 105412 | msgstr "Centre de Coût non compatible avec la destination" | ||
1365 | 105413 | |||
1366 | 105414 | #. module: analytic_distribution | ||
1367 | 105415 | #: code:addons/analytic_distribution/analytic_line.py:528 | ||
1368 | 105416 | #, python-format | ||
1369 | 105417 | msgid "CC/DEST" | ||
1370 | 105418 | msgstr "CC / DEST" | ||
1371 | 105419 | |||
1372 | 105420 | #. module: analytic_distribution | ||
1373 | 105421 | #: report:funding.pool:0 | ||
1374 | 105422 | msgid "Destination code" | ||
1375 | 105423 | msgstr "Code de la destination" | ||
1376 | 105424 | |||
1377 | 105425 | #. module: analytic_distribution | ||
1378 | 105426 | #: report:funding.pool:0 | ||
1379 | 105427 | msgid "Destination name" | ||
1380 | 105428 | msgstr "Nom de la destination" | ||
1381 | 105429 | |||
1382 | 105430 | #. module: analytic_override | ||
1383 | 105431 | #: code:addons/analytic_override/analytic_account.py:227 | ||
1384 | 105432 | #, python-format | ||
1385 | 105433 | msgid "Filter not implemented on Destinations." | ||
1386 | 105434 | msgstr "Filtre non mis en oeuvre sur les Destinations." | ||
1387 | 105435 | |||
1388 | 105436 | #. module: analytic_override | ||
1389 | 105437 | #: field:account.analytic.account,allow_all_cc:0 | ||
1390 | 105438 | msgid "Allow all Cost Centers" | ||
1391 | 105439 | msgstr "Autoriser tous les Centres de Coût" | ||
1392 | 105440 | |||
1393 | 105441 | #. module: msf_doc_import | ||
1394 | 105442 | #: code:addons/msf_doc_import/msf_import_export.py:999 | ||
1395 | 105443 | #, python-format | ||
1396 | 105444 | msgid "Please either list the Cost Centers to allow, or allow all Cost Centers." | ||
1397 | 105445 | msgstr "Veuillez soit lister les Centres de Coût à autoriser, soit autoriser tous les Centres de Coût." | ||
1398 | 105446 | |||
1399 | 105447 | #. module: analytic_override | ||
1400 | 105448 | #: field:account.analytic.account,dest_compatible_with_cc_ids:0 | ||
1401 | 105449 | msgid "Destinations compatible with the Cost Center" | ||
1402 | 105450 | msgstr "Destinations compatibles avec le Centre de Coût" | ||
1403 | 105451 | |||
1404 | 105452 | #. module: analytic_override | ||
1405 | 105453 | #: code:addons/analytic_override/analytic_account.py:347 | ||
1406 | 105454 | #, python-format | ||
1407 | 105455 | msgid "Please remove the Cost Centers linked to the Destination before ticking this box." | ||
1408 | 105456 | msgstr "Veuillez supprimer les Centres de Coût liés à la Destination avant de cocher cette case." | ||
1409 | 105457 | |||
1410 | 105458 | #. module: account_corrections | ||
1411 | 105459 | #: code:addons/account_corrections/wizard/analytic_distribution_wizard.py:246 | ||
1412 | 105460 | #, python-format | ||
1413 | 105461 | msgid "The Cost Center %s is not compatible with the Destination %s." | ||
1414 | 105462 | msgstr "Le Centre de Coût %s n'est pas compatible avec la Destination %s." | ||
1415 | 105463 | |||
1416 | 105464 | #. module: msf_doc_import | ||
1417 | 105465 | #: code:addons/msf_doc_import/account.py:490 | ||
1418 | 105466 | #, python-format | ||
1419 | 105467 | msgid "Line %s. The Cost Center %s is not compatible with the Destination %s." | ||
1420 | 105468 | msgstr "Ligne %s. Le Centre de Coût %s n'est pas compatible avec la Destination %s." | ||
1421 | 105469 | |||
1422 | 105470 | #. module: msf_doc_import | ||
1423 | 105471 | #: code:addons/msf_doc_import/msf_import_export.py:945 | ||
1424 | 105472 | #, python-format | ||
1425 | 105473 | msgid "The Parent Analytic Account must be a View type Funding Pool." | ||
1426 | 105474 | msgstr "Le Compte Analytique Parent doit être un Funding Pool de type Vue." | ||
1427 | 105475 | |||
1428 | 105476 | #. module: msf_doc_import | ||
1429 | 105477 | #: code:addons/msf_doc_import/msf_import_export.py:992 | ||
1430 | 105478 | #, python-format | ||
1431 | 105479 | msgid "The Parent Analytic Account must be a View type Destination." | ||
1432 | 105480 | msgstr "Le Compte Analytique Parent doit être une Destination de type Vue." | ||
1433 | 105481 | |||
1434 | 105482 | #. module: msf_doc_import | ||
1435 | 105483 | #: code:addons/msf_doc_import/msf_import_export.py:1063 | ||
1436 | 105484 | #, python-format | ||
1437 | 105485 | msgid "The Parent Analytic Account must be a View type Cost Center." | ||
1438 | 105486 | msgstr "Le Compte Analytique Parent doit être un Centre de Coût de type Vue." | ||
1439 | 105487 | |||
1440 | 105488 | #. module: msf_doc_import | ||
1441 | 105489 | #: code:addons/msf_doc_import/msf_import_export.py:1076 | ||
1442 | 105490 | #, python-format | ||
1443 | 105491 | msgid "The Parent Analytic Account must be a View type Free 1 account." | ||
1444 | 105492 | msgstr "Le Compte Analytique Parent doit être un compte \"Option 1\" de type Vue." | ||
1445 | 105493 | |||
1446 | 105494 | #. module: msf_doc_import | ||
1447 | 105495 | #: code:addons/msf_doc_import/msf_import_export.py:1089 | ||
1448 | 105496 | #, python-format | ||
1449 | 105497 | msgid "The Parent Analytic Account must be a View type Free 2 account." | ||
1450 | 105498 | msgstr "Le Compte Analytique Parent doit être un compte \"Option 2\" de type Vue." | ||
1451 | 105499 | |||
1452 | 105500 | #. module: msf_doc_import | ||
1453 | 105501 | #: code:addons/msf_doc_import/msf_import_export.py:995 | ||
1454 | 105502 | #, python-format | ||
1455 | 105503 | msgid "The Type must be either \"Normal\" or \"View\"." | ||
1456 | 105504 | msgstr "Le Type doit être soit \"Normal\" soit \"Vue\"." | ||
1457 | 105505 | |||
1458 | 105506 | #. module: msf_doc_import | ||
1459 | 105507 | #: code:addons/msf_doc_import/msf_import_export.py:1023 | ||
1460 | 105508 | #, python-format | ||
1461 | 105509 | msgid "Account code \"%s\" doesn't exist or isn't allowed." | ||
1462 | 105510 | msgstr "Le code comptable \"%s\" n'existe pas ou n'est pas autorisé." | ||
1463 | 105511 | |||
1464 | 105512 | #. module: msf_homere_interface | ||
1465 | 105513 | #: code:addons/msf_homere_interface/hr.py:224 | ||
1466 | 105514 | #, python-format | ||
1467 | 105515 | msgid "Employee %s: the Cost Center %s is not compatible with the Destination %s." | ||
1468 | 105516 | msgstr "Employé %s : le Centre de Coût %s n'est pas compatible avec la Destination %s." | ||
1469 | 105391 | 105517 | ||
1470 | === modified file 'bin/addons/msf_profile/msf_profile.py' | |||
1471 | --- bin/addons/msf_profile/msf_profile.py 2019-03-28 13:22:15 +0000 | |||
1472 | +++ bin/addons/msf_profile/msf_profile.py 2019-05-06 14:14:05 +0000 | |||
1473 | @@ -69,6 +69,24 @@ | |||
1474 | 69 | err_msg, | 69 | err_msg, |
1475 | 70 | ) | 70 | ) |
1476 | 71 | 71 | ||
1477 | 72 | # UF13.0 | ||
1478 | 73 | def us_5771_allow_all_cc_in_default_dest(self, cr, uid, *a, **b): | ||
1479 | 74 | """ | ||
1480 | 75 | Set the default created destinations (OPS/EXP/SUP/NAT) as "Allow all Cost Centers" | ||
1481 | 76 | """ | ||
1482 | 77 | update_dests = """ | ||
1483 | 78 | UPDATE account_analytic_account | ||
1484 | 79 | SET allow_all_cc = 't' | ||
1485 | 80 | WHERE category = 'DEST' | ||
1486 | 81 | AND id IN (SELECT res_id FROM ir_model_data WHERE module='analytic_distribution' AND name IN ( | ||
1487 | 82 | 'analytic_account_destination_operation', | ||
1488 | 83 | 'analytic_account_destination_expatriates', | ||
1489 | 84 | 'analytic_account_destination_support', | ||
1490 | 85 | 'analytic_account_destination_national_staff')); | ||
1491 | 86 | """ | ||
1492 | 87 | cr.execute(update_dests) | ||
1493 | 88 | return True | ||
1494 | 89 | |||
1495 | 72 | # UF12.1 | 90 | # UF12.1 |
1496 | 73 | def us_5199_fix_cancel_partial_move_sol_id(self, cr, uid, *a, **b): | 91 | def us_5199_fix_cancel_partial_move_sol_id(self, cr, uid, *a, **b): |
1497 | 74 | ''' | 92 | ''' |
1498 | 75 | 93 | ||
1499 | === modified file 'bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv' | |||
1500 | --- bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv 2019-02-28 15:19:06 +0000 | |||
1501 | +++ bin/addons/msf_sync_data_server/data/sync_server.sync_rule.csv 2019-05-06 14:14:05 +0000 | |||
1502 | @@ -31,6 +31,7 @@ | |||
1503 | 31 | msf_sync_data_server.periods_state,TRUE,TRUE,TRUE,TRUE,bidirectional,Up,[],"['state', 'period_id/id', 'instance_id/id']",HQ + MISSION,account.period.state,,Periods states,Valid,,129 | 31 | msf_sync_data_server.periods_state,TRUE,TRUE,TRUE,TRUE,bidirectional,Up,[],"['state', 'period_id/id', 'instance_id/id']",HQ + MISSION,account.period.state,,Periods states,Valid,,129 |
1504 | 32 | msf_sync_data_server.fys_state,TRUE,TRUE,TRUE,TRUE,bidirectional,Up,[],"['state', 'fy_id/id', 'instance_id/id']",HQ + MISSION,account.fiscalyear.state,,Fiscal years states,Valid,,130 | 32 | msf_sync_data_server.fys_state,TRUE,TRUE,TRUE,TRUE,bidirectional,Up,[],"['state', 'fy_id/id', 'instance_id/id']",HQ + MISSION,account.fiscalyear.state,,Fiscal years states,Valid,,130 |
1505 | 33 | msf_sync_data_server.cost_center_cc_intermission,TRUE,TRUE,FALSE,TRUE,bidirectional,Down,"[('category' , '=' , 'OC'), ('code', '=', 'cc-intermission')]","['category', 'code', 'date', 'date_start', 'description', 'name', 'type']",OC,account.analytic.account,,CC-Intermission,Valid,,140 | 33 | msf_sync_data_server.cost_center_cc_intermission,TRUE,TRUE,FALSE,TRUE,bidirectional,Down,"[('category' , '=' , 'OC'), ('code', '=', 'cc-intermission')]","['category', 'code', 'date', 'date_start', 'description', 'name', 'type']",OC,account.analytic.account,,CC-Intermission,Valid,,140 |
1506 | 34 | msf_sync_data_server.destination_cc,TRUE,TRUE,TRUE,TRUE,bidirectional,Down,"[('category' , '=' , 'DEST')]","['dest_cc_ids/id', 'allow_all_cc']",OC,account.analytic.account,,Destinations: Cost Center fields,Valid,,145 | ||
1507 | 34 | msf_sync_data_server.gl_accounts_reconciliation,TRUE,TRUE,FALSE,TRUE,bidirectional,Down,[],"['reconciliation_debit_account_id/id', 'reconciliation_credit_account_id/id']",OC,account.account,,GL Accounts Reconciliation Accounts,Valid,,150 | 35 | msf_sync_data_server.gl_accounts_reconciliation,TRUE,TRUE,FALSE,TRUE,bidirectional,Down,[],"['reconciliation_debit_account_id/id', 'reconciliation_credit_account_id/id']",OC,account.account,,GL Accounts Reconciliation Accounts,Valid,,150 |
1508 | 35 | msf_sync_data_server.analytic_distribution,TRUE,TRUE,FALSE,FALSE,bidirectional,Bidirectional,[],['name'],HQ + MISSION,analytic.distribution,,Analytic Distribution,Valid,,200 | 36 | msf_sync_data_server.analytic_distribution,TRUE,TRUE,FALSE,FALSE,bidirectional,Bidirectional,[],['name'],HQ + MISSION,analytic.distribution,,Analytic Distribution,Valid,,200 |
1509 | 36 | msf_sync_data_server.cost_center_distribution_line,TRUE,TRUE,TRUE,FALSE,bidirectional,Bidirectional,"[('partner_type','=','internal')]","['amount', 'analytic_id/id', 'currency_id/id', 'date', 'destination_id/id', 'distribution_id/id', 'name', 'percentage', 'partner_type', 'source_date']",HQ + MISSION,cost.center.distribution.line,analytic_id,Cost Center Distribution Line - Internal partner,Valid,,201 | 37 | msf_sync_data_server.cost_center_distribution_line,TRUE,TRUE,TRUE,FALSE,bidirectional,Bidirectional,"[('partner_type','=','internal')]","['amount', 'analytic_id/id', 'currency_id/id', 'date', 'destination_id/id', 'distribution_id/id', 'name', 'percentage', 'partner_type', 'source_date']",HQ + MISSION,cost.center.distribution.line,analytic_id,Cost Center Distribution Line - Internal partner,Valid,,201 |