[TEST]
[odoo/odoo.git] / addons / project_timesheet / project_timesheet.py
index 3f85e5c..439ff6d 100644 (file)
@@ -199,8 +199,8 @@ class project_work(osv.osv):
 
                 if amount_unit and 'amount' in amount_unit.get('value',{}):
                     vals_line['amount'] = amount_unit['value']['amount']
-            if line_id.sheet_id.state in ['confirm' 'done']:
-                self.pool.get('hr.analytic.timesheet').write(cr, uid, [line_id.id], vals_line, context=context)
+
+            self.pool.get('hr.analytic.timesheet').write(cr, uid, [line_id.id], vals_line, context=context)
 
         return super(project_work,self).write(cr, uid, ids, vals, context)
 
@@ -241,6 +241,7 @@ class task(osv.osv):
             if vals.get('project_id',False):
                 project_obj = self.pool.get('project.project').browse(cr, uid, vals['project_id'], context=context)
                 acc_id = project_obj.analytic_account_id.id
+
             for task_obj in self.browse(cr, uid, ids, context=context):
                 if len(task_obj.work_ids):
                     for task_work in task_obj.work_ids: