sum get_not_assigned_weight when netweight is not none
This commit is contained in:
parent
fe8dc5abf6
commit
7365d9bb4a
|
@ -415,7 +415,8 @@ class Weighing(Workflow, ModelSQL, ModelView):
|
||||||
cls.analysis(to_analysis)
|
cls.analysis(to_analysis)
|
||||||
|
|
||||||
def get_not_assigned_weight(self, name):
|
def get_not_assigned_weight(self, name):
|
||||||
return self.netweight - sum([p.netweight for p in self.parcels])
|
if self.netweight:
|
||||||
|
return self.netweight - sum([p.netweight or 0 for p in self.parcels])
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ModelView.button
|
@ModelView.button
|
||||||
|
|
Loading…
Reference in New Issue