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

Proposed by jftempo
Status: Merged
Merged at revision: 5509
Proposed branch: lp:~julie-w/unifield-server/US-5951
Merge into: lp:unifield-server
Diff against target: 149 lines (+76/-3)
4 files modified
bin/addons/account_mcdb/account_mcdb.py (+43/-0)
bin/addons/account_mcdb/account_mcdb_view.xml (+23/-1)
bin/addons/account_mcdb/mcdb_view_general.xml (+3/-1)
bin/addons/msf_profile/i18n/fr_MF.po (+7/-1)
To merge this branch: bzr merge lp:~julie-w/unifield-server/US-5951
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+373317@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'bin/addons/account_mcdb/account_mcdb.py'
--- bin/addons/account_mcdb/account_mcdb.py 2019-07-12 14:19:43 +0000
+++ bin/addons/account_mcdb/account_mcdb.py 2019-09-27 12:27:07 +0000
@@ -162,6 +162,26 @@
162162
163 _order = 'user, description, id'163 _order = 'user, description, id'
164164
165 def search(self, cr, uid, dom, *a, **b):
166 """
167 Ignores the filter on "Active Users" once a specific user has been selected
168 """
169 new_dom = []
170 active_user_dom = []
171 user_filter = False
172 for x in dom:
173 if x[0] == 'user.active':
174 active_user_dom = x
175 elif x[0] == 'user':
176 user_filter = True
177 new_dom.append(x)
178 else:
179 new_dom.append(x)
180 if not user_filter and active_user_dom:
181 new_dom.append(active_user_dom)
182
183 return super(account_mcdb, self).search(cr, uid, new_dom, *a, **b)
184
165 def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):185 def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
166 if context is None:186 if context is None:
167 context = {}187 context = {}
@@ -1491,4 +1511,27 @@
1491 return {'type': 'ir.actions.act_window_close', 'context': context}1511 return {'type': 'ir.actions.act_window_close', 'context': context}
14921512
1493account_mcdb()1513account_mcdb()
1514
1515
1516class res_users(osv.osv):
1517 _inherit = 'res.users'
1518 _name = 'res.users'
1519
1520 def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
1521 """
1522 For Search Views: in case "user_with_active_filter" is set in context, displays a Search View with a filter to
1523 select/de-select active users
1524 """
1525 if context is None:
1526 context = {}
1527 model_data_obj = self.pool.get('ir.model.data')
1528 if view_type == 'search' and context.get('user_with_active_filter'):
1529 view_id = model_data_obj.get_object_reference(cr, uid, 'account_mcdb', 'user_search_with_active_filter')
1530 view_id = view_id and view_id[1] or False
1531 res = super(res_users, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context,
1532 toolbar=toolbar, submenu=submenu)
1533 return res
1534
1535
1536res_users()
1494# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:1537# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
14951538
=== modified file 'bin/addons/account_mcdb/account_mcdb_view.xml'
--- bin/addons/account_mcdb/account_mcdb_view.xml 2019-07-12 13:17:02 +0000
+++ bin/addons/account_mcdb/account_mcdb_view.xml 2019-09-27 12:27:07 +0000
@@ -364,6 +364,24 @@
364 </record>364 </record>
365365
366 <!-- Search view -->366 <!-- Search view -->
367 <!-- related User Search View -->
368 <record id="user_search_with_active_filter" model="ir.ui.view">
369 <field name="name">user.search.with.active.filter</field>
370 <field name="model">res.users</field>
371 <field name="type">search</field>
372 <field name="priority" eval="105" />
373 <field name="arch" type="xml">
374 <search>
375 <filter name="user_active" icon="terp-check" string="Active" domain="[('active', '=', True)]" />
376 <newline/>
377 <field name="name"/>
378 <field name="login"/>
379 <field name="address_id"/>
380 <field name="synchronize"/>
381 </search>
382 </field>
383 </record>
384
367 <record id="account_mcdb_search" model="ir.ui.view">385 <record id="account_mcdb_search" model="ir.ui.view">
368 <field name="name">account.mcdb.search</field>386 <field name="name">account.mcdb.search</field>
369 <field name="model">account.mcdb</field>387 <field name="model">account.mcdb</field>
@@ -371,8 +389,12 @@
371 <field name="priority" eval="17"/>389 <field name="priority" eval="17"/>
372 <field name="arch" type="xml">390 <field name="arch" type="xml">
373 <search string="Selector">391 <search string="Selector">
392 <filter name="user_active" icon="terp-check" string="Active Users" domain="[('user.active', '=', True)]" />
393 <newline/>
374 <field name="description" select="1"/>394 <field name="description" select="1"/>
375 <field name="user" select="1"/>395 <field name="user" select="1" domain="[('active', 'in', ['t', 'f'])]"
396 context="{'user_with_active_filter': True,
397 'search_default_user_active': True}"/>
376 <field name="hq_template" />398 <field name="hq_template" />
377 </search>399 </search>
378 </field>400 </field>
379401
=== modified file 'bin/addons/account_mcdb/mcdb_view_general.xml'
--- bin/addons/account_mcdb/mcdb_view_general.xml 2018-11-07 16:25:55 +0000
+++ bin/addons/account_mcdb/mcdb_view_general.xml 2019-09-27 12:27:07 +0000
@@ -4,7 +4,9 @@
4 <field name="display_mcdb_load_button" invisible="1" />4 <field name="display_mcdb_load_button" invisible="1" />
5 <field name="template" on_change="onchange_template()" string="Select an existing template"5 <field name="template" on_change="onchange_template()" string="Select an existing template"
6 domain="[('description', '!=', False), ('description', '!=', ''),6 domain="[('description', '!=', False), ('description', '!=', ''),
7 ('model', '=', context.get('from', 'account.move.line'))]"/>7 ('model', '=', context.get('from', 'account.move.line'))]"
8 context="{'search_default_user_active': 1}"
9 />
8 <button icon="gtk-save" name="load_mcdb_template" string="Load" type="object"10 <button icon="gtk-save" name="load_mcdb_template" string="Load" type="object"
9 attrs="{'invisible': [('display_mcdb_load_button', '=', False)]}" />11 attrs="{'invisible': [('display_mcdb_load_button', '=', False)]}" />
10 <button icon="gtk-edit" name="edit_mcdb_template" string="Replace" type="object"12 <button icon="gtk-edit" name="edit_mcdb_template" string="Replace" type="object"
1113
=== modified file 'bin/addons/msf_profile/i18n/fr_MF.po'
--- bin/addons/msf_profile/i18n/fr_MF.po 2019-09-27 12:22:32 +0000
+++ bin/addons/msf_profile/i18n/fr_MF.po 2019-09-27 12:27:07 +0000
@@ -72250,7 +72250,7 @@
72250msgid "Navajo"72250msgid "Navajo"
72251msgstr "Navajo"72251msgstr "Navajo"
7225272252
72253#. modules: product_nomenclature, process, financing_contract, mission_stock, procurement_cycle, sync_client, supplier_catalogue, analytic_distribution, product, finance, hr, msf_instance, kit, base, msf_tools, res_currency_functional, procurement_report, threshold_value, purchase, account, resource, msf_partner, procurement_auto, msf_field_access_rights, sale, procurement, msf_button_access_rights, stock, product_attributes, account_period_closing_level72253#. modules: product_nomenclature, process, financing_contract, mission_stock, procurement_cycle, sync_client, supplier_catalogue, analytic_distribution, product, finance, hr, msf_instance, kit, base, msf_tools, res_currency_functional, procurement_report, threshold_value, purchase, account, resource, msf_partner, procurement_auto, msf_field_access_rights, sale, procurement, msf_button_access_rights, stock, product_attributes, account_period_closing_level, account_mcdb
72254#: field:account.account,active:072254#: field:account.account,active:0
72255#: field:account.analytic.journal,active:072255#: field:account.analytic.journal,active:0
72256#: field:account.journal.period,active:072256#: field:account.journal.period,active:0
@@ -72315,6 +72315,7 @@
72315#: field:account.period,active:072315#: field:account.period,active:0
72316#: report:addons/kit/report/kit_mass_import_export_xls.mako:11472316#: report:addons/kit/report/kit_mass_import_export_xls.mako:114
72317#: view:msf.instance:072317#: view:msf.instance:0
72318#: view:res.users:0
72318#: field:automated.export,active:072319#: field:automated.export,active:0
72319#: field:product.heat_sensitive,active:072320#: field:product.heat_sensitive,active:0
72320#: field:sync.client.message_rule,active:072321#: field:sync.client.message_rule,active:0
@@ -107379,6 +107380,11 @@
107379msgid "Functional total cost :"107380msgid "Functional total cost :"
107380msgstr "Total Coût Fonctionnel :"107381msgstr "Total Coût Fonctionnel :"
107381107382
107383#. module: account_mcdb
107384#: view:account.mcdb:0
107385msgid "Active Users"
107386msgstr "Utilisateurs Actifs"
107387
107382#. module: account_period_closing_level107388#. module: account_period_closing_level
107383#: code:addons/account_period_closing_level/account_period.py:203107389#: code:addons/account_period_closing_level/account_period.py:203
107384#, python-format107390#, python-format

Subscribers

People subscribed via source and target branches