Merge lp:~vauxoo/addons-vauxoo/7.0-purchase_order_department-dev-1625-kty into lp:~vauxoo/addons-vauxoo/addons-vauxoo-cicsa
- 7.0-purchase_order_department-dev-1625-kty
- Merge into 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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Katherine Zaoral (Vauxoo) | Approve | ||
Review via email: mp+223652@code.launchpad.net |
Commit message
Description of the change
[MERGE] add new module purchase_
To post a comment you must log in.
Revision history for this message
Katherine Zaoral (Vauxoo) (kathy-zaoral) wrote : | # |
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 | 1 | #!/usr/bin/python | ||
7 | 2 | # -*- encoding: utf-8 -*- | ||
8 | 3 | ############################################################################### | ||
9 | 4 | # Module Writen to OpenERP, Open Source Management Solution | ||
10 | 5 | # Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>). | ||
11 | 6 | # All Rights Reserved | ||
12 | 7 | ############# Credits ######################################################### | ||
13 | 8 | # Coded by: Katherine Zaoral <kathy@vauxoo.com> | ||
14 | 9 | # Planified by: Humberto Arocha <hbto@vauxoo.com> | ||
15 | 10 | # Audited by: Humberto Arocha <hbto@vauxoo.com> | ||
16 | 11 | ############################################################################### | ||
17 | 12 | # This program is free software: you can redistribute it and/or modify | ||
18 | 13 | # it under the terms of the GNU Affero General Public License as published | ||
19 | 14 | # by the Free Software Foundation, either version 3 of the License, or | ||
20 | 15 | # (at your option) any later version. | ||
21 | 16 | # | ||
22 | 17 | # This program is distributed in the hope that it will be useful, | ||
23 | 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
24 | 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
25 | 20 | # GNU Affero General Public License for more details. | ||
26 | 21 | # | ||
27 | 22 | # You should have received a copy of the GNU Affero General Public License | ||
28 | 23 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
29 | 24 | ############################################################################### | ||
30 | 25 | |||
31 | 26 | import model | ||
32 | 27 | import wizard | ||
33 | 0 | 28 | ||
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 | 1 | #!/usr/bin/python | ||
39 | 2 | # -*- encoding: utf-8 -*- | ||
40 | 3 | ############################################################################### | ||
41 | 4 | # Module Writen to OpenERP, Open Source Management Solution | ||
42 | 5 | # Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>). | ||
43 | 6 | # All Rights Reserved | ||
44 | 7 | ############# Credits ######################################################### | ||
45 | 8 | # Coded by: Katherine Zaoral <kathy@vauxoo.com> | ||
46 | 9 | # Planified by: Humberto Arocha <hbto@vauxoo.com> | ||
47 | 10 | # Audited by: Humberto Arocha <hbto@vauxoo.com> | ||
48 | 11 | ############################################################################### | ||
49 | 12 | # This program is free software: you can redistribute it and/or modify | ||
50 | 13 | # it under the terms of the GNU Affero General Public License as published | ||
51 | 14 | # by the Free Software Foundation, either version 3 of the License, or | ||
52 | 15 | # (at your option) any later version. | ||
53 | 16 | # | ||
54 | 17 | # This program is distributed in the hope that it will be useful, | ||
55 | 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
56 | 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
57 | 20 | # GNU Affero General Public License for more details. | ||
58 | 21 | # | ||
59 | 22 | # You should have received a copy of the GNU Affero General Public License | ||
60 | 23 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
61 | 24 | ############################################################################### | ||
62 | 25 | |||
63 | 26 | { | ||
64 | 27 | 'name': 'Purchase Order Department', | ||
65 | 28 | 'version': '1.0', | ||
66 | 29 | 'author': 'Vauxoo', | ||
67 | 30 | 'website': 'http://www.vauxoo.com/', | ||
68 | 31 | 'category': 'purchase', | ||
69 | 32 | 'description': ''' | ||
70 | 33 | Purchase Order Department | ||
71 | 34 | ========================= | ||
72 | 35 | |||
73 | 36 | Add a department field to the purchase order model. This check the purchase | ||
74 | 37 | order requisitor (user) and fill the department field with the requisitor | ||
75 | 38 | employee info. Also add a search filter by text to search the department name | ||
76 | 39 | and a gruop by filter by department. | ||
77 | 40 | |||
78 | 41 | Note: this module do not work propertly for users with multiple employees. | ||
79 | 42 | ''', | ||
80 | 43 | |||
81 | 44 | 'depends': [ | ||
82 | 45 | 'purchase', | ||
83 | 46 | 'hr', | ||
84 | 47 | 'purchase_order_requisitor', | ||
85 | 48 | ], | ||
86 | 49 | 'data': [ | ||
87 | 50 | 'view/purchase_order_view.xml', | ||
88 | 51 | ], | ||
89 | 52 | 'demo': [], | ||
90 | 53 | 'test': [], | ||
91 | 54 | 'qweb': [], | ||
92 | 55 | 'js': [], | ||
93 | 56 | 'css': [], | ||
94 | 57 | 'active': False, | ||
95 | 58 | 'installable': True, | ||
96 | 59 | } | ||
97 | 0 | 60 | ||
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 | 1 | # Translation of OpenERP Server. | ||
108 | 2 | # This file contains the translation of the following modules: | ||
109 | 3 | # * purchase_order_department | ||
110 | 4 | # | ||
111 | 5 | msgid "" | ||
112 | 6 | msgstr "" | ||
113 | 7 | "Project-Id-Version: OpenERP Server 7.0\n" | ||
114 | 8 | "Report-Msgid-Bugs-To: \n" | ||
115 | 9 | "POT-Creation-Date: 2014-06-18 21:28+0000\n" | ||
116 | 10 | "PO-Revision-Date: 2014-06-18 21:28+0000\n" | ||
117 | 11 | "Last-Translator: <>\n" | ||
118 | 12 | "Language-Team: \n" | ||
119 | 13 | "MIME-Version: 1.0\n" | ||
120 | 14 | "Content-Type: text/plain; charset=UTF-8\n" | ||
121 | 15 | "Content-Transfer-Encoding: \n" | ||
122 | 16 | "Plural-Forms: \n" | ||
123 | 17 | |||
124 | 18 | #. module: purchase_order_department | ||
125 | 19 | #: view:purchase.order:0 | ||
126 | 20 | #: field:purchase.order,department_id:0 | ||
127 | 21 | msgid "Department" | ||
128 | 22 | msgstr "" | ||
129 | 23 | |||
130 | 24 | #. module: purchase_order_department | ||
131 | 25 | #: view:purchase.order:0 | ||
132 | 26 | msgid "onchange_user_id(rfq_user_id)" | ||
133 | 27 | msgstr "" | ||
134 | 28 | |||
135 | 29 | #. module: purchase_order_department | ||
136 | 30 | #: help:purchase.order,department_id:0 | ||
137 | 31 | msgid "The department where this purchase order belongs" | ||
138 | 32 | msgstr "" | ||
139 | 33 | |||
140 | 34 | #. module: purchase_order_department | ||
141 | 35 | #: model:ir.model,name:purchase_order_department.model_purchase_order | ||
142 | 36 | msgid "Purchase Order" | ||
143 | 37 | msgstr "" | ||
144 | 38 | |||
145 | 0 | 39 | ||
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 | 1 | #!/usr/bin/python | ||
152 | 2 | # -*- encoding: utf-8 -*- | ||
153 | 3 | ############################################################################### | ||
154 | 4 | # Module Writen to OpenERP, Open Source Management Solution | ||
155 | 5 | # Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>). | ||
156 | 6 | # All Rights Reserved | ||
157 | 7 | ############# Credits ######################################################### | ||
158 | 8 | # Coded by: Katherine Zaoral <kathy@vauxoo.com> | ||
159 | 9 | # Planified by: Humberto Arocha <hbto@vauxoo.com> | ||
160 | 10 | # Audited by: Humberto Arocha <hbto@vauxoo.com> | ||
161 | 11 | ############################################################################### | ||
162 | 12 | # This program is free software: you can redistribute it and/or modify | ||
163 | 13 | # it under the terms of the GNU Affero General Public License as published | ||
164 | 14 | # by the Free Software Foundation, either version 3 of the License, or | ||
165 | 15 | # (at your option) any later version. | ||
166 | 16 | # | ||
167 | 17 | # This program is distributed in the hope that it will be useful, | ||
168 | 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
169 | 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
170 | 20 | # GNU Affero General Public License for more details. | ||
171 | 21 | # | ||
172 | 22 | # You should have received a copy of the GNU Affero General Public License | ||
173 | 23 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
174 | 24 | ############################################################################### | ||
175 | 25 | |||
176 | 26 | import purchase_order | ||
177 | 0 | 27 | ||
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 | 1 | #!/usr/bin/python | ||
183 | 2 | # -*- encoding: utf-8 -*- | ||
184 | 3 | ############################################################################### | ||
185 | 4 | # Module Writen to OpenERP, Open Source Management Solution | ||
186 | 5 | # Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>). | ||
187 | 6 | # All Rights Reserved | ||
188 | 7 | ############# Credits ######################################################### | ||
189 | 8 | # Coded by: Katherine Zaoral <kathy@vauxoo.com> | ||
190 | 9 | # Planified by: Humberto Arocha <hbto@vauxoo.com> | ||
191 | 10 | # Audited by: Humberto Arocha <hbto@vauxoo.com> | ||
192 | 11 | ############################################################################### | ||
193 | 12 | # This program is free software: you can redistribute it and/or modify | ||
194 | 13 | # it under the terms of the GNU Affero General Public License as published | ||
195 | 14 | # by the Free Software Foundation, either version 3 of the License, or | ||
196 | 15 | # (at your option) any later version. | ||
197 | 16 | # | ||
198 | 17 | # This program is distributed in the hope that it will be useful, | ||
199 | 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
200 | 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
201 | 20 | # GNU Affero General Public License for more details. | ||
202 | 21 | # | ||
203 | 22 | # You should have received a copy of the GNU Affero General Public License | ||
204 | 23 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
205 | 24 | ############################################################################### | ||
206 | 25 | |||
207 | 26 | from openerp.osv import fields, osv, orm | ||
208 | 27 | from openerp.tools.translate import _ | ||
209 | 28 | from openerp import tools | ||
210 | 29 | |||
211 | 30 | class purchase_order(osv.Model): | ||
212 | 31 | |||
213 | 32 | _inherit = 'purchase.order' | ||
214 | 33 | _columns = { | ||
215 | 34 | 'department_id': fields.many2one( | ||
216 | 35 | 'hr.department', | ||
217 | 36 | string='Department', | ||
218 | 37 | help='The department where this purchase order belongs'), | ||
219 | 38 | } | ||
220 | 39 | |||
221 | 40 | def onchange_user_id(self, cr, uid, ids, user_id, context=None): | ||
222 | 41 | """ Return the department depending of the user. | ||
223 | 42 | @param user_id: user id | ||
224 | 43 | """ | ||
225 | 44 | context = context or {} | ||
226 | 45 | res = {} | ||
227 | 46 | ru_obj = self.pool.get('res.users') | ||
228 | 47 | if user_id: | ||
229 | 48 | ru_brw = ru_obj.browse(cr, uid, user_id, context=context) | ||
230 | 49 | department_id = (ru_brw.employee_ids | ||
231 | 50 | and ru_brw.employee_ids[0].department_id | ||
232 | 51 | and ru_brw.employee_ids[0].department_id.id or False) | ||
233 | 52 | res.update({'value': {'department_id': department_id}}) | ||
234 | 53 | return res | ||
235 | 0 | 54 | ||
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' | |||
245 | 1 | Binary 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 | 55 | Binary 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 | 1 | <?xml version="1.0"?> | ||
255 | 2 | <openerp> | ||
256 | 3 | <data> | ||
257 | 4 | |||
258 | 5 | <record id="purchase_order_department_form" model="ir.ui.view"> | ||
259 | 6 | <field name="name">purchase.order.department.form</field> | ||
260 | 7 | <field name="model">purchase.order</field> | ||
261 | 8 | <field name="inherit_id" ref="purchase_order_requisitor.inherit_purchase_order_view2"/> | ||
262 | 9 | <field name="arch" type="xml"> | ||
263 | 10 | <xpath expr="//field[@name='rfq_user_id']" position="after"> | ||
264 | 11 | <field name="department_id"/> | ||
265 | 12 | </xpath> | ||
266 | 13 | <xpath expr="//field[@name='rfq_user_id']" position="attributes"> | ||
267 | 14 | <attribute name="on_change">onchange_user_id(rfq_user_id)</attribute> | ||
268 | 15 | </xpath> | ||
269 | 16 | </field> | ||
270 | 17 | </record> | ||
271 | 18 | |||
272 | 19 | <record id="purchase_order_department_tree" model="ir.ui.view"> | ||
273 | 20 | <field name="name">purchase.order.department.tree</field> | ||
274 | 21 | <field name="model">purchase.order</field> | ||
275 | 22 | <field name="inherit_id" ref="purchase.purchase_order_tree"/> | ||
276 | 23 | <field name="arch" type="xml"> | ||
277 | 24 | <xpath expr="//field[@name='date_order']" position="after"> | ||
278 | 25 | <field name="department_id"/> | ||
279 | 26 | </xpath> | ||
280 | 27 | </field> | ||
281 | 28 | </record> | ||
282 | 29 | |||
283 | 30 | <record id="purchase_order_department_search" model="ir.ui.view"> | ||
284 | 31 | <field name="name">purchase.order.department.search</field> | ||
285 | 32 | <field name="model">purchase.order</field> | ||
286 | 33 | <field name="inherit_id" ref="purchase.view_purchase_order_filter"/> | ||
287 | 34 | <field name="arch" type="xml"> | ||
288 | 35 | |||
289 | 36 | <xpath expr="//field[@name='product_id']" position="after"> | ||
290 | 37 | <field name="department_id"/> | ||
291 | 38 | </xpath> | ||
292 | 39 | |||
293 | 40 | <xpath expr="//group" position="inside"> | ||
294 | 41 | <filter string="Department" icon="terp-personal" context="{'group_by':'department_id'}"/> | ||
295 | 42 | </xpath> | ||
296 | 43 | |||
297 | 44 | </field> | ||
298 | 45 | </record> | ||
299 | 46 | |||
300 | 47 | </data> | ||
301 | 48 | </openerp> | ||
302 | 0 | 49 | ||
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 | 1 | #!/usr/bin/python | ||
309 | 2 | # -*- encoding: utf-8 -*- | ||
310 | 3 | ############################################################################### | ||
311 | 4 | # Module Writen to OpenERP, Open Source Management Solution | ||
312 | 5 | # Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>). | ||
313 | 6 | # All Rights Reserved | ||
314 | 7 | ############# Credits ######################################################### | ||
315 | 8 | # Coded by: Katherine Zaoral <kathy@vauxoo.com> | ||
316 | 9 | # Planified by: Humberto Arocha <hbto@vauxoo.com> | ||
317 | 10 | # Audited by: Humberto Arocha <hbto@vauxoo.com> | ||
318 | 11 | ############################################################################### | ||
319 | 12 | # This program is free software: you can redistribute it and/or modify | ||
320 | 13 | # it under the terms of the GNU Affero General Public License as published | ||
321 | 14 | # by the Free Software Foundation, either version 3 of the License, or | ||
322 | 15 | # (at your option) any later version. | ||
323 | 16 | # | ||
324 | 17 | # This program is distributed in the hope that it will be useful, | ||
325 | 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
326 | 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
327 | 20 | # GNU Affero General Public License for more details. | ||
328 | 21 | # | ||
329 | 22 | # You should have received a copy of the GNU Affero General Public License | ||
330 | 23 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
331 | 24 | ############################################################################### | ||
332 | 25 | |||
333 | 0 | 26 | ||
334 | === added directory 'purchase_order_department/workflow' |
waiting for runbot