← Back to team overview

savoirfairelinux-openerp team mailing list archive

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

 

Virgil Dupras has proposed merging lp:~savoirfairelinux-openerp/openerp-accountedge/fix-1234795 into lp:openerp-accountedge.

Requested reviews:
  OpenERP - AccountEdge (openerp-accountedge)
Related bugs:
  Bug #1234795 in openerp-accountedge: "ProgrammingError: operator does not exist: integer = boolean"
  https://bugs.launchpad.net/openerp-accountedge/+bug/1234795

For more details, see:
https://code.launchpad.net/~savoirfairelinux-openerp/openerp-accountedge/fix-1234795/+merge/189151
-- 
https://code.launchpad.net/~savoirfairelinux-openerp/openerp-accountedge/fix-1234795/+merge/189151
Your team Savoir-faire Linux' OpenERP is subscribed to branch lp:~savoirfairelinux-openerp/openerp-accountedge/fix-1234795.
=== modified file 'hr_expense_line_account/hr_expense_line_account.py'
--- hr_expense_line_account/hr_expense_line_account.py	2013-08-08 19:16:49 +0000
+++ hr_expense_line_account/hr_expense_line_account.py	2013-10-03 17:49:59 +0000
@@ -31,6 +31,8 @@
         '''
             Get the automatic value of the account_id field.
         '''
+        if not product_id:
+            return None
         # Retrieve the product
         product = self.pool.get('product.product').browse(cr, uid, product_id)
         # Product -> Accounting -> Expense account
@@ -59,14 +61,10 @@
 
 
     def onchange_product_id(self, cr, uid, ids, product_id, uom_id, employee_id, context=None):
-        if product_id:
-            values      = super(hr_expense_line, self).onchange_product_id(cr, uid, ids, product_id, uom_id, employee_id, context=context)
+        res = super(hr_expense_line, self).onchange_product_id(cr, uid, ids, product_id, uom_id, employee_id, context=context)
         for id in ids:
-            this        = self.browse(cr, uid, id)
-            account_id  = self.get_account_id(cr, uid, product_id, context)
-            values['value'].update({
-                'account_id' : account_id
-            })
-        return values
+            account_id = self.get_account_id(cr, uid, product_id, context)
+            res['value']['account_id'] = account_id
+        return res
 
 hr_expense_line()


Follow ups