Skip to content

Commit

Permalink
fix: set received_qty before_validate SCR
Browse files Browse the repository at this point in the history
(cherry picked from commit c447dfa)
  • Loading branch information
s-aga-r authored and mergify[bot] committed Nov 6, 2022
1 parent b9fb104 commit e316558
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -58,6 +58,7 @@ def update_status_updater_args(self):
def before_validate(self):
super(SubcontractingReceipt, self).before_validate()
self.set_items_bom()
self.set_received_qty()
self.set_items_cost_center()
self.set_items_expense_account()

Expand Down Expand Up @@ -212,6 +213,10 @@ def set_items_bom(self):
"bom",
)

def set_received_qty(self):
for item in self.items:
item.received_qty = flt(item.qty) + flt(item.rejected_qty)

def set_items_cost_center(self):
if self.company:
cost_center = frappe.get_cached_value("Company", self.company, "cost_center")
Expand Down

0 comments on commit e316558

Please sign in to comment.