changeset a2bc69cd6b71 in modules/sale_complaint:6.0
details: 
https://hg.tryton.org/modules/sale_complaint?cmd=changeset&node=a2bc69cd6b71
description:
        Do not fail when compute unit for line without unit filled

        issue11522
        review421241003
        (grafted from 04e82b5357320c84387d86221881fdb0cf09920d)
diffstat:

 complaint.py |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r d9cb647e1728 -r a2bc69cd6b71 complaint.py
--- a/complaint.py      Mon May 03 15:57:19 2021 +0200
+++ b/complaint.py      Thu Jun 02 11:21:31 2022 +0200
@@ -748,7 +748,7 @@
 
     @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('line')
@@ -786,7 +786,7 @@
 
     @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('line')

Reply via email to