fix: reset entries qty to 1 for serial item
This commit is contained in:
parent
65b2e1fc33
commit
93e3fe8445
@ -133,7 +133,7 @@ class SerialandBatchBundle(Document):
|
|||||||
def calculate_total_qty(self, save=True):
|
def calculate_total_qty(self, save=True):
|
||||||
self.total_qty = 0.0
|
self.total_qty = 0.0
|
||||||
for d in self.entries:
|
for d in self.entries:
|
||||||
d.qty = abs(d.qty) if d.qty else 0
|
d.qty = 1 if self.has_serial_no and abs(d.qty) > 1 else abs(d.qty) if d.qty else 0
|
||||||
d.stock_value_difference = abs(d.stock_value_difference) if d.stock_value_difference else 0
|
d.stock_value_difference = abs(d.stock_value_difference) if d.stock_value_difference else 0
|
||||||
if self.type_of_transaction == "Outward":
|
if self.type_of_transaction == "Outward":
|
||||||
d.qty *= -1
|
d.qty *= -1
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user