Merge lp:~vauxoo/addons-vauxoo/7.0-account_voucher_requester-rev-1824-kty into lp:~vauxoo/addons-vauxoo/addons-vauxoo-cicsa

Proposed by Katherine Zaoral (Vauxoo)
Status: Merged
Merged at revision: 1070
Proposed branch: lp:~vauxoo/addons-vauxoo/7.0-account_voucher_requester-rev-1824-kty
Merge into: lp:~vauxoo/addons-vauxoo/addons-vauxoo-cicsa
Diff against target: 122 lines (+16/-30)
7 files modified
account_voucher_department/i18n/account_voucher_department.pot (+0/-5)
account_voucher_department/model/account_voucher.py (+3/-13)
account_voucher_department/view/account_voucher_view.xml (+1/-4)
account_voucher_requester/__openerp__.py (+2/-2)
account_voucher_requester/i18n/account_voucher_requester.pot (+2/-2)
account_voucher_requester/model/account_voucher.py (+7/-3)
account_voucher_requester/view/account_voucher_view.xml (+1/-1)
To merge this branch: bzr merge lp:~vauxoo/addons-vauxoo/7.0-account_voucher_requester-rev-1824-kty
Reviewer Review Type Date Requested Status
Katherine Zaoral (Vauxoo) Approve
Review via email: mp+226744@code.launchpad.net

Description of the change

[MERGE] account voucher requester is a user instead of a employee and the account voucher department is cauclate using the current logged user.

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

waiting for runbot.

1073. By Katherine Zaoral (Vauxoo)

[ADD] add the current user as the default value of the requester field.

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

the runbot is green.
And the functional test works propertly.
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=== modified file 'account_voucher_department/i18n/account_voucher_department.pot'
2--- account_voucher_department/i18n/account_voucher_department.pot 2014-07-08 20:08:57 +0000
3+++ account_voucher_department/i18n/account_voucher_department.pot 2014-07-14 21:12:56 +0000
4@@ -30,8 +30,3 @@
5 msgid "Accounting Voucher"
6 msgstr ""
7
8-#. module: account_voucher_department
9-#: view:account.voucher:0
10-msgid "onchange_employee_id(employee_id)"
11-msgstr ""
12-
13
14=== modified file 'account_voucher_department/model/account_voucher.py'
15--- account_voucher_department/model/account_voucher.py 2014-07-08 19:26:51 +0000
16+++ account_voucher_department/model/account_voucher.py 2014-07-14 21:12:56 +0000
17@@ -38,16 +38,6 @@
18 help='Department were the requester belongs.'),
19 }
20
21- def onchange_employee_id(self, cr, uid, ids, employee_id, context=None):
22- """ Return the department depending of the employee.
23- @param employee_id: employee id
24- """
25- context = context or {}
26- res = {}
27- he_obj = self.pool.get('hr.employee')
28- if employee_id:
29- he_brw = he_obj.browse(cr, uid, employee_id, context=context)
30- department_id = (he_brw.department_id and he_brw.department_id.id
31- or False)
32- res.update({'value': {'department_id': department_id}})
33- return res
34+ _defaults = {
35+ 'department_id': lambda self, cur, uid, cxt: self.pool.get('res.users').browse(cur, uid, uid, cxt).employee_ids[0].department_id.id,
36+ }
37
38=== modified file 'account_voucher_department/view/account_voucher_view.xml'
39--- account_voucher_department/view/account_voucher_view.xml 2014-07-08 19:29:40 +0000
40+++ account_voucher_department/view/account_voucher_view.xml 2014-07-14 21:12:56 +0000
41@@ -7,10 +7,7 @@
42 <field name="model">account.voucher</field>
43 <field name="inherit_id" ref="account_voucher_requester.account_voucher_requester_form"/>
44 <field name="arch" type="xml">
45- <xpath expr="//field[@name='employee_id']" position="attributes">
46- <attribute name="on_change">onchange_employee_id(employee_id)</attribute>
47- </xpath>
48- <xpath expr="//field[@name='employee_id']" position="after">
49+ <xpath expr="//field[@name='user_id']" position="after">
50 <field name="department_id"/>
51 </xpath>
52 </field>
53
54=== modified file 'account_voucher_requester/__openerp__.py'
55--- account_voucher_requester/__openerp__.py 2014-07-08 18:40:48 +0000
56+++ account_voucher_requester/__openerp__.py 2014-07-14 21:12:56 +0000
57@@ -33,11 +33,11 @@
58 Account Voucher Requester
59 =========================
60
61-This module add an employee field to the account voucher model.
62+This module add an user field to the account voucher model to be the account
63+voucher requester.
64 ''',
65 'depends': [
66 'account_voucher',
67- 'hr',
68 ],
69 'data': [
70 'view/account_voucher_view.xml',
71
72=== modified file 'account_voucher_requester/i18n/account_voucher_requester.pot'
73--- account_voucher_requester/i18n/account_voucher_requester.pot 2014-07-08 20:08:57 +0000
74+++ account_voucher_requester/i18n/account_voucher_requester.pot 2014-07-14 21:12:56 +0000
75@@ -21,12 +21,12 @@
76 msgstr ""
77
78 #. module: account_voucher_requester
79-#: help:account.voucher,employee_id:0
80+#: help:account.voucher,user_id:0
81 msgid "Requester Employee"
82 msgstr ""
83
84 #. module: account_voucher_requester
85-#: field:account.voucher,employee_id:0
86+#: field:account.voucher,user_id:0
87 msgid "Requester"
88 msgstr ""
89
90
91=== modified file 'account_voucher_requester/model/account_voucher.py'
92--- account_voucher_requester/model/account_voucher.py 2014-07-08 18:37:04 +0000
93+++ account_voucher_requester/model/account_voucher.py 2014-07-14 21:12:56 +0000
94@@ -32,8 +32,12 @@
95
96 _inherit = 'account.voucher'
97 _columns = {
98- 'employee_id': fields.many2one(
99- 'hr.employee',
100+ 'user_id': fields.many2one(
101+ 'res.users',
102 string='Requester',
103- help='Requester Employee'),
104+ help='Requester User'),
105+ }
106+
107+ _defaults = {
108+ 'user_id': lambda self, cur, uid, cxt: uid,
109 }
110
111=== modified file 'account_voucher_requester/view/account_voucher_view.xml'
112--- account_voucher_requester/view/account_voucher_view.xml 2014-07-08 18:46:43 +0000
113+++ account_voucher_requester/view/account_voucher_view.xml 2014-07-14 21:12:56 +0000
114@@ -8,7 +8,7 @@
115 <field name="inherit_id" ref="account_voucher.view_vendor_payment_form"/>
116 <field name="arch" type="xml">
117 <xpath expr="//field[@name='journal_id']" position="after">
118- <field name="employee_id"/>
119+ <field name="user_id"/>
120 </xpath>
121 </field>
122 </record>

Subscribers

People subscribed via source and target branches

to all changes: