Merge lp:~vauxoo/addons-vauxoo/7.0-purchase_order_department-dev-1625-kty into lp:~vauxoo/addons-vauxoo/addons-vauxoo-cicsa

Proposed by Katherine Zaoral (Vauxoo)
Status: Merged
Merged at revision: 1058
Proposed branch: lp:~vauxoo/addons-vauxoo/7.0-purchase_order_department-dev-1625-kty
Merge into: lp:~vauxoo/addons-vauxoo/addons-vauxoo-cicsa
Diff against target: 334 lines (+276/-0)
7 files modified
purchase_order_department/__init__.py (+27/-0)
purchase_order_department/__openerp__.py (+59/-0)
purchase_order_department/i18n/purchase_order_department.pot (+38/-0)
purchase_order_department/model/__init__.py (+26/-0)
purchase_order_department/model/purchase_order.py (+53/-0)
purchase_order_department/view/purchase_order_view.xml (+48/-0)
purchase_order_department/wizard/__init__.py (+25/-0)
To merge this branch: bzr merge lp:~vauxoo/addons-vauxoo/7.0-purchase_order_department-dev-1625-kty
Reviewer Review Type Date Requested Status
Katherine Zaoral (Vauxoo) Approve
Review via email: mp+223652@code.launchpad.net

Description of the change

[MERGE] add new module purchase_order_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 is green.
I will proceed 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_order_department'
2=== added file 'purchase_order_department/__init__.py'
3--- purchase_order_department/__init__.py 1970-01-01 00:00:00 +0000
4+++ purchase_order_department/__init__.py 2014-06-18 21:55:16 +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_order_department/__openerp__.py'
35--- purchase_order_department/__openerp__.py 1970-01-01 00:00:00 +0000
36+++ purchase_order_department/__openerp__.py 2014-06-18 21:55:16 +0000
37@@ -0,0 +1,59 @@
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 Order Department',
65+ 'version': '1.0',
66+ 'author': 'Vauxoo',
67+ 'website': 'http://www.vauxoo.com/',
68+ 'category': 'purchase',
69+ 'description': '''
70+Purchase Order Department
71+=========================
72+
73+Add a department field to the purchase order model. This check the purchase
74+order requisitor (user) and fill the department field with the requisitor
75+employee info. Also add a search filter by text to search the department name
76+and a gruop by filter by department.
77+
78+Note: this module do not work propertly for users with multiple employees.
79+''',
80+
81+ 'depends': [
82+ 'purchase',
83+ 'hr',
84+ 'purchase_order_requisitor',
85+ ],
86+ 'data': [
87+ 'view/purchase_order_view.xml',
88+ ],
89+ 'demo': [],
90+ 'test': [],
91+ 'qweb': [],
92+ 'js': [],
93+ 'css': [],
94+ 'active': False,
95+ 'installable': True,
96+}
97
98=== added directory 'purchase_order_department/data'
99=== added directory 'purchase_order_department/demo'
100=== added directory 'purchase_order_department/doc'
101=== added directory 'purchase_order_department/doc/images'
102=== added directory 'purchase_order_department/i18n'
103=== added file 'purchase_order_department/i18n/purchase_order_department.pot'
104--- purchase_order_department/i18n/purchase_order_department.pot 1970-01-01 00:00:00 +0000
105+++ purchase_order_department/i18n/purchase_order_department.pot 2014-06-18 21:55:16 +0000
106@@ -0,0 +1,38 @@
107+# Translation of OpenERP Server.
108+# This file contains the translation of the following modules:
109+# * purchase_order_department
110+#
111+msgid ""
112+msgstr ""
113+"Project-Id-Version: OpenERP Server 7.0\n"
114+"Report-Msgid-Bugs-To: \n"
115+"POT-Creation-Date: 2014-06-18 21:28+0000\n"
116+"PO-Revision-Date: 2014-06-18 21:28+0000\n"
117+"Last-Translator: <>\n"
118+"Language-Team: \n"
119+"MIME-Version: 1.0\n"
120+"Content-Type: text/plain; charset=UTF-8\n"
121+"Content-Transfer-Encoding: \n"
122+"Plural-Forms: \n"
123+
124+#. module: purchase_order_department
125+#: view:purchase.order:0
126+#: field:purchase.order,department_id:0
127+msgid "Department"
128+msgstr ""
129+
130+#. module: purchase_order_department
131+#: view:purchase.order:0
132+msgid "onchange_user_id(rfq_user_id)"
133+msgstr ""
134+
135+#. module: purchase_order_department
136+#: help:purchase.order,department_id:0
137+msgid "The department where this purchase order belongs"
138+msgstr ""
139+
140+#. module: purchase_order_department
141+#: model:ir.model,name:purchase_order_department.model_purchase_order
142+msgid "Purchase Order"
143+msgstr ""
144+
145
146=== added directory 'purchase_order_department/model'
147=== added file 'purchase_order_department/model/__init__.py'
148--- purchase_order_department/model/__init__.py 1970-01-01 00:00:00 +0000
149+++ purchase_order_department/model/__init__.py 2014-06-18 21:55:16 +0000
150@@ -0,0 +1,26 @@
151+#!/usr/bin/python
152+# -*- encoding: utf-8 -*-
153+###############################################################################
154+# Module Writen to OpenERP, Open Source Management Solution
155+# Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>).
156+# All Rights Reserved
157+############# Credits #########################################################
158+# Coded by: Katherine Zaoral <kathy@vauxoo.com>
159+# Planified by: Humberto Arocha <hbto@vauxoo.com>
160+# Audited by: Humberto Arocha <hbto@vauxoo.com>
161+###############################################################################
162+# This program is free software: you can redistribute it and/or modify
163+# it under the terms of the GNU Affero General Public License as published
164+# by the Free Software Foundation, either version 3 of the License, or
165+# (at your option) any later version.
166+#
167+# This program is distributed in the hope that it will be useful,
168+# but WITHOUT ANY WARRANTY; without even the implied warranty of
169+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
170+# GNU Affero General Public License for more details.
171+#
172+# You should have received a copy of the GNU Affero General Public License
173+# along with this program. If not, see <http://www.gnu.org/licenses/>.
174+###############################################################################
175+
176+import purchase_order
177
178=== added file 'purchase_order_department/model/purchase_order.py'
179--- purchase_order_department/model/purchase_order.py 1970-01-01 00:00:00 +0000
180+++ purchase_order_department/model/purchase_order.py 2014-06-18 21:55:16 +0000
181@@ -0,0 +1,53 @@
182+#!/usr/bin/python
183+# -*- encoding: utf-8 -*-
184+###############################################################################
185+# Module Writen to OpenERP, Open Source Management Solution
186+# Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>).
187+# All Rights Reserved
188+############# Credits #########################################################
189+# Coded by: Katherine Zaoral <kathy@vauxoo.com>
190+# Planified by: Humberto Arocha <hbto@vauxoo.com>
191+# Audited by: Humberto Arocha <hbto@vauxoo.com>
192+###############################################################################
193+# This program is free software: you can redistribute it and/or modify
194+# it under the terms of the GNU Affero General Public License as published
195+# by the Free Software Foundation, either version 3 of the License, or
196+# (at your option) any later version.
197+#
198+# This program is distributed in the hope that it will be useful,
199+# but WITHOUT ANY WARRANTY; without even the implied warranty of
200+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
201+# GNU Affero General Public License for more details.
202+#
203+# You should have received a copy of the GNU Affero General Public License
204+# along with this program. If not, see <http://www.gnu.org/licenses/>.
205+###############################################################################
206+
207+from openerp.osv import fields, osv, orm
208+from openerp.tools.translate import _
209+from openerp import tools
210+
211+class purchase_order(osv.Model):
212+
213+ _inherit = 'purchase.order'
214+ _columns = {
215+ 'department_id': fields.many2one(
216+ 'hr.department',
217+ string='Department',
218+ help='The department where this purchase order belongs'),
219+ }
220+
221+ def onchange_user_id(self, cr, uid, ids, user_id, context=None):
222+ """ Return the department depending of the user.
223+ @param user_id: user id
224+ """
225+ context = context or {}
226+ res = {}
227+ ru_obj = self.pool.get('res.users')
228+ if user_id:
229+ ru_brw = ru_obj.browse(cr, uid, user_id, context=context)
230+ department_id = (ru_brw.employee_ids
231+ and ru_brw.employee_ids[0].department_id
232+ and ru_brw.employee_ids[0].department_id.id or False)
233+ res.update({'value': {'department_id': department_id}})
234+ return res
235
236=== added directory 'purchase_order_department/report'
237=== added directory 'purchase_order_department/security'
238=== added directory 'purchase_order_department/static'
239=== added directory 'purchase_order_department/static/description'
240=== added file 'purchase_order_department/static/description/index.html'
241=== added directory 'purchase_order_department/static/src'
242=== added directory 'purchase_order_department/static/src/css'
243=== added directory 'purchase_order_department/static/src/img'
244=== added file 'purchase_order_department/static/src/img/icon.png'
245Binary files purchase_order_department/static/src/img/icon.png 1970-01-01 00:00:00 +0000 and purchase_order_department/static/src/img/icon.png 2014-06-18 21:55:16 +0000 differ
246=== added directory 'purchase_order_department/static/src/js'
247=== added directory 'purchase_order_department/static/src/xml'
248=== added directory 'purchase_order_department/test'
249=== added directory 'purchase_order_department/view'
250=== added file 'purchase_order_department/view/purchase_order_view.xml'
251--- purchase_order_department/view/purchase_order_view.xml 1970-01-01 00:00:00 +0000
252+++ purchase_order_department/view/purchase_order_view.xml 2014-06-18 21:55:16 +0000
253@@ -0,0 +1,48 @@
254+<?xml version="1.0"?>
255+<openerp>
256+ <data>
257+
258+ <record id="purchase_order_department_form" model="ir.ui.view">
259+ <field name="name">purchase.order.department.form</field>
260+ <field name="model">purchase.order</field>
261+ <field name="inherit_id" ref="purchase_order_requisitor.inherit_purchase_order_view2"/>
262+ <field name="arch" type="xml">
263+ <xpath expr="//field[@name='rfq_user_id']" position="after">
264+ <field name="department_id"/>
265+ </xpath>
266+ <xpath expr="//field[@name='rfq_user_id']" position="attributes">
267+ <attribute name="on_change">onchange_user_id(rfq_user_id)</attribute>
268+ </xpath>
269+ </field>
270+ </record>
271+
272+ <record id="purchase_order_department_tree" model="ir.ui.view">
273+ <field name="name">purchase.order.department.tree</field>
274+ <field name="model">purchase.order</field>
275+ <field name="inherit_id" ref="purchase.purchase_order_tree"/>
276+ <field name="arch" type="xml">
277+ <xpath expr="//field[@name='date_order']" position="after">
278+ <field name="department_id"/>
279+ </xpath>
280+ </field>
281+ </record>
282+
283+ <record id="purchase_order_department_search" model="ir.ui.view">
284+ <field name="name">purchase.order.department.search</field>
285+ <field name="model">purchase.order</field>
286+ <field name="inherit_id" ref="purchase.view_purchase_order_filter"/>
287+ <field name="arch" type="xml">
288+
289+ <xpath expr="//field[@name='product_id']" position="after">
290+ <field name="department_id"/>
291+ </xpath>
292+
293+ <xpath expr="//group" position="inside">
294+ <filter string="Department" icon="terp-personal" context="{'group_by':'department_id'}"/>
295+ </xpath>
296+
297+ </field>
298+ </record>
299+
300+ </data>
301+</openerp>
302
303=== added directory 'purchase_order_department/wizard'
304=== added file 'purchase_order_department/wizard/__init__.py'
305--- purchase_order_department/wizard/__init__.py 1970-01-01 00:00:00 +0000
306+++ purchase_order_department/wizard/__init__.py 2014-06-18 21:55:16 +0000
307@@ -0,0 +1,25 @@
308+#!/usr/bin/python
309+# -*- encoding: utf-8 -*-
310+###############################################################################
311+# Module Writen to OpenERP, Open Source Management Solution
312+# Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>).
313+# All Rights Reserved
314+############# Credits #########################################################
315+# Coded by: Katherine Zaoral <kathy@vauxoo.com>
316+# Planified by: Humberto Arocha <hbto@vauxoo.com>
317+# Audited by: Humberto Arocha <hbto@vauxoo.com>
318+###############################################################################
319+# This program is free software: you can redistribute it and/or modify
320+# it under the terms of the GNU Affero General Public License as published
321+# by the Free Software Foundation, either version 3 of the License, or
322+# (at your option) any later version.
323+#
324+# This program is distributed in the hope that it will be useful,
325+# but WITHOUT ANY WARRANTY; without even the implied warranty of
326+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
327+# GNU Affero General Public License for more details.
328+#
329+# You should have received a copy of the GNU Affero General Public License
330+# along with this program. If not, see <http://www.gnu.org/licenses/>.
331+###############################################################################
332+
333
334=== added directory 'purchase_order_department/workflow'

Subscribers

People subscribed via source and target branches

to all changes: