mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-19 23:05:12 +00:00
fix: Unable to submit landed cost voucher (#20978)
This commit is contained in:
@@ -104,7 +104,6 @@ class LandedCostVoucher(Document):
|
||||
def update_landed_cost(self):
|
||||
for d in self.get("purchase_receipts"):
|
||||
doc = frappe.get_doc(d.receipt_document_type, d.receipt_document)
|
||||
|
||||
# check if there are {qty} assets created and linked to this receipt document
|
||||
self.validate_asset_qty_and_status(d.receipt_document_type, doc)
|
||||
|
||||
@@ -123,6 +122,8 @@ class LandedCostVoucher(Document):
|
||||
# update latest valuation rate in serial no
|
||||
self.update_rate_in_serial_no_for_non_asset_items(doc)
|
||||
|
||||
for d in self.get("purchase_receipts"):
|
||||
doc = frappe.get_doc(d.receipt_document_type, d.receipt_document)
|
||||
# update stock & gl entries for cancelled state of PR
|
||||
doc.docstatus = 2
|
||||
doc.update_stock_ledger(allow_negative_stock=True, via_landed_cost_voucher=True)
|
||||
|
||||
Reference in New Issue
Block a user