Merge lp:~vauxoo/addons-vauxoo/7.0-purchase_requisition_department-dev-1551-kty into lp:addons-vauxoo/7.0

Proposed by Katherine Zaoral (Vauxoo)
Status: Merged
Merged at revision: 1044
Proposed branch: lp:~vauxoo/addons-vauxoo/7.0-purchase_requisition_department-dev-1551-kty
Merge into: lp:addons-vauxoo/7.0
Diff against target: 354 lines (+296/-0)
7 files modified
purchase_requisition_department/__init__.py (+27/-0)
purchase_requisition_department/__openerp__.py (+54/-0)
purchase_requisition_department/i18n/purchase_requisition_department.pot (+33/-0)
purchase_requisition_department/model/__init__.py (+26/-0)
purchase_requisition_department/model/purchase_requisition.py (+86/-0)
purchase_requisition_department/view/purchase_requisition_view.xml (+45/-0)
purchase_requisition_department/wizard/__init__.py (+25/-0)
To merge this branch: bzr merge lp:~vauxoo/addons-vauxoo/7.0-purchase_requisition_department-dev-1551-kty
Reviewer Review Type Date Requested Status
Katherine Zaoral (Vauxoo) Approve
Review via email: mp+222406@code.launchpad.net

Description of the change

[MERGE] add new module name purchase_requisition_department.

To post a comment you must log in.
Revision history for this message
Katherine Zaoral (Vauxoo) (kathy-zaoral) wrote :

waiting for runbot

Revision history for this message
Katherine Zaoral (Vauxoo) (kathy-zaoral) wrote :

runbot green. I will procedure with the merge.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'purchase_requisition_department'
2=== added file 'purchase_requisition_department/__init__.py'
3--- purchase_requisition_department/__init__.py 1970-01-01 00:00:00 +0000
4+++ purchase_requisition_department/__init__.py 2014-06-06 21:05:57 +0000
5@@ -0,0 +1,27 @@
6+#!/usr/bin/python
7+# -*- encoding: utf-8 -*-
8+###############################################################################
9+# Module Writen to OpenERP, Open Source Management Solution
10+# Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>).
11+# All Rights Reserved
12+############# Credits #########################################################
13+# Coded by: Katherine Zaoral <kathy@vauxoo.com>
14+# Planified by: Humberto Arocha <hbto@vauxoo.com>
15+# Audited by: Humberto Arocha <hbto@vauxoo.com>
16+###############################################################################
17+# This program is free software: you can redistribute it and/or modify
18+# it under the terms of the GNU Affero General Public License as published
19+# by the Free Software Foundation, either version 3 of the License, or
20+# (at your option) any later version.
21+#
22+# This program is distributed in the hope that it will be useful,
23+# but WITHOUT ANY WARRANTY; without even the implied warranty of
24+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25+# GNU Affero General Public License for more details.
26+#
27+# You should have received a copy of the GNU Affero General Public License
28+# along with this program. If not, see <http://www.gnu.org/licenses/>.
29+###############################################################################
30+
31+import model
32+import wizard
33
34=== added file 'purchase_requisition_department/__openerp__.py'
35--- purchase_requisition_department/__openerp__.py 1970-01-01 00:00:00 +0000
36+++ purchase_requisition_department/__openerp__.py 2014-06-06 21:05:57 +0000
37@@ -0,0 +1,54 @@
38+#!/usr/bin/python
39+# -*- encoding: utf-8 -*-
40+###############################################################################
41+# Module Writen to OpenERP, Open Source Management Solution
42+# Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>).
43+# All Rights Reserved
44+############# Credits #########################################################
45+# Coded by: Katherine Zaoral <kathy@vauxoo.com>
46+# Planified by: Humberto Arocha <hbto@vauxoo.com>
47+# Audited by: Humberto Arocha <hbto@vauxoo.com>
48+###############################################################################
49+# This program is free software: you can redistribute it and/or modify
50+# it under the terms of the GNU Affero General Public License as published
51+# by the Free Software Foundation, either version 3 of the License, or
52+# (at your option) any later version.
53+#
54+# This program is distributed in the hope that it will be useful,
55+# but WITHOUT ANY WARRANTY; without even the implied warranty of
56+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
57+# GNU Affero General Public License for more details.
58+#
59+# You should have received a copy of the GNU Affero General Public License
60+# along with this program. If not, see <http://www.gnu.org/licenses/>.
61+###############################################################################
62+
63+{
64+ 'name': 'Purchase Requisition Department',
65+ 'version': '1.0',
66+ 'author': 'Vauxoo',
67+ 'website': 'http://www.vauxoo.com/',
68+ 'category': 'purchase',
69+ 'description': '''
70+Purchase Requisition Department
71+===============================
72+
73+Add the department field relational field to deparment_id extract for the
74+current purchase requisition responsible. Also add the filter ins the purchase
75+requisition list view to discriminate the purchase requisition by department.
76+''',
77+ 'depends': [
78+ 'purchase_requisition',
79+ 'hr',
80+ ],
81+ 'data': [
82+ 'view/purchase_requisition_view.xml',
83+ ],
84+ 'demo': [],
85+ 'test': [],
86+ 'qweb': [],
87+ 'js': [],
88+ 'css': [],
89+ 'active': False,
90+ 'installable': True,
91+}
92
93=== added directory 'purchase_requisition_department/data'
94=== added directory 'purchase_requisition_department/demo'
95=== added directory 'purchase_requisition_department/doc'
96=== added directory 'purchase_requisition_department/doc/images'
97=== added directory 'purchase_requisition_department/i18n'
98=== added file 'purchase_requisition_department/i18n/purchase_requisition_department.pot'
99--- purchase_requisition_department/i18n/purchase_requisition_department.pot 1970-01-01 00:00:00 +0000
100+++ purchase_requisition_department/i18n/purchase_requisition_department.pot 2014-06-06 21:05:57 +0000
101@@ -0,0 +1,33 @@
102+# Translation of OpenERP Server.
103+# This file contains the translation of the following modules:
104+# * purchase_requisition_department
105+#
106+msgid ""
107+msgstr ""
108+"Project-Id-Version: OpenERP Server 7.0\n"
109+"Report-Msgid-Bugs-To: \n"
110+"POT-Creation-Date: 2014-06-06 20:44+0000\n"
111+"PO-Revision-Date: 2014-06-06 20:44+0000\n"
112+"Last-Translator: <>\n"
113+"Language-Team: \n"
114+"MIME-Version: 1.0\n"
115+"Content-Type: text/plain; charset=UTF-8\n"
116+"Content-Transfer-Encoding: \n"
117+"Plural-Forms: \n"
118+
119+#. module: purchase_requisition_department
120+#: view:purchase.requisition:0
121+#: field:purchase.requisition,department_id:0
122+msgid "Department"
123+msgstr ""
124+
125+#. module: purchase_requisition_department
126+#: model:ir.model,name:purchase_requisition_department.model_purchase_requisition
127+msgid "Purchase Requisition"
128+msgstr ""
129+
130+#. module: purchase_requisition_department
131+#: help:purchase.requisition,department_id:0
132+msgid "The department where this purchase requisition belongs"
133+msgstr ""
134+
135
136=== added directory 'purchase_requisition_department/model'
137=== added file 'purchase_requisition_department/model/__init__.py'
138--- purchase_requisition_department/model/__init__.py 1970-01-01 00:00:00 +0000
139+++ purchase_requisition_department/model/__init__.py 2014-06-06 21:05:57 +0000
140@@ -0,0 +1,26 @@
141+#!/usr/bin/python
142+# -*- encoding: utf-8 -*-
143+###############################################################################
144+# Module Writen to OpenERP, Open Source Management Solution
145+# Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>).
146+# All Rights Reserved
147+############# Credits #########################################################
148+# Coded by: Katherine Zaoral <kathy@vauxoo.com>
149+# Planified by: Humberto Arocha <hbto@vauxoo.com>
150+# Audited by: Humberto Arocha <hbto@vauxoo.com>
151+###############################################################################
152+# This program is free software: you can redistribute it and/or modify
153+# it under the terms of the GNU Affero General Public License as published
154+# by the Free Software Foundation, either version 3 of the License, or
155+# (at your option) any later version.
156+#
157+# This program is distributed in the hope that it will be useful,
158+# but WITHOUT ANY WARRANTY; without even the implied warranty of
159+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
160+# GNU Affero General Public License for more details.
161+#
162+# You should have received a copy of the GNU Affero General Public License
163+# along with this program. If not, see <http://www.gnu.org/licenses/>.
164+###############################################################################
165+
166+import purchase_requisition
167
168=== added file 'purchase_requisition_department/model/purchase_requisition.py'
169--- purchase_requisition_department/model/purchase_requisition.py 1970-01-01 00:00:00 +0000
170+++ purchase_requisition_department/model/purchase_requisition.py 2014-06-06 21:05:57 +0000
171@@ -0,0 +1,86 @@
172+#!/usr/bin/python
173+# -*- encoding: utf-8 -*-
174+###############################################################################
175+# Module Writen to OpenERP, Open Source Management Solution
176+# Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>).
177+# All Rights Reserved
178+############# Credits #########################################################
179+# Coded by: Katherine Zaoral <kathy@vauxoo.com>
180+# Planified by: Humberto Arocha <hbto@vauxoo.com>
181+# Audited by: Humberto Arocha <hbto@vauxoo.com>
182+###############################################################################
183+# This program is free software: you can redistribute it and/or modify
184+# it under the terms of the GNU Affero General Public License as published
185+# by the Free Software Foundation, either version 3 of the License, or
186+# (at your option) any later version.
187+#
188+# This program is distributed in the hope that it will be useful,
189+# but WITHOUT ANY WARRANTY; without even the implied warranty of
190+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
191+# GNU Affero General Public License for more details.
192+#
193+# You should have received a copy of the GNU Affero General Public License
194+# along with this program. If not, see <http://www.gnu.org/licenses/>.
195+###############################################################################
196+
197+from openerp.osv import fields, osv, orm
198+from openerp.tools.translate import _
199+from openerp import tools
200+
201+class purchase_requisition(osv.Model):
202+
203+ _inherit = 'purchase.requisition'
204+ _columns = {
205+ 'department_id': fields.many2one(
206+ 'hr.department',
207+ string='Department',
208+ help='The department where this purchase requisition belongs'),
209+ }
210+
211+ _defaults = {
212+ 'department_id': lambda self, cur, uid, cxt: self.pool.get('res.users').browse(cur, uid, uid, cxt).employee_ids[0].department_id.id,
213+ }
214+
215+ #def fields_view_get(self, cr, uid, view_id=None, view_type='form',
216+ # context=None, toolbar=False, submenu=False):
217+ # """
218+ # Filter the department by the ones the current user belongs.
219+ # """
220+ # context = context or {}
221+ # res = super(purchase_requisition,self).fields_view_get(
222+ # cr, uid, view_id=view_id, view_type=view_type, context=context,
223+ # toolbar=toolbar, submenu=submenu)
224+
225+ # user_obj = self.pool.get('res.users')
226+ # user_brw = user_obj.browse(cr, uid, uid, context=context)
227+ # if 'department_id' in res['fields'].keys():
228+ # dep_ids = [emp_brw.department_id.id for emp_brw in user_brw.employee_ids]
229+ # res['fields']['department_id']['domain'] = [('id', 'in', dep_ids)]
230+ # return res
231+
232+ # TODO: This filter method is not working.
233+ #def fields_view_get(self, cr, uid, view_id=None, view_type='form',
234+ # context=None, toolbar=False, submenu=False):
235+ # """
236+ # Filter the department by the ones the user_id.employee_ids belongs.
237+ # """
238+ # context = context or {}
239+ # res = super(purchase_requisition,self).fields_view_get(
240+ # cr, uid, view_id=view_id, view_type=view_type, context=context,
241+ # toolbar=toolbar, submenu=submenu)
242+
243+ # user_id = res['fields']['user_id'].get('selection', False) or uid
244+ # user_obj = self.pool.get('res.users')
245+ # emp_obj = self.pool.get('hr.employee')
246+ # dep_obj = self.pool.get('hr.department')
247+ # user_brw = user_obj.browse(cr, uid, user_id, context=context)
248+ # if 'department_id' in res['fields'].keys():
249+ # emp_ids = [emp_brw.id for emp_brw in user_brw.employee_ids]
250+ # dep_ids = [emp_brw.department_id.id for emp_brw in user_brw.employee_ids]
251+ # dep_selected = dep_obj._name_search(cr, uid, '', [('member_ids', 'in',
252+ # emp_ids)], context=context, limit=None, name_get_uid=1)
253+ # res['fields']['department_id']['selection'] = dep_selected
254+ # res['fields']['department_id']['domain'] = [('id', 'in', dep_ids)]
255+
256+ # return res
257+
258
259=== added directory 'purchase_requisition_department/report'
260=== added directory 'purchase_requisition_department/security'
261=== added directory 'purchase_requisition_department/static'
262=== added directory 'purchase_requisition_department/static/description'
263=== added file 'purchase_requisition_department/static/description/index.html'
264=== added directory 'purchase_requisition_department/static/src'
265=== added directory 'purchase_requisition_department/static/src/css'
266=== added directory 'purchase_requisition_department/static/src/img'
267=== added file 'purchase_requisition_department/static/src/img/icon.png'
268Binary files purchase_requisition_department/static/src/img/icon.png 1970-01-01 00:00:00 +0000 and purchase_requisition_department/static/src/img/icon.png 2014-06-06 21:05:57 +0000 differ
269=== added directory 'purchase_requisition_department/static/src/js'
270=== added directory 'purchase_requisition_department/static/src/xml'
271=== added directory 'purchase_requisition_department/test'
272=== added directory 'purchase_requisition_department/view'
273=== added file 'purchase_requisition_department/view/purchase_requisition_view.xml'
274--- purchase_requisition_department/view/purchase_requisition_view.xml 1970-01-01 00:00:00 +0000
275+++ purchase_requisition_department/view/purchase_requisition_view.xml 2014-06-06 21:05:57 +0000
276@@ -0,0 +1,45 @@
277+<?xml version="1.0"?>
278+<openerp>
279+ <data>
280+
281+ <record id="purchase_requisition_department_form" model="ir.ui.view">
282+ <field name="name">purchase.requisition.department.form</field>
283+ <field name="model">purchase.requisition</field>
284+ <field name="inherit_id" ref="purchase_requisition.view_purchase_requisition_form"/>
285+ <field name="arch" type="xml">
286+ <xpath expr="//field[@name='user_id']" position="after">
287+ <field name="department_id"/>
288+ </xpath>
289+ </field>
290+ </record>
291+
292+ <record id="purchase_requisition_department_tree" model="ir.ui.view">
293+ <field name="name">purchase.requisition.department.tree</field>
294+ <field name="model">purchase.requisition</field>
295+ <field name="inherit_id" ref="purchase_requisition.view_purchase_requisition_tree"/>
296+ <field name="arch" type="xml">
297+ <xpath expr="//field[@name='user_id']" position="before">
298+ <field name="department_id" invisible="1"/>
299+ </xpath>
300+ </field>
301+ </record>
302+
303+ <record id="purchase_requisition_department_search" model="ir.ui.view">
304+ <field name="name">purchase.requisition.department.search</field>
305+ <field name="model">purchase.requisition</field>
306+ <field name="inherit_id" ref="purchase_requisition.view_purchase_requisition_filter"/>
307+ <field name="arch" type="xml">
308+
309+ <xpath expr="//field[@name='exclusive']" position="after">
310+ <field name="department_id"/>
311+ </xpath>
312+
313+ <xpath expr="//group" position="inside">
314+ <filter string="Department" icon="terp-personal" context="{'group_by':'department_id'}"/>
315+ </xpath>
316+
317+ </field>
318+ </record>
319+
320+ </data>
321+</openerp>
322
323=== added directory 'purchase_requisition_department/wizard'
324=== added file 'purchase_requisition_department/wizard/__init__.py'
325--- purchase_requisition_department/wizard/__init__.py 1970-01-01 00:00:00 +0000
326+++ purchase_requisition_department/wizard/__init__.py 2014-06-06 21:05:57 +0000
327@@ -0,0 +1,25 @@
328+#!/usr/bin/python
329+# -*- encoding: utf-8 -*-
330+###############################################################################
331+# Module Writen to OpenERP, Open Source Management Solution
332+# Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>).
333+# All Rights Reserved
334+############# Credits #########################################################
335+# Coded by: Katherine Zaoral <kathy@vauxoo.com>
336+# Planified by: Humberto Arocha <hbto@vauxoo.com>
337+# Audited by: Humberto Arocha <hbto@vauxoo.com>
338+###############################################################################
339+# This program is free software: you can redistribute it and/or modify
340+# it under the terms of the GNU Affero General Public License as published
341+# by the Free Software Foundation, either version 3 of the License, or
342+# (at your option) any later version.
343+#
344+# This program is distributed in the hope that it will be useful,
345+# but WITHOUT ANY WARRANTY; without even the implied warranty of
346+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
347+# GNU Affero General Public License for more details.
348+#
349+# You should have received a copy of the GNU Affero General Public License
350+# along with this program. If not, see <http://www.gnu.org/licenses/>.
351+###############################################################################
352+
353
354=== added directory 'purchase_requisition_department/workflow'