Do not fail when compute unit for line without unit filled
issue11522 review421241003
This commit is contained in:
1 parent
f971d4b3c1
commit
c08a844096
1 file changed
+2
-2
+2
-2
@@ -697,7 +697,7 @@ class Action_SaleLine(_Action_Line, ModelView, ModelSQL):
|
||||
|
||||
@fields.depends('line')
|
||||
def on_change_with_unit(self, name=None):
|
||||
if self.line:
|
||||
if self.line and self.line.unit:
|
||||
return self.line.unit.id
|
||||
|
||||
@fields.depends('quantity', 'line')
|
||||
@@ -729,7 +729,7 @@ class Action_InvoiceLine(_Action_Line, ModelView, ModelSQL):
|
||||
|
||||
@fields.depends('line')
|
||||
def on_change_with_unit(self, name=None):
|
||||
if self.line:
|
||||
if self.line and self.line.unit:
|
||||
return self.line.unit.id
|
||||
|
||||
@fields.depends('quantity', 'line')
|
||||
|
||||
Reference in new issue
Block a user