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