From f65afac353e2ffb38c8595877ced350dfa63cba1 Mon Sep 17 00:00:00 2001 From: Shreya Shah Date: Wed, 21 Feb 2018 11:12:04 +0530 Subject: [PATCH] db_update instead of save to avoid unnecessary validations (#13009) --- .../doctype/landed_cost_voucher/landed_cost_voucher.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py b/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py index f51652cf15..d36b6cf827 100644 --- a/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py +++ b/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py @@ -109,9 +109,9 @@ class LandedCostVoucher(Document): # set valuation amount in pr item doc.update_valuation_rate("items") - # save will update landed_cost_voucher_amount and voucher_amount in PR, - # as those fields are allowed to edit after submit - doc.save() + # db_update will update and save landed_cost_voucher_amount and voucher_amount in PR + for item in doc.get("items"): + item.db_update() # update latest valuation rate in serial no self.update_rate_in_serial_no(doc)