mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-30 07:08:24 +00:00
fix: purchase return issue
This commit is contained in:
@@ -51,7 +51,7 @@ class BuyingController(SubcontractingController):
|
||||
self.validate_purchase_receipt_if_update_stock()
|
||||
|
||||
if self.doctype == "Purchase Receipt" or (self.doctype == "Purchase Invoice" and self.update_stock):
|
||||
# self.validate_purchase_return()
|
||||
self.validate_purchase_return()
|
||||
self.validate_rejected_warehouse()
|
||||
self.validate_accepted_rejected_qty()
|
||||
validate_for_items(self)
|
||||
@@ -682,15 +682,8 @@ class BuyingController(SubcontractingController):
|
||||
|
||||
def validate_purchase_return(self):
|
||||
for d in self.get("items"):
|
||||
if self.is_return and flt(d.rejected_qty) != 0:
|
||||
frappe.throw(
|
||||
_("Row #{idx}: {field_label} is not allowed in Purchase Return.").format(
|
||||
idx=d.idx,
|
||||
field_label=_(d.meta.get_label("rejected_qty")),
|
||||
)
|
||||
)
|
||||
|
||||
# validate rate with ref PR
|
||||
if self.is_return and not flt(d.rejected_qty) and d.rejected_warehouse:
|
||||
d.rejected_warehouse = None
|
||||
|
||||
# validate accepted and rejected qty
|
||||
def validate_accepted_rejected_qty(self):
|
||||
|
||||
Reference in New Issue
Block a user