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

Proposed by jftempo
Status: Merged
Merged at revision: 5454
Proposed branch: lp:~julie-w/unifield-server/US-5902
Merge into: lp:unifield-server
Diff against target: 194 lines (+113/-1)
7 files modified
bin/addons/msf_homere_interface/__openerp__.py (+1/-0)
bin/addons/msf_homere_interface/hr.py (+2/-0)
bin/addons/msf_homere_interface/hr_employee_activation_wizard.xml (+41/-0)
bin/addons/msf_homere_interface/wizard/__init__.py (+1/-0)
bin/addons/msf_homere_interface/wizard/hr_employee_activation.py (+52/-0)
bin/addons/msf_profile/i18n/fr_MF.po (+14/-1)
bin/addons/register_accounting/account.py (+2/-0)
To merge this branch: bzr merge lp:~julie-w/unifield-server/US-5902
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+370913@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/msf_homere_interface/__openerp__.py'
2--- bin/addons/msf_homere_interface/__openerp__.py 2018-10-31 15:29:09 +0000
3+++ bin/addons/msf_homere_interface/__openerp__.py 2019-08-02 15:10:27 +0000
4@@ -34,6 +34,7 @@
5 'hr_view.xml',
6 'hr_payroll_view.xml',
7 'hr_payroll_wizard.xml',
8+ 'hr_employee_activation_wizard.xml',
9 ],
10 "demo_xml" : [],
11 "test": [],
12
13=== modified file 'bin/addons/msf_homere_interface/hr.py'
14--- bin/addons/msf_homere_interface/hr.py 2019-04-08 14:33:50 +0000
15+++ bin/addons/msf_homere_interface/hr.py 2019-08-02 15:10:27 +0000
16@@ -256,6 +256,8 @@
17 """
18 if not ids:
19 return True
20+ elif isinstance(ids, (int, long)):
21+ ids = [ids]
22 # Some verifications
23 if not context:
24 context = {}
25
26=== added file 'bin/addons/msf_homere_interface/hr_employee_activation_wizard.xml'
27--- bin/addons/msf_homere_interface/hr_employee_activation_wizard.xml 1970-01-01 00:00:00 +0000
28+++ bin/addons/msf_homere_interface/hr_employee_activation_wizard.xml 2019-08-02 15:10:27 +0000
29@@ -0,0 +1,41 @@
30+<?xml version="1.0" encoding="UTF-8"?>
31+<openerp>
32+ <data>
33+
34+ <!-- Wizard -->
35+ <record id="employee_activation_view" model="ir.ui.view">
36+ <field name="name">Activate/Deactivate Employees</field>
37+ <field name="model">hr.employee.activation</field>
38+ <field name="type">form</field>
39+ <field name="arch" type="xml">
40+ <form string="Activate/Deactivate Employees">
41+ <field name="active_status"/>
42+ <button icon="gtk-cancel" string="Cancel" special="cancel"/>
43+ <button icon="terp-camera_test" string="Approve" name="change_employee_status" type="object" default_focus="1"/>
44+ </form>
45+ </field>
46+ </record>
47+
48+ <!-- Action in Menu -->
49+ <record id="employee_activation_action" model="ir.actions.act_window">
50+ <field name="name">Activate/Deactivate Employees</field>
51+ <field name="type">ir.actions.act_window</field>
52+ <field name="res_model">hr.employee.activation</field>
53+ <field name="view_type">form</field>
54+ <field name="view_mode">form</field>
55+ <field name="view_id" ref="employee_activation_view"/>
56+ <field name="target">new</field>
57+ </record>
58+ <record model="ir.values" id="employee_activation_values">
59+ <field name="model_id" ref="model_hr_employee" />
60+ <field name="object" eval="1" />
61+ <field name="name">Activate/Deactivate Employees</field>
62+ <field name="key2">client_action_multi</field>
63+ <field name="value" eval="'ir.actions.act_window,' + str(ref('employee_activation_action'))" />
64+ <field name="key">action</field>
65+ <field name="model">hr.employee</field>
66+ <field name="sequence" eval="105"/>
67+ </record>
68+
69+ </data>
70+</openerp>
71
72=== modified file 'bin/addons/msf_homere_interface/wizard/__init__.py'
73--- bin/addons/msf_homere_interface/wizard/__init__.py 2018-04-19 11:49:43 +0000
74+++ bin/addons/msf_homere_interface/wizard/__init__.py 2019-08-02 15:10:27 +0000
75@@ -29,5 +29,6 @@
76 import hr_expat_import
77 import hr_nat_staff_import
78 import hr_payment_order
79+import hr_employee_activation
80
81 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
82
83=== added file 'bin/addons/msf_homere_interface/wizard/hr_employee_activation.py'
84--- bin/addons/msf_homere_interface/wizard/hr_employee_activation.py 1970-01-01 00:00:00 +0000
85+++ bin/addons/msf_homere_interface/wizard/hr_employee_activation.py 2019-08-02 15:10:27 +0000
86@@ -0,0 +1,52 @@
87+# -*- coding: utf-8 -*-
88+##############################################################################
89+#
90+# OpenERP, Open Source Management Solution
91+# Copyright (C) 2019 MSF, TeMPO Consulting
92+#
93+# This program is free software: you can redistribute it and/or modify
94+# it under the terms of the GNU Affero General Public License as
95+# published by the Free Software Foundation, either version 3 of the
96+# License, or (at your option) any later version.
97+#
98+# This program is distributed in the hope that it will be useful,
99+# but WITHOUT ANY WARRANTY; without even the implied warranty of
100+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
101+# GNU Affero General Public License for more details.
102+#
103+# You should have received a copy of the GNU Affero General Public License
104+# along with this program. If not, see <http://www.gnu.org/licenses/>.
105+#
106+##############################################################################
107+
108+from osv import fields, osv
109+
110+
111+class hr_employee_activation(osv.osv_memory):
112+ _name = 'hr.employee.activation'
113+
114+ _columns = {
115+ 'active_status': fields.boolean('Set selected employees as active'),
116+ }
117+
118+ _defaults = {
119+ 'active_status': True,
120+ }
121+
122+ def change_employee_status(self, cr, uid, ids, context=None):
123+ """
124+ Sets the selected employees to active or inactive
125+ """
126+ if context is None:
127+ context = {}
128+ if isinstance(ids, (int, long)):
129+ ids = [ids]
130+ employee_obj = self.pool.get('hr.employee')
131+ data = self.read(cr, uid, ids, ['active_status'], context=context)[0]
132+ for employee_id in context.get('active_ids', []):
133+ employee_obj.write(cr, uid, employee_id, {'active': data['active_status']}, context=context)
134+ return {'type': 'ir.actions.act_window_close'}
135+
136+
137+hr_employee_activation()
138+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
139
140=== modified file 'bin/addons/msf_profile/i18n/fr_MF.po'
141--- bin/addons/msf_profile/i18n/fr_MF.po 2019-07-31 14:57:17 +0000
142+++ bin/addons/msf_profile/i18n/fr_MF.po 2019-08-02 15:10:27 +0000
143@@ -40334,7 +40334,7 @@
144 msgid "Document date"
145 msgstr "Date du document"
146
147-#. modules: msf_budget, res_currency_functional, account, register_accounting, finance
148+#. modules: msf_budget, res_currency_functional, account, register_accounting, finance, msf_homere_interface
149 #: view:account.invoice:0
150 #: view:account.move:0
151 #: view:validate.account.move:0
152@@ -40343,6 +40343,7 @@
153 #: view:msf.budget:0
154 #: view:account.invoice:0
155 #: view:activate.currencies:0
156+#: view:hr.employee.activation:0
157 msgid "Approve"
158 msgstr "Approuver"
159
160@@ -98178,6 +98179,7 @@
161 #: view:wizard.pick.import:0
162 #: code:addons/msf_doc_import/purchase_order.py:60
163 #: view:wizard.import.product.line:0
164+#: view:hr.employee.activation:0
165 #: selection:export.report.stock.move,state:0
166 #, python-format
167 msgid "Cancel"
168@@ -107760,3 +107762,14 @@
169 #: view:account.invoice:0
170 msgid "This invoice will sync to its counterpart instance."
171 msgstr "Cette facture sera synchronisée à l'instance de Contrepartie."
172+
173+#. module: msf_homere_interface
174+#: view:hr.employee.activation:0
175+#: model:ir.actions.act_window,name:msf_homere_interface.employee_activation_action
176+msgid "Activate/Deactivate Employees"
177+msgstr "Activer / Désactiver les Employés"
178+
179+#. module: msf_homere_interface
180+#: field:hr.employee.activation,active_status:0
181+msgid "Set selected employees as active"
182+msgstr "Marquer les employés sélectionnés comme actifs"
183
184=== modified file 'bin/addons/register_accounting/account.py'
185--- bin/addons/register_accounting/account.py 2016-08-18 08:32:03 +0000
186+++ bin/addons/register_accounting/account.py 2019-08-02 15:10:27 +0000
187@@ -67,6 +67,8 @@
188 def write(self, cr, uid, ids, vals, context=None):
189 if not ids:
190 return True
191+ elif isinstance(ids, (int, long)):
192+ ids = [ids]
193 if context is None:
194 context = {}
195

Subscribers

People subscribed via source and target branches