Merge lp:~vauxoo/addons-vauxoo/7.0-account_voucher_department-dev-1824-kty into lp:~vauxoo/addons-vauxoo/7.0-merge-account-voucher-generic-dev-1824-kty

Proposed by Katherine Zaoral (Vauxoo)
Status: Merged
Merged at revision: 1069
Proposed branch: lp:~vauxoo/addons-vauxoo/7.0-account_voucher_department-dev-1824-kty
Merge into: lp:~vauxoo/addons-vauxoo/7.0-merge-account-voucher-generic-dev-1824-kty
Diff against target: 258 lines (+205/-0)
6 files modified
account_voucher_department/__init__.py (+27/-0)
account_voucher_department/__openerp__.py (+54/-0)
account_voucher_department/model/__init__.py (+26/-0)
account_voucher_department/model/account_voucher.py (+53/-0)
account_voucher_department/view/account_voucher_view.xml (+20/-0)
account_voucher_department/wizard/__init__.py (+25/-0)
To merge this branch: bzr merge lp:~vauxoo/addons-vauxoo/7.0-account_voucher_department-dev-1824-kty
Reviewer Review Type Date Requested Status
Katherine Zaoral (Vauxoo) Approve
Review via email: mp+226027@code.launchpad.net

Description of the change

[MERGE] add new module account_voucher_department.

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

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'account_voucher_department'
2=== added file 'account_voucher_department/__init__.py'
3--- account_voucher_department/__init__.py 1970-01-01 00:00:00 +0000
4+++ account_voucher_department/__init__.py 2014-07-08 19:32:05 +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 'account_voucher_department/__openerp__.py'
35--- account_voucher_department/__openerp__.py 1970-01-01 00:00:00 +0000
36+++ account_voucher_department/__openerp__.py 2014-07-08 19:32:05 +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': 'Account Voucher Department',
65+ 'version': '1.0',
66+ 'author': 'Vauxoo',
67+ 'website': 'http://www.vauxoo.com/',
68+ 'category': '',
69+ 'description': '''
70+Account Voucher Department
71+==========================
72+
73+This module add a department field to the account voucher model that it is
74+automactly fill by the account voucher requester.
75+''',
76+ 'depends': [
77+ 'account_voucher',
78+ 'account_voucher_requester',
79+ 'hr',
80+ ],
81+ 'data': [
82+ 'view/account_voucher_view.xml',
83+ ],
84+ 'demo': [],
85+ 'test': [],
86+ 'qweb': [],
87+ 'js': [],
88+ 'css': [],
89+ 'active': False,
90+ 'installable': True,
91+}
92
93=== added directory 'account_voucher_department/data'
94=== added directory 'account_voucher_department/demo'
95=== added directory 'account_voucher_department/doc'
96=== added directory 'account_voucher_department/doc/images'
97=== added directory 'account_voucher_department/i18n'
98=== added directory 'account_voucher_department/model'
99=== added file 'account_voucher_department/model/__init__.py'
100--- account_voucher_department/model/__init__.py 1970-01-01 00:00:00 +0000
101+++ account_voucher_department/model/__init__.py 2014-07-08 19:32:05 +0000
102@@ -0,0 +1,26 @@
103+#!/usr/bin/python
104+# -*- encoding: utf-8 -*-
105+###############################################################################
106+# Module Writen to OpenERP, Open Source Management Solution
107+# Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>).
108+# All Rights Reserved
109+############# Credits #########################################################
110+# Coded by: Katherine Zaoral <kathy@vauxoo.com>
111+# Planified by: Humberto Arocha <hbto@vauxoo.com>
112+# Audited by: Humberto Arocha <hbto@vauxoo.com>
113+###############################################################################
114+# This program is free software: you can redistribute it and/or modify
115+# it under the terms of the GNU Affero General Public License as published
116+# by the Free Software Foundation, either version 3 of the License, or
117+# (at your option) any later version.
118+#
119+# This program is distributed in the hope that it will be useful,
120+# but WITHOUT ANY WARRANTY; without even the implied warranty of
121+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
122+# GNU Affero General Public License for more details.
123+#
124+# You should have received a copy of the GNU Affero General Public License
125+# along with this program. If not, see <http://www.gnu.org/licenses/>.
126+###############################################################################
127+
128+import account_voucher
129
130=== added file 'account_voucher_department/model/account_voucher.py'
131--- account_voucher_department/model/account_voucher.py 1970-01-01 00:00:00 +0000
132+++ account_voucher_department/model/account_voucher.py 2014-07-08 19:32:05 +0000
133@@ -0,0 +1,53 @@
134+#!/usr/bin/python
135+# -*- encoding: utf-8 -*-
136+###############################################################################
137+# Module Writen to OpenERP, Open Source Management Solution
138+# Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>).
139+# All Rights Reserved
140+############# Credits #########################################################
141+# Coded by: Katherine Zaoral <kathy@vauxoo.com>
142+# Planified by: Humberto Arocha <hbto@vauxoo.com>
143+# Audited by: Humberto Arocha <hbto@vauxoo.com>
144+###############################################################################
145+# This program is free software: you can redistribute it and/or modify
146+# it under the terms of the GNU Affero General Public License as published
147+# by the Free Software Foundation, either version 3 of the License, or
148+# (at your option) any later version.
149+#
150+# This program is distributed in the hope that it will be useful,
151+# but WITHOUT ANY WARRANTY; without even the implied warranty of
152+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
153+# GNU Affero General Public License for more details.
154+#
155+# You should have received a copy of the GNU Affero General Public License
156+# along with this program. If not, see <http://www.gnu.org/licenses/>.
157+###############################################################################
158+
159+from openerp.osv import fields, osv, orm
160+from openerp.tools.translate import _
161+from openerp import tools
162+
163+
164+class account_voucher(osv.Model):
165+
166+ _inherit = 'account.voucher'
167+ _columns = {
168+ 'department_id': fields.many2one(
169+ 'hr.department',
170+ string='Department',
171+ help='Department were the requester belongs.'),
172+ }
173+
174+ def onchange_employee_id(self, cr, uid, ids, employee_id, context=None):
175+ """ Return the department depending of the employee.
176+ @param employee_id: employee id
177+ """
178+ context = context or {}
179+ res = {}
180+ he_obj = self.pool.get('hr.employee')
181+ if employee_id:
182+ he_brw = he_obj.browse(cr, uid, employee_id, context=context)
183+ department_id = (he_brw.department_id and he_brw.department_id.id
184+ or False)
185+ res.update({'value': {'department_id': department_id}})
186+ return res
187
188=== added directory 'account_voucher_department/report'
189=== added directory 'account_voucher_department/security'
190=== added directory 'account_voucher_department/static'
191=== added directory 'account_voucher_department/static/description'
192=== added file 'account_voucher_department/static/description/index.html'
193=== added directory 'account_voucher_department/static/src'
194=== added directory 'account_voucher_department/static/src/css'
195=== added directory 'account_voucher_department/static/src/img'
196=== added file 'account_voucher_department/static/src/img/icon.png'
197Binary files account_voucher_department/static/src/img/icon.png 1970-01-01 00:00:00 +0000 and account_voucher_department/static/src/img/icon.png 2014-07-08 19:32:05 +0000 differ
198=== added directory 'account_voucher_department/static/src/js'
199=== added directory 'account_voucher_department/static/src/xml'
200=== added directory 'account_voucher_department/test'
201=== added directory 'account_voucher_department/view'
202=== added file 'account_voucher_department/view/account_voucher_view.xml'
203--- account_voucher_department/view/account_voucher_view.xml 1970-01-01 00:00:00 +0000
204+++ account_voucher_department/view/account_voucher_view.xml 2014-07-08 19:32:05 +0000
205@@ -0,0 +1,20 @@
206+<?xml version="1.0" encoding="utf-8"?>
207+<openerp>
208+ <data>
209+
210+ <record model="ir.ui.view" id="account_voucher_department_form">
211+ <field name="name">account.voucher.department.form</field>
212+ <field name="model">account.voucher</field>
213+ <field name="inherit_id" ref="account_voucher_requester.account_voucher_requester_form"/>
214+ <field name="arch" type="xml">
215+ <xpath expr="//field[@name='employee_id']" position="attributes">
216+ <attribute name="on_change">onchange_employee_id(employee_id)</attribute>
217+ </xpath>
218+ <xpath expr="//field[@name='employee_id']" position="after">
219+ <field name="department_id"/>
220+ </xpath>
221+ </field>
222+ </record>
223+
224+ </data>
225+</openerp>
226
227=== added directory 'account_voucher_department/wizard'
228=== added file 'account_voucher_department/wizard/__init__.py'
229--- account_voucher_department/wizard/__init__.py 1970-01-01 00:00:00 +0000
230+++ account_voucher_department/wizard/__init__.py 2014-07-08 19:32:05 +0000
231@@ -0,0 +1,25 @@
232+#!/usr/bin/python
233+# -*- encoding: utf-8 -*-
234+###############################################################################
235+# Module Writen to OpenERP, Open Source Management Solution
236+# Copyright (C) OpenERP Venezuela (<http://www.vauxoo.com>).
237+# All Rights Reserved
238+############# Credits #########################################################
239+# Coded by: Katherine Zaoral <kathy@vauxoo.com>
240+# Planified by: Humberto Arocha <hbto@vauxoo.com>
241+# Audited by: Humberto Arocha <hbto@vauxoo.com>
242+###############################################################################
243+# This program is free software: you can redistribute it and/or modify
244+# it under the terms of the GNU Affero General Public License as published
245+# by the Free Software Foundation, either version 3 of the License, or
246+# (at your option) any later version.
247+#
248+# This program is distributed in the hope that it will be useful,
249+# but WITHOUT ANY WARRANTY; without even the implied warranty of
250+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
251+# GNU Affero General Public License for more details.
252+#
253+# You should have received a copy of the GNU Affero General Public License
254+# along with this program. If not, see <http://www.gnu.org/licenses/>.
255+###############################################################################
256+
257
258=== added directory 'account_voucher_department/workflow'

Subscribers

People subscribed via source and target branches

to all changes: