[FIX] sale: do not crash if no value set

If the user does not set any value, the conversion of an empty string to
a float generates a traceback.
This commit is contained in:
Nicolas Martinelli
2015-10-28 17:07:01 +01:00
parent 665bc1c935
commit efbdac1efb
+1 -1
View File
@@ -62,4 +62,4 @@ class crm_team(osv.Model):
}
def update_invoiced_target(self, cr, uid, id, value, context=None):
return self.write(cr, uid, [id], {'invoiced_target': round(float(value))}, context=context)
return self.write(cr, uid, [id], {'invoiced_target': round(float(value or 0))}, context=context)