Merge lp:~savoirfairelinux-openerp/openerp-accountedge/fix-1234795 into lp:~openerp-accountedge/openerp-accountedge/6.1

Proposed by Virgil Dupras
Status: Merged
Merged at revision: 25
Proposed branch: lp:~savoirfairelinux-openerp/openerp-accountedge/fix-1234795
Merge into: lp:~openerp-accountedge/openerp-accountedge/6.1
Diff against target: 31 lines (+6/-8)
1 file modified
hr_expense_line_account/hr_expense_line_account.py (+6/-8)
To merge this branch: bzr merge lp:~savoirfairelinux-openerp/openerp-accountedge/fix-1234795
Reviewer Review Type Date Requested Status
Joao Alfredo Gama Batista code review, no test Approve
Maxime Chambreuil (http://www.savoirfairelinux.com) code review Approve
Review via email: mp+189151@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) :
review: Approve (code review)
Revision history for this message
Joao Alfredo Gama Batista (joao-gama) :
review: Approve (code review, no test)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hr_expense_line_account/hr_expense_line_account.py'
2--- hr_expense_line_account/hr_expense_line_account.py 2013-08-08 19:16:49 +0000
3+++ hr_expense_line_account/hr_expense_line_account.py 2013-10-03 17:49:59 +0000
4@@ -31,6 +31,8 @@
5 '''
6 Get the automatic value of the account_id field.
7 '''
8+ if not product_id:
9+ return None
10 # Retrieve the product
11 product = self.pool.get('product.product').browse(cr, uid, product_id)
12 # Product -> Accounting -> Expense account
13@@ -59,14 +61,10 @@
14
15
16 def onchange_product_id(self, cr, uid, ids, product_id, uom_id, employee_id, context=None):
17- if product_id:
18- values = super(hr_expense_line, self).onchange_product_id(cr, uid, ids, product_id, uom_id, employee_id, context=context)
19+ res = super(hr_expense_line, self).onchange_product_id(cr, uid, ids, product_id, uom_id, employee_id, context=context)
20 for id in ids:
21- this = self.browse(cr, uid, id)
22- account_id = self.get_account_id(cr, uid, product_id, context)
23- values['value'].update({
24- 'account_id' : account_id
25- })
26- return values
27+ account_id = self.get_account_id(cr, uid, product_id, context)
28+ res['value']['account_id'] = account_id
29+ return res
30
31 hr_expense_line()

Subscribers

People subscribed via source and target branches