Merge lp:~julie-w/unifield-server/US-3427 into lp:unifield-server
- US-3427
- Merge into trunk
Proposed by
jftempo
Status: | Merged |
---|---|
Merged at revision: | 5045 |
Proposed branch: | lp:~julie-w/unifield-server/US-3427 |
Merge into: | lp:unifield-server |
Diff against target: |
440 lines (+270/-11) 5 files modified
bin/addons/account_mcdb/account_mcdb.py (+106/-6) bin/addons/account_mcdb/account_mcdb_view.xml (+64/-3) bin/addons/msf_profile/data/patches.xml (+5/-0) bin/addons/msf_profile/i18n/fr_MF.po (+57/-2) bin/addons/msf_profile/msf_profile.py (+38/-0) |
To merge this branch: | bzr merge lp:~julie-w/unifield-server/US-3427 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
UniField Reviewer Team | Pending | ||
Review via email: mp+352740@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_mcdb/account_mcdb.py' |
2 | --- bin/addons/account_mcdb/account_mcdb.py 2018-05-30 13:38:20 +0000 |
3 | +++ bin/addons/account_mcdb/account_mcdb.py 2018-08-08 07:43:14 +0000 |
4 | @@ -46,9 +46,17 @@ |
5 | 'period_ids': fields.many2many(obj='account.period', rel="account_period_mcdb", id1="mcdb_id", id2="period_id", string="Accounting Period"), |
6 | 'fiscalyear_id': fields.many2one('account.fiscalyear', string='Fiscal Year'), |
7 | 'account_ids': fields.many2many(obj='account.account', rel='account_account_mcdb', id1='mcdb_id', id2='account_id', string="Account Code"), |
8 | - 'partner_id': fields.many2one('res.partner', string="Partner"), |
9 | - 'employee_id': fields.many2one('hr.employee', string="Employee"), |
10 | - 'transfer_journal_id': fields.many2one('account.journal', string="Journal", domain="[('code', '!=', 'IB')]"), # exclude year closing initial balance journal |
11 | + 'partner_id': fields.many2one('res.partner', string="Partner"), # not used since US-3427 |
12 | + 'partner_ids': fields.many2many(obj='res.partner', rel='partner_mcdb', id1='mcdb_id', id2='partner_id', |
13 | + string='Partners', order_by='name, id'), |
14 | + 'employee_id': fields.many2one('hr.employee', string="Employee"), # not used since US-3427 |
15 | + 'employee_ids': fields.many2many(obj='hr.employee', rel='employee_mcdb', id1='mcdb_id', id2='employee_id', |
16 | + string='Employees', order_by='employee_type, identification_id, id'), |
17 | + 'transfer_journal_id': fields.many2one('account.journal', string="Journal", |
18 | + domain="[('code', '!=', 'IB')]"), # exclude year closing initial balance journal / not used since US-3427 |
19 | + 'transfer_journal_ids': fields.many2many(obj='account.journal', rel='transfer_journal_mcdb', id1='mcdb_id', id2='journal_id', |
20 | + string='Journals', domain="[('type', 'in', ['cash', 'bank', 'cheque'])]", |
21 | + order_by='instance_id, code, id'), |
22 | 'reconciled': fields.selection([('reconciled', 'Reconciled'), ('unreconciled', 'NOT reconciled')], string='Reconciled?'), |
23 | 'functional_currency_id': fields.many2one('res.currency', string="Functional currency", readonly=True), |
24 | 'amount_func_from': fields.float('Begin amount in functional currency'), |
25 | @@ -93,6 +101,9 @@ |
26 | 'rev_analytic_journal_ids': fields.boolean('Exclude analytic journal selection'), |
27 | 'rev_instance_ids': fields.boolean('Exclude instances selection'), |
28 | 'rev_top_prop_instance_ids': fields.boolean('Exclude top prop instances selection'), |
29 | + 'rev_partner_ids': fields.boolean('Exclude partner selection'), |
30 | + 'rev_employee_ids': fields.boolean('Exclude employee selection'), |
31 | + 'rev_transfer_journal_ids': fields.boolean('Exclude journal selection'), # Third Party Journal |
32 | 'analytic_axis': fields.selection([('fp', 'Funding Pool'), ('f1', 'Free 1'), ('f2', 'Free 2')], string='Display'), |
33 | 'rev_analytic_account_dest_ids': fields.boolean('Exclude Destination selection'), |
34 | 'analytic_account_dest_ids': fields.many2many(obj='account.analytic.account', rel="account_analytic_dest_mcdb", id1="mcdb_id", id2="analytic_account_id", |
35 | @@ -111,6 +122,9 @@ |
36 | 'display_destination': fields.boolean('Display destinations?'), |
37 | 'display_free1': fields.boolean('Display Free 1?'), |
38 | 'display_free2': fields.boolean('Display Free 2?'), |
39 | + 'display_partner': fields.boolean('Display Partners?'), |
40 | + 'display_employee': fields.boolean('Display Employees?'), |
41 | + 'display_transfer_journal': fields.boolean('Display Transfer Journals?'), |
42 | 'user': fields.many2one('res.users', "User"), |
43 | 'cheque_number': fields.char('Cheque Number', size=120), # BKLG-7 |
44 | 'partner_txt': fields.char('Third Party', size=120), # BKLG-7 |
45 | @@ -281,6 +295,7 @@ |
46 | domain = [] |
47 | wiz = self.browse(cr, uid, [ids[0]], context=context)[0] |
48 | res_model = context.get('selector_model', False) or (wiz and wiz.model) or False |
49 | + journal_obj = self.pool.get('account.journal') |
50 | if res_model: |
51 | # Prepare domain values |
52 | # First MANY2MANY fields |
53 | @@ -312,8 +327,12 @@ |
54 | else: |
55 | m2m_fields.append(('account_ids', 'account_id')) |
56 | m2m_fields.append(('account_type_ids', 'account_id.user_type')) |
57 | + m2m_fields.append(('partner_ids', 'partner_id')) |
58 | + m2m_fields.append(('employee_ids', 'employee_id')) |
59 | + m2m_fields.append(('transfer_journal_ids', 'transfer_journal_id')) |
60 | for m2m in m2m_fields: |
61 | if getattr(wiz, m2m[0]): |
62 | + value = False |
63 | |
64 | # do not add domain if the block have not been selected |
65 | # (because they are using same field relation m2m) |
66 | @@ -359,6 +378,18 @@ |
67 | operator = 'not in' |
68 | elif m2m[0] == 'top_prop_instance_ids' and wiz.rev_top_prop_instance_ids: |
69 | operator = 'not in' |
70 | + # partner_ids with reversal |
71 | + elif m2m[0] == 'partner_ids' and wiz.rev_partner_ids: |
72 | + operator = 'not in' |
73 | + # employee_ids with reversal |
74 | + elif m2m[0] == 'employee_ids' and wiz.rev_employee_ids: |
75 | + operator = 'not in' |
76 | + # transfer_journal_ids with reversal |
77 | + elif m2m[0] == 'transfer_journal_ids' and wiz.rev_transfer_journal_ids: |
78 | + operator = 'not in' |
79 | + # also exclude all non liquidity journals (so the right journals will be displayed in the PDF report header) |
80 | + other_journal_ids = journal_obj.search(cr, uid, [('type', 'not in', ['cash', 'bank', 'cheque'])], order='NO_ORDER', context=context) |
81 | + value = [x.id for x in getattr(wiz, m2m[0])] + other_journal_ids |
82 | # Search if a view account is given |
83 | if m2m[0] in ['account_ids', 'analytic_account_fp_ids', 'analytic_account_cc_ids', 'analytic_account_f1_ids', 'analytic_account_f2_ids']: |
84 | account_ids = [] |
85 | @@ -383,10 +414,10 @@ |
86 | id_list = child_list + [x.id for x in getattr(wiz, m2m[0])] |
87 | domain.append((m2m[1], operator, tuple(id_list))) |
88 | else: |
89 | - domain.append((m2m[1], operator, tuple([x.id for x in getattr(wiz, m2m[0])]))) |
90 | + value = value or tuple([x.id for x in getattr(wiz, m2m[0])]) |
91 | + domain.append((m2m[1], operator, value)) |
92 | # Then MANY2ONE fields |
93 | - for m2o in [('abs_id', 'statement_id'), ('partner_id', 'partner_id'), ('employee_id', 'employee_id'), |
94 | - ('transfer_journal_id', 'transfer_journal_id'), ('booking_currency_id', 'currency_id'), |
95 | + for m2o in [('abs_id', 'statement_id'), ('booking_currency_id', 'currency_id'), |
96 | ('fiscalyear_id', 'fiscalyear_id')]: |
97 | if getattr(wiz, m2o[0]): |
98 | domain.append((m2o[1], '=', getattr(wiz, m2o[0]).id)) |
99 | @@ -1013,6 +1044,75 @@ |
100 | field = 'instance_ids' |
101 | return self._button_add(cr, uid, ids, obj, field, args, context=context) |
102 | |
103 | + def button_partner_add(self, cr, uid, ids, context=None): |
104 | + """ |
105 | + Adds all Partners in partner_ids field content |
106 | + """ |
107 | + if context is None: |
108 | + context = {} |
109 | + if isinstance(ids, (int, long)): |
110 | + ids = [ids] |
111 | + obj = 'res.partner' |
112 | + args = [('active', '=', 't')] |
113 | + field = 'partner_ids' |
114 | + return self._button_add(cr, uid, ids, obj, field, args, context=context) |
115 | + |
116 | + def button_employee_add(self, cr, uid, ids, context=None): |
117 | + """ |
118 | + Adds all Employees in employee_ids field content |
119 | + """ |
120 | + if context is None: |
121 | + context = {} |
122 | + if isinstance(ids, (int, long)): |
123 | + ids = [ids] |
124 | + obj = 'hr.employee' |
125 | + args = [('active', '=', 't')] |
126 | + field = 'employee_ids' |
127 | + return self._button_add(cr, uid, ids, obj, field, args, context=context) |
128 | + |
129 | + def button_transfer_journal_add(self, cr, uid, ids, context=None): |
130 | + """ |
131 | + Adds all Transfer Journals in transfer_journal_ids field content |
132 | + """ |
133 | + if context is None: |
134 | + context = {} |
135 | + if isinstance(ids, (int, long)): |
136 | + ids = [ids] |
137 | + obj = 'account.journal' |
138 | + args = [('type', 'in', ['cash', 'bank', 'cheque'])] |
139 | + field = 'transfer_journal_ids' |
140 | + return self._button_add(cr, uid, ids, obj, field, args, context=context) |
141 | + |
142 | + def button_partner_clear(self, cr, uid, ids, context=None): |
143 | + """ |
144 | + Deletes partner_ids field content |
145 | + """ |
146 | + if context is None: |
147 | + context = {} |
148 | + if isinstance(ids, (int, long)): |
149 | + ids = [ids] |
150 | + return self.button_clear(cr, uid, ids, field='partner_ids', context=context) |
151 | + |
152 | + def button_employee_clear(self, cr, uid, ids, context=None): |
153 | + """ |
154 | + Deletes employee_ids field content |
155 | + """ |
156 | + if context is None: |
157 | + context = {} |
158 | + if isinstance(ids, (int, long)): |
159 | + ids = [ids] |
160 | + return self.button_clear(cr, uid, ids, field='employee_ids', context=context) |
161 | + |
162 | + def button_transfer_journal_clear(self, cr, uid, ids, context=None): |
163 | + """ |
164 | + Deletes transfer_journal_ids field content |
165 | + """ |
166 | + if context is None: |
167 | + context = {} |
168 | + if isinstance(ids, (int, long)): |
169 | + ids = [ids] |
170 | + return self.button_clear(cr, uid, ids, field='transfer_journal_ids', context=context) |
171 | + |
172 | def clean_up_search(self, cr, uid, ids, context=None): |
173 | """ |
174 | Clean up objects that have no description. |
175 | |
176 | === modified file 'bin/addons/account_mcdb/account_mcdb_view.xml' |
177 | --- bin/addons/account_mcdb/account_mcdb_view.xml 2018-04-05 12:43:54 +0000 |
178 | +++ bin/addons/account_mcdb/account_mcdb_view.xml 2018-08-08 07:43:14 +0000 |
179 | @@ -32,9 +32,70 @@ |
180 | ¤cy; |
181 | <group colspan="4" col="6"> |
182 | <separator string="Third Party" colspan="6"/> |
183 | - <field name="partner_id" colspan="2" context="{'show_button_show_inactive':1}" /> |
184 | - <field name="employee_id" colspan="2" context="{'disrupt_inactive': False}"/> |
185 | - <field name="transfer_journal_id" colspan="2"/> |
186 | + <!-- PARTNERS --> |
187 | + <group col="2" colspan="2"> |
188 | + <group col="4" colspan="2"> |
189 | + <separator string="Partners" colspan="3"/> |
190 | + <field name="display_partner" colspan="1" nolabel="1"/> |
191 | + </group> |
192 | + <group col="2" colspan="2" attrs="{'invisible': [('display_partner', '=', False)]}"> |
193 | + <group col="2" colspan="2"> |
194 | + <button name="button_partner_clear" type="object" string="Remove all Partners" icon="gtk-clear" colspan="1"/> |
195 | + <button name="button_partner_add" type="object" string="Add all Partners" icon="gtk-add" colspan="1"/> |
196 | + </group> |
197 | + <field name="rev_partner_ids" colspan="2"/> |
198 | + <field name="partner_ids" colspan="2" nolabel="1" context="{'show_button_show_inactive':1}"> |
199 | + <tree string="Partners" editable="top" noteditable="1"> |
200 | + <field name="name"/> |
201 | + <field name="ref"/> |
202 | + <field name="partner_type"/> |
203 | + </tree> |
204 | + </field> |
205 | + </group> |
206 | + </group> |
207 | + <!-- EMPLOYEES --> |
208 | + <group col="2" colspan="2"> |
209 | + <group col="4" colspan="2"> |
210 | + <separator string="Employees" colspan="3"/> |
211 | + <field name="display_employee" colspan="1" nolabel="1"/> |
212 | + </group> |
213 | + <group col="2" colspan="2" attrs="{'invisible': [('display_employee', '=', False)]}"> |
214 | + <group col="2" colspan="2"> |
215 | + <button name="button_employee_clear" type="object" string="Remove all Employees" icon="gtk-clear" colspan="1"/> |
216 | + <button name="button_employee_add" type="object" string="Add all Employees" icon="gtk-add" colspan="1"/> |
217 | + </group> |
218 | + <field name="rev_employee_ids" colspan="2"/> |
219 | + <field name="employee_ids" colspan="2" nolabel="1" context="{'disrupt_inactive': False}"> |
220 | + <tree string="Employees" editable="top" noteditable="1"> |
221 | + <field name="name"/> |
222 | + <field name="identification_id"/> |
223 | + <field name="employee_type"/> |
224 | + </tree> |
225 | + </field> |
226 | + </group> |
227 | + </group> |
228 | + <!-- JOURNAL THIRD PARTIES --> |
229 | + <group col="2" colspan="2"> |
230 | + <group col="4" colspan="2"> |
231 | + <separator string="Journals" colspan="3"/> |
232 | + <field name="display_transfer_journal" colspan="1" nolabel="1"/> |
233 | + </group> |
234 | + <group col="2" colspan="2" attrs="{'invisible': [('display_transfer_journal', '=', False)]}"> |
235 | + <group col="2" colspan="2"> |
236 | + <button name="button_transfer_journal_clear" type="object" string="Remove all Journals" icon="gtk-clear" colspan="1"/> |
237 | + <button name="button_transfer_journal_add" type="object" string="Add all Journals" icon="gtk-add" colspan="1"/> |
238 | + </group> |
239 | + <field name="rev_transfer_journal_ids" colspan="2"/> |
240 | + <field name="transfer_journal_ids" colspan="2" nolabel="1"> |
241 | + <tree string="Journals" editable="top" noteditable="1"> |
242 | + <field name="instance_id"/> |
243 | + <field name="code"/> |
244 | + <field name="name"/> |
245 | + <field name="type"/> |
246 | + </tree> |
247 | + </field> |
248 | + </group> |
249 | + </group> |
250 | </group> |
251 | &end; |
252 | </form> |
253 | |
254 | === modified file 'bin/addons/msf_profile/data/patches.xml' |
255 | --- bin/addons/msf_profile/data/patches.xml 2018-07-20 10:23:42 +0000 |
256 | +++ bin/addons/msf_profile/data/patches.xml 2018-08-08 07:43:14 +0000 |
257 | @@ -1,6 +1,11 @@ |
258 | <?xml version="1.0" encoding="utf-8" ?> |
259 | <openerp> |
260 | <data> |
261 | + <!-- UF10.0 --> |
262 | + <record id="us_3427_update_third_parties_in_gl_selector" model="patch.scripts"> |
263 | + <field name="method">us_3427_update_third_parties_in_gl_selector</field> |
264 | + </record> |
265 | + |
266 | <!-- UF 9.1 --> |
267 | <record id="change_xml_payment_method" model="patch.scripts"> |
268 | <field name="method">change_xml_payment_method</field> |
269 | |
270 | === modified file 'bin/addons/msf_profile/i18n/fr_MF.po' |
271 | --- bin/addons/msf_profile/i18n/fr_MF.po 2018-07-25 16:06:03 +0000 |
272 | +++ bin/addons/msf_profile/i18n/fr_MF.po 2018-08-08 07:43:14 +0000 |
273 | @@ -14426,6 +14426,21 @@ |
274 | msgid "Display journals?" |
275 | msgstr "Afficher les journaux ?" |
276 | |
277 | +#. module: account_mcdb |
278 | +#: field:account.mcdb,display_partner:0 |
279 | +msgid "Display Partners?" |
280 | +msgstr "Afficher les Partenaires ?" |
281 | + |
282 | +#. module: account_mcdb |
283 | +#: field:account.mcdb,display_transfer_journal:0 |
284 | +msgid "Display Transfer Journals?" |
285 | +msgstr "Afficher les Journaux de Transfert ?" |
286 | + |
287 | +#. module: account_mcdb |
288 | +#: field:account.mcdb,display_employee:0 |
289 | +msgid "Display Employees?" |
290 | +msgstr "Afficher les Employés ?" |
291 | + |
292 | #. module: consumption_calculation |
293 | #: field:real.average.consumption.line,asset_check:0 |
294 | msgid "Asset Check" |
295 | @@ -37392,11 +37407,13 @@ |
296 | msgid "Partially available" |
297 | msgstr "Partiellement disponible" |
298 | |
299 | -#. modules: product, account, base, finance, useability_dashboard_and_menu |
300 | +#. modules: product, account, base, finance, useability_dashboard_and_menu, account_mcdb |
301 | #: field:account.partner.ledger,partner_ids:0 |
302 | #: model:ir.ui.menu,name:account.next_id_22 |
303 | #: view:res.partner:0 |
304 | #: view:res.partner.category:0 |
305 | +#: view:account.mcdb:0 |
306 | +#: field:account.mcdb,partner_ids:0 |
307 | #: field:res.partner.category,partner_ids:0 |
308 | #: field:wizard.account.partner.balance.tree,partner_ids:0 |
309 | #: field:product.template,seller_ids:0 |
310 | @@ -46373,6 +46390,21 @@ |
311 | msgid "Exclude instances selection" |
312 | msgstr "Exclure la sélection d'instance" |
313 | |
314 | +#. module: account_mcdb |
315 | +#: field:account.mcdb,rev_partner_ids:0 |
316 | +msgid "Exclude partner selection" |
317 | +msgstr "Exclure la sélection de partenaires" |
318 | + |
319 | +#. module: account_mcdb |
320 | +#: field:account.mcdb,rev_employee_ids:0 |
321 | +msgid "Exclude employee selection" |
322 | +msgstr "Exclure la sélection d'employés" |
323 | + |
324 | +#. module: account_mcdb |
325 | +#: field:account.mcdb,rev_transfer_journal_ids:0 |
326 | +msgid "Exclude journal selection" |
327 | +msgstr "Exclure la sélection de journaux" |
328 | + |
329 | #. modules: msf_outgoing, stock_move_tracking, stock_override, consumption_calculation, specific_rules, msf_supply_doc_export, msf_doc_import, procurement_report, stock |
330 | #: view:expiry.quantity.report:0 |
331 | #: field:expiry.quantity.report.line,batch_number:0 |
332 | @@ -47146,6 +47178,16 @@ |
333 | msgid "Remove all Journals" |
334 | msgstr "Supprimer tous les Journaux" |
335 | |
336 | +#. module: account_mcdb |
337 | +#: view:account.mcdb:0 |
338 | +msgid "Remove all Partners" |
339 | +msgstr "Supprimer tous les Partenaires" |
340 | + |
341 | +#. module: account_mcdb |
342 | +#: view:account.mcdb:0 |
343 | +msgid "Remove all Employees" |
344 | +msgstr "Supprimer tous les Employés" |
345 | + |
346 | #. module: base |
347 | #: code:addons/base/res/res_user.py:293 |
348 | #, python-format |
349 | @@ -56995,6 +57037,16 @@ |
350 | msgid "Add all Journals" |
351 | msgstr "Ajouter tous les Journaux" |
352 | |
353 | +#. module: account_mcdb |
354 | +#: view:account.mcdb:0 |
355 | +msgid "Add all Partners" |
356 | +msgstr "Ajouter tous les Partenaires" |
357 | + |
358 | +#. module: account_mcdb |
359 | +#: view:account.mcdb:0 |
360 | +msgid "Add all Employees" |
361 | +msgstr "Ajouter tous les Employés" |
362 | + |
363 | #. modules: msf_order_date, purchase, purchase_override, sale |
364 | #: field:update.lines,stock_take_date:0 |
365 | #: field:purchase.order,stock_take_date:0 |
366 | @@ -69838,6 +69890,7 @@ |
367 | #: model:ir.ui.menu,name:account.menu_journals |
368 | #: model:ir.ui.menu,name:account.menu_journals_report |
369 | #: view:account.mcdb:0 |
370 | +#: field:account.mcdb,transfer_journal_ids:0 |
371 | #: report:addons/finance/report/account_partner_balance_tree_xls.mako:314 |
372 | #: report:account.general.ledger_landscape_tb:0 |
373 | #: field:wizard.account.partner.balance.tree,journal_ids:0 |
374 | @@ -95997,7 +96050,7 @@ |
375 | msgid "SQL Constraint" |
376 | msgstr "Contrainte SQL" |
377 | |
378 | -#. modules: hr, base, msf_homere_interface |
379 | +#. modules: hr, base, msf_homere_interface, account_mcdb |
380 | #: model:ir.actions.act_window,name:base.action_partner_employee_form |
381 | #: view:hr.employee:0 |
382 | #: field:hr.job,employee_ids:0 |
383 | @@ -96007,6 +96060,8 @@ |
384 | #: model:ir.ui.menu,name:hr.menu_open_view_employee_list_my |
385 | #: model:ir.ui.menu,name:hr.menu_view_employee_category_configuration_form |
386 | #: view:hr.employee:0 |
387 | +#: view:account.mcdb:0 |
388 | +#: field:account.mcdb,employee_ids:0 |
389 | msgid "Employees" |
390 | msgstr "Employé(e)s" |
391 | |
392 | |
393 | === modified file 'bin/addons/msf_profile/msf_profile.py' |
394 | --- bin/addons/msf_profile/msf_profile.py 2018-07-20 10:23:42 +0000 |
395 | +++ bin/addons/msf_profile/msf_profile.py 2018-08-08 07:43:14 +0000 |
396 | @@ -51,6 +51,44 @@ |
397 | 'model': lambda *a: 'patch.scripts', |
398 | } |
399 | |
400 | + # UF10.0 |
401 | + def us_3427_update_third_parties_in_gl_selector(self, cr, uid, *a, **b): |
402 | + """ |
403 | + Third Parties in G/L selector (partners / employees / journals) become many2many fields |
404 | + Updates the existing selectors accordingly |
405 | + (note: selectors aren't synched for now) |
406 | + """ |
407 | + selector_obj = self.pool.get('account.mcdb') |
408 | + selector_ids = selector_obj.search(cr, uid, [('model', '=', 'account.move.line')]) |
409 | + for selector in selector_obj.browse(cr, uid, selector_ids, |
410 | + fields_to_fetch=['partner_id', 'employee_id', 'transfer_journal_id']): |
411 | + partner_ids = employee_ids = transfer_journal_ids = [] |
412 | + display_partner = display_employee = display_transfer_journal = False |
413 | + if selector.partner_id: |
414 | + partner_ids = [selector.partner_id.id] |
415 | + display_partner = True |
416 | + if selector.employee_id: |
417 | + employee_ids = [selector.employee_id.id] |
418 | + display_employee = True |
419 | + if selector.transfer_journal_id: |
420 | + transfer_journal_ids = [selector.transfer_journal_id.id] |
421 | + display_transfer_journal = True |
422 | + vals = { |
423 | + # old fields not used anymore: to set to False in any cases |
424 | + 'partner_id': False, |
425 | + 'employee_id': False, |
426 | + 'transfer_journal_id': False, |
427 | + # new fields: to fill in if need be |
428 | + 'partner_ids': [(6, 0, partner_ids)], |
429 | + 'employee_ids': [(6, 0, employee_ids)], |
430 | + 'transfer_journal_ids': [(6, 0, transfer_journal_ids)], |
431 | + # 'display' boolean: to set to True to display the relative section by default in the selector |
432 | + 'display_partner': display_partner, |
433 | + 'display_employee': display_employee, |
434 | + 'display_transfer_journal': display_transfer_journal, |
435 | + } |
436 | + selector_obj.write(cr, uid, selector.id, vals) |
437 | + |
438 | # UF9.1 |
439 | def change_xml_payment_method(self, cr, uid, *a, **b): |
440 | user_obj = self.pool.get('res.users') |