sum purchase_quantity when netweight is not null
This commit is contained in:
parent
012564fc44
commit
af37939a47
3
plot.py
3
plot.py
|
@ -136,7 +136,8 @@ class Parcel(ModelSQL, ModelView):
|
||||||
)*self.surface, 2)
|
)*self.surface, 2)
|
||||||
|
|
||||||
def get_purchased_quantity(self, name):
|
def get_purchased_quantity(self, name):
|
||||||
return sum([w.netweight for w in self.weighings if not w.table])
|
return sum([w.netweight for w in self.weighings
|
||||||
|
if w.netweight and not w.table])
|
||||||
|
|
||||||
def get_remaining_quantity(self, name):
|
def get_remaining_quantity(self, name):
|
||||||
return (self.max_production or 0) - (self.purchased_quantity or 0)
|
return (self.max_production or 0) - (self.purchased_quantity or 0)
|
||||||
|
|
Loading…
Reference in New Issue