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
=== modified file 'account_voucher_department/i18n/account_voucher_department.pot'
--- account_voucher_department/i18n/account_voucher_department.pot 2014-07-08 20:08:57 +0000
+++ account_voucher_department/i18n/account_voucher_department.pot 2014-07-14 21:12:56 +0000
@@ -30,8 +30,3 @@
30msgid "Accounting Voucher"30msgid "Accounting Voucher"
31msgstr ""31msgstr ""
3232
33#. module: account_voucher_department
34#: view:account.voucher:0
35msgid "onchange_employee_id(employee_id)"
36msgstr ""
37
3833
=== modified file 'account_voucher_department/model/account_voucher.py'
--- account_voucher_department/model/account_voucher.py 2014-07-08 19:26:51 +0000
+++ account_voucher_department/model/account_voucher.py 2014-07-14 21:12:56 +0000
@@ -38,16 +38,6 @@
38 help='Department were the requester belongs.'),38 help='Department were the requester belongs.'),
39 }39 }
4040
41 def onchange_employee_id(self, cr, uid, ids, employee_id, context=None):41 _defaults = {
42 """ Return the department depending of the employee.42 'department_id': lambda self, cur, uid, cxt: self.pool.get('res.users').browse(cur, uid, uid, cxt).employee_ids[0].department_id.id,
43 @param employee_id: employee id43 }
44 """
45 context = context or {}
46 res = {}
47 he_obj = self.pool.get('hr.employee')
48 if employee_id:
49 he_brw = he_obj.browse(cr, uid, employee_id, context=context)
50 department_id = (he_brw.department_id and he_brw.department_id.id
51 or False)
52 res.update({'value': {'department_id': department_id}})
53 return res
5444
=== modified file 'account_voucher_department/view/account_voucher_view.xml'
--- account_voucher_department/view/account_voucher_view.xml 2014-07-08 19:29:40 +0000
+++ account_voucher_department/view/account_voucher_view.xml 2014-07-14 21:12:56 +0000
@@ -7,10 +7,7 @@
7 <field name="model">account.voucher</field>7 <field name="model">account.voucher</field>
8 <field name="inherit_id" ref="account_voucher_requester.account_voucher_requester_form"/>8 <field name="inherit_id" ref="account_voucher_requester.account_voucher_requester_form"/>
9 <field name="arch" type="xml">9 <field name="arch" type="xml">
10 <xpath expr="//field[@name='employee_id']" position="attributes">10 <xpath expr="//field[@name='user_id']" position="after">
11 <attribute name="on_change">onchange_employee_id(employee_id)</attribute>
12 </xpath>
13 <xpath expr="//field[@name='employee_id']" position="after">
14 <field name="department_id"/>11 <field name="department_id"/>
15 </xpath>12 </xpath>
16 </field>13 </field>
1714
=== modified file 'account_voucher_requester/__openerp__.py'
--- account_voucher_requester/__openerp__.py 2014-07-08 18:40:48 +0000
+++ account_voucher_requester/__openerp__.py 2014-07-14 21:12:56 +0000
@@ -33,11 +33,11 @@
33Account Voucher Requester33Account Voucher Requester
34=========================34=========================
3535
36This module add an employee field to the account voucher model. 36This module add an user field to the account voucher model to be the account
37voucher requester.
37''',38''',
38 'depends': [39 'depends': [
39 'account_voucher',40 'account_voucher',
40 'hr',
41 ],41 ],
42 'data': [42 'data': [
43 'view/account_voucher_view.xml',43 'view/account_voucher_view.xml',
4444
=== modified file 'account_voucher_requester/i18n/account_voucher_requester.pot'
--- account_voucher_requester/i18n/account_voucher_requester.pot 2014-07-08 20:08:57 +0000
+++ account_voucher_requester/i18n/account_voucher_requester.pot 2014-07-14 21:12:56 +0000
@@ -21,12 +21,12 @@
21msgstr ""21msgstr ""
2222
23#. module: account_voucher_requester23#. module: account_voucher_requester
24#: help:account.voucher,employee_id:024#: help:account.voucher,user_id:0
25msgid "Requester Employee"25msgid "Requester Employee"
26msgstr ""26msgstr ""
2727
28#. module: account_voucher_requester28#. module: account_voucher_requester
29#: field:account.voucher,employee_id:029#: field:account.voucher,user_id:0
30msgid "Requester"30msgid "Requester"
31msgstr ""31msgstr ""
3232
3333
=== modified file 'account_voucher_requester/model/account_voucher.py'
--- account_voucher_requester/model/account_voucher.py 2014-07-08 18:37:04 +0000
+++ account_voucher_requester/model/account_voucher.py 2014-07-14 21:12:56 +0000
@@ -32,8 +32,12 @@
3232
33 _inherit = 'account.voucher'33 _inherit = 'account.voucher'
34 _columns = {34 _columns = {
35 'employee_id': fields.many2one(35 'user_id': fields.many2one(
36 'hr.employee',36 'res.users',
37 string='Requester',37 string='Requester',
38 help='Requester Employee'),38 help='Requester User'),
39 }
40
41 _defaults = {
42 'user_id': lambda self, cur, uid, cxt: uid,
39 }43 }
4044
=== modified file 'account_voucher_requester/view/account_voucher_view.xml'
--- account_voucher_requester/view/account_voucher_view.xml 2014-07-08 18:46:43 +0000
+++ account_voucher_requester/view/account_voucher_view.xml 2014-07-14 21:12:56 +0000
@@ -8,7 +8,7 @@
8 <field name="inherit_id" ref="account_voucher.view_vendor_payment_form"/>8 <field name="inherit_id" ref="account_voucher.view_vendor_payment_form"/>
9 <field name="arch" type="xml">9 <field name="arch" type="xml">
10 <xpath expr="//field[@name='journal_id']" position="after">10 <xpath expr="//field[@name='journal_id']" position="after">
11 <field name="employee_id"/>11 <field name="user_id"/>
12 </xpath>12 </xpath>
13 </field>13 </field>
14 </record>14 </record>

Subscribers

People subscribed via source and target branches

to all changes: