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
1=== modified file 'bin/addons/account_mcdb/account_mcdb.py'
2--- bin/addons/account_mcdb/account_mcdb.py 2019-07-12 14:19:43 +0000
3+++ bin/addons/account_mcdb/account_mcdb.py 2019-09-27 12:27:07 +0000
4@@ -162,6 +162,26 @@
5
6 _order = 'user, description, id'
7
8+ def search(self, cr, uid, dom, *a, **b):
9+ """
10+ Ignores the filter on "Active Users" once a specific user has been selected
11+ """
12+ new_dom = []
13+ active_user_dom = []
14+ user_filter = False
15+ for x in dom:
16+ if x[0] == 'user.active':
17+ active_user_dom = x
18+ elif x[0] == 'user':
19+ user_filter = True
20+ new_dom.append(x)
21+ else:
22+ new_dom.append(x)
23+ if not user_filter and active_user_dom:
24+ new_dom.append(active_user_dom)
25+
26+ return super(account_mcdb, self).search(cr, uid, new_dom, *a, **b)
27+
28 def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
29 if context is None:
30 context = {}
31@@ -1491,4 +1511,27 @@
32 return {'type': 'ir.actions.act_window_close', 'context': context}
33
34 account_mcdb()
35+
36+
37+class res_users(osv.osv):
38+ _inherit = 'res.users'
39+ _name = 'res.users'
40+
41+ def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
42+ """
43+ For Search Views: in case "user_with_active_filter" is set in context, displays a Search View with a filter to
44+ select/de-select active users
45+ """
46+ if context is None:
47+ context = {}
48+ model_data_obj = self.pool.get('ir.model.data')
49+ if view_type == 'search' and context.get('user_with_active_filter'):
50+ view_id = model_data_obj.get_object_reference(cr, uid, 'account_mcdb', 'user_search_with_active_filter')
51+ view_id = view_id and view_id[1] or False
52+ res = super(res_users, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context,
53+ toolbar=toolbar, submenu=submenu)
54+ return res
55+
56+
57+res_users()
58 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
59
60=== modified file 'bin/addons/account_mcdb/account_mcdb_view.xml'
61--- bin/addons/account_mcdb/account_mcdb_view.xml 2019-07-12 13:17:02 +0000
62+++ bin/addons/account_mcdb/account_mcdb_view.xml 2019-09-27 12:27:07 +0000
63@@ -364,6 +364,24 @@
64 </record>
65
66 <!-- Search view -->
67+ <!-- related User Search View -->
68+ <record id="user_search_with_active_filter" model="ir.ui.view">
69+ <field name="name">user.search.with.active.filter</field>
70+ <field name="model">res.users</field>
71+ <field name="type">search</field>
72+ <field name="priority" eval="105" />
73+ <field name="arch" type="xml">
74+ <search>
75+ <filter name="user_active" icon="terp-check" string="Active" domain="[('active', '=', True)]" />
76+ <newline/>
77+ <field name="name"/>
78+ <field name="login"/>
79+ <field name="address_id"/>
80+ <field name="synchronize"/>
81+ </search>
82+ </field>
83+ </record>
84+
85 <record id="account_mcdb_search" model="ir.ui.view">
86 <field name="name">account.mcdb.search</field>
87 <field name="model">account.mcdb</field>
88@@ -371,8 +389,12 @@
89 <field name="priority" eval="17"/>
90 <field name="arch" type="xml">
91 <search string="Selector">
92+ <filter name="user_active" icon="terp-check" string="Active Users" domain="[('user.active', '=', True)]" />
93+ <newline/>
94 <field name="description" select="1"/>
95- <field name="user" select="1"/>
96+ <field name="user" select="1" domain="[('active', 'in', ['t', 'f'])]"
97+ context="{'user_with_active_filter': True,
98+ 'search_default_user_active': True}"/>
99 <field name="hq_template" />
100 </search>
101 </field>
102
103=== modified file 'bin/addons/account_mcdb/mcdb_view_general.xml'
104--- bin/addons/account_mcdb/mcdb_view_general.xml 2018-11-07 16:25:55 +0000
105+++ bin/addons/account_mcdb/mcdb_view_general.xml 2019-09-27 12:27:07 +0000
106@@ -4,7 +4,9 @@
107 <field name="display_mcdb_load_button" invisible="1" />
108 <field name="template" on_change="onchange_template()" string="Select an existing template"
109 domain="[('description', '!=', False), ('description', '!=', ''),
110- ('model', '=', context.get('from', 'account.move.line'))]"/>
111+ ('model', '=', context.get('from', 'account.move.line'))]"
112+ context="{'search_default_user_active': 1}"
113+ />
114 <button icon="gtk-save" name="load_mcdb_template" string="Load" type="object"
115 attrs="{'invisible': [('display_mcdb_load_button', '=', False)]}" />
116 <button icon="gtk-edit" name="edit_mcdb_template" string="Replace" type="object"
117
118=== modified file 'bin/addons/msf_profile/i18n/fr_MF.po'
119--- bin/addons/msf_profile/i18n/fr_MF.po 2019-09-27 12:22:32 +0000
120+++ bin/addons/msf_profile/i18n/fr_MF.po 2019-09-27 12:27:07 +0000
121@@ -72250,7 +72250,7 @@
122 msgid "Navajo"
123 msgstr "Navajo"
124
125-#. 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
126+#. 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
127 #: field:account.account,active:0
128 #: field:account.analytic.journal,active:0
129 #: field:account.journal.period,active:0
130@@ -72315,6 +72315,7 @@
131 #: field:account.period,active:0
132 #: report:addons/kit/report/kit_mass_import_export_xls.mako:114
133 #: view:msf.instance:0
134+#: view:res.users:0
135 #: field:automated.export,active:0
136 #: field:product.heat_sensitive,active:0
137 #: field:sync.client.message_rule,active:0
138@@ -107379,6 +107380,11 @@
139 msgid "Functional total cost :"
140 msgstr "Total Coût Fonctionnel :"
141
142+#. module: account_mcdb
143+#: view:account.mcdb:0
144+msgid "Active Users"
145+msgstr "Utilisateurs Actifs"
146+
147 #. module: account_period_closing_level
148 #: code:addons/account_period_closing_level/account_period.py:203
149 #, python-format

Subscribers

People subscribed via source and target branches