Avoid recursion error when stock origin is set to itself
issue10205 review336071005
This commit is contained in:
1 parent
9123f8f022
commit
d749599402
1 file changed
+3
-3
@@ -114,7 +114,7 @@ class Move(metaclass=PoolMeta):
|
||||
if self.secondary_unit:
|
||||
# Stay valid even if origin has been deleted
|
||||
category = self.secondary_unit.category.id
|
||||
if isinstance(self.origin, self.__class__):
|
||||
if isinstance(self.origin, self.__class__) and self.origin != self:
|
||||
if self.origin.product_secondary_uom_category:
|
||||
category = self.origin.product_secondary_uom_category.id
|
||||
return category
|
||||
@@ -125,12 +125,12 @@ class Move(metaclass=PoolMeta):
|
||||
|
||||
@property
|
||||
def secondary_uom_factor(self):
|
||||
if isinstance(self.origin, self.__class__):
|
||||
if isinstance(self.origin, self.__class__) and self.origin != self:
|
||||
return self.origin.secondary_uom_factor
|
||||
|
||||
@property
|
||||
def secondary_uom_rate(self):
|
||||
if isinstance(self.origin, self.__class__):
|
||||
if isinstance(self.origin, self.__class__) and self.origin != self:
|
||||
return self.origin.secondary_uom_rate
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user