Test if origin id is greater or equals to 0 before accessing the target record name
Closes #13498
This commit is contained in:
@@ -2713,7 +2713,8 @@ class InvoiceLine(sequence_ordered(), ModelSQL, ModelView, TaxableMixin):
|
||||
def origin_name(self):
|
||||
if isinstance(self.origin, self.__class__) and self.origin.id >= 0:
|
||||
return self.origin.invoice.rec_name
|
||||
return self.origin.rec_name if self.origin else None
|
||||
if self.origin and self.origin.id >= 0:
|
||||
return self.origin.rec_name
|
||||
|
||||
@classmethod
|
||||
def default_taxes_deductible_rate(cls):
|
||||
|
||||
Reference in New Issue
Block a user