mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 11:19:09 +00:00
fix(sales_invoice): skip stock update for POS invoices linked to Delivery Note (backport #55311) (#55313)
Co-authored-by: Diptanil Saha <diptanil@frappe.io> fix(sales_invoice): skip stock update for POS invoices linked to Delivery Note (#55311)
This commit is contained in:
@@ -968,9 +968,6 @@ class SalesInvoice(SellingController):
|
|||||||
if selling_price_list:
|
if selling_price_list:
|
||||||
self.set("selling_price_list", selling_price_list)
|
self.set("selling_price_list", selling_price_list)
|
||||||
|
|
||||||
if not for_validate:
|
|
||||||
self.update_stock = cint(pos.get("update_stock"))
|
|
||||||
|
|
||||||
# set pos values in items
|
# set pos values in items
|
||||||
for item in self.get("items"):
|
for item in self.get("items"):
|
||||||
if item.get("item_code"):
|
if item.get("item_code"):
|
||||||
@@ -981,6 +978,10 @@ class SalesInvoice(SellingController):
|
|||||||
if (not for_validate) or (for_validate and not item.get(fname)):
|
if (not for_validate) or (for_validate and not item.get(fname)):
|
||||||
item.set(fname, val)
|
item.set(fname, val)
|
||||||
|
|
||||||
|
if not for_validate:
|
||||||
|
dn_flag = any(d.get("dn_detail") for d in self.get("items"))
|
||||||
|
self.update_stock = 0 if dn_flag else cint(pos.get("update_stock"))
|
||||||
|
|
||||||
# fetch terms
|
# fetch terms
|
||||||
if self.tc_name and not self.terms:
|
if self.tc_name and not self.terms:
|
||||||
self.terms = frappe.db.get_value("Terms and Conditions", self.tc_name, "terms")
|
self.terms = frappe.db.get_value("Terms and Conditions", self.tc_name, "terms")
|
||||||
|
|||||||
Reference in New Issue
Block a user