fix: valuation rate for sales / purchase return for serial / batch nos (backport #43925) (#43942)

fix: valuation rate for sales / purchase return for serial / batch nos (#43925)

(cherry picked from commit 01bb1612da)

Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
mergify[bot]
2024-11-03 04:20:20 +05:30
committed by GitHub
parent a689830bff
commit ce42d847b3
6 changed files with 643 additions and 13 deletions

View File

@@ -334,6 +334,11 @@ class StockController(AccountsController):
}
)
if self.doctype in ["Sales Invoice", "Delivery Note"]:
row.db_set(
"incoming_rate", frappe.db.get_value("Serial and Batch Bundle", bundle, "avg_rate")
)
def get_reference_ids(self, table_name, qty_field=None, bundle_field=None) -> tuple[str, list[str]]:
field = {
"Sales Invoice": "sales_invoice_item",