diff options
| author | Alexis de Lattre <alexis@via.ecp.fr> | 2013-10-27 13:31:04 +0100 |
|---|---|---|
| committer | Alexis de Lattre <alexis@via.ecp.fr> | 2013-10-27 13:31:04 +0100 |
| commit | 0bd592bf649afb022e125bc33de8522462619610 (patch) | |
| tree | 9388990fcd3cce5373cd15e1a9de32ddb11ba1ce /addons/analytic_user_function/analytic_user_function.py | |
| parent | 1ceeaace698ceab1370ee562908c761502f9e26e (diff) | |
| parent | 2f3c51705470347654288e36dd72ab559823b3ed (diff) | |
[MERGE] merge with addons/trunk revno 8956
bzr revid: alexis@via.ecp.fr-20131027123104-tf61ztyztstbc9et
Diffstat (limited to 'addons/analytic_user_function/analytic_user_function.py')
| -rw-r--r-- | addons/analytic_user_function/analytic_user_function.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/addons/analytic_user_function/analytic_user_function.py b/addons/analytic_user_function/analytic_user_function.py index ec2aa1688d6..2671fc92581 100644 --- a/addons/analytic_user_function/analytic_user_function.py +++ b/addons/analytic_user_function/analytic_user_function.py @@ -42,12 +42,13 @@ class analytic_user_funct_grid(osv.osv): return {} value = {} + prod = False + if product_id: + prod = self.pool.get('product.product').browse(cr, uid, product_id, context=context) emp = emp_obj.browse(cr, uid, emp_id[0], context=context) if emp.product_id and not product_id: value['product_id'] = emp.product_id.id prod = emp.product_id - if product_id: - prod = self.pool.get('product.product').browse(cr, uid, product_id, context=context) if prod: value['price'] = prod.list_price value['uom_id'] = prod.uom_id.id @@ -104,7 +105,7 @@ class hr_analytic_timesheet(osv.osv): a = r.product_id.categ_id.property_account_expense_categ.id if not a: raise osv.except_osv(_('Error!'), - _('There is no expense account define ' \ + _('There is no expense account defined ' \ 'for this product: "%s" (id:%d)') % \ (r.product_id.name, r.product_id.id,)) # Compute based on pricetype @@ -133,7 +134,7 @@ class hr_analytic_timesheet(osv.osv): a = r.product_id.categ_id.property_account_expense_categ.id if not a: raise osv.except_osv(_('Error!'), - _('There is no expense account define ' \ + _('There is no expense account defined ' \ 'for this product: "%s" (id:%d)') % \ (r.product_id.name, r.product_id.id,)) # Compute based on pricetype |
