fix: Allow item rate udpates for non-stock invoices

(cherry picked from commit ef9d126254)
This commit is contained in:
Deepesh Garg
2022-12-05 10:17:19 +05:30
committed by Mergify
parent cea7a32abc
commit 030765618b
4 changed files with 41 additions and 35 deletions

View File

@@ -322,17 +322,18 @@ class BuyingController(SubcontractingController):
)
if self.is_internal_transfer():
if rate != d.rate:
d.rate = rate
frappe.msgprint(
_(
"Row {0}: Item rate has been updated as per valuation rate since its an internal stock transfer"
).format(d.idx),
alert=1,
)
d.discount_percentage = 0.0
d.discount_amount = 0.0
d.margin_rate_or_amount = 0.0
if self.doctype == "Purchase Receipt" or self.get("update_stock"):
if rate != d.rate:
d.rate = rate
frappe.msgprint(
_(
"Row {0}: Item rate has been updated as per valuation rate since its an internal stock transfer"
).format(d.idx),
alert=1,
)
d.discount_percentage = 0.0
d.discount_amount = 0.0
d.margin_rate_or_amount = 0.0
def validate_for_subcontracting(self):
if self.is_subcontracted and self.get("is_old_subcontracting_flow"):