From efbdac1efb4170376eba7445a2f0bb8038b32637 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Wed, 28 Oct 2015 16:44:09 +0100 Subject: [PATCH] [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. --- addons/sale/sales_team.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/sales_team.py b/addons/sale/sales_team.py index ecdecea782f..c4a593cf11d 100644 --- a/addons/sale/sales_team.py +++ b/addons/sale/sales_team.py @@ -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)