From 31b73b77e3de5527f8ffe841c2e1b8a4945b8349 Mon Sep 17 00:00:00 2001 From: "Anup (OpenERP)" Date: Mon, 4 Oct 2010 18:36:05 +0530 Subject: [PATCH] [FIX] project_timesheet : variable reference corrected lp bug: https://launchpad.net/bugs/653032 fixed bzr revid: ach@tinyerp.com-20101004130605-iz181rxj15g5wjfs --- addons/project_timesheet/project_timesheet.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/project_timesheet/project_timesheet.py b/addons/project_timesheet/project_timesheet.py index 411351f1be1..3c53cfe8630 100644 --- a/addons/project_timesheet/project_timesheet.py +++ b/addons/project_timesheet/project_timesheet.py @@ -112,6 +112,7 @@ class project_work(osv.osv): timesheet_obj = self.pool.get('hr.analytic.timesheet') project_obj = self.pool.get('project.project') uom_obj = self.pool.get('product.uom') + result = {} if isinstance(ids, (long, int)): ids = [ids,] @@ -139,7 +140,7 @@ class project_work(osv.osv): vals_line['unit_amount'] = vals['hours'] prod_id = vals_line.get('product_id', line_id.product_id.id) # False may be set - if result['product_uom_id'] and (not result['product_uom_id'] == default_uom): + if result.get('product_uom_id',False) and (not result['product_uom_id'] == default_uom): vals_line['unit_amount'] = uom_obj._compute_qty(cr, uid, default_uom, vals['hours'], result['product_uom_id']) # Compute based on pricetype