FIX in case stock.shipment.out object has not origin

This commit is contained in:
Raimon Esteve 2023-12-01 16:04:06 +01:00
parent 3fb4768847
commit 359f2afd0c
1 changed files with 1 additions and 1 deletions

View File

@ -57,7 +57,7 @@ class ShipmentOut(metaclass=PoolMeta):
return context
if self.carrier.carrier_cost_method != 'formula':
return context
if self.origin and self.origin.__name__ == 'sale.sale':
if hasattr(self, 'origin') and self.origin and self.origin.__name__ == 'sale.sale':
context['record'] = str(self.origin)
else:
context['record'] = str(self)