FIX when has not plan and not parent to get the plan

#041618
This commit is contained in:
Raimon Esteve 2020-10-01 15:38:54 +02:00
parent df8577d04b
commit 4e4c52db9e
1 changed files with 4 additions and 1 deletions

View File

@ -644,7 +644,10 @@ class PlanProductLine(ModelSQL, ModelView, tree(separator='/')):
return cost.quantize(Decimal(str(10 ** -digits)))
def get_plan(self):
return self.plan if self.plan else self.parent.get_plan()
if self.plan:
return self.plan
elif self.parent:
return self.parent.get_plan()
def get_unit_cost(self, name):
unit_cost = self.total_cost