From 312db429e4605d6d0ce47d1034662fdf0ec053b7 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Sat, 19 Feb 2022 16:26:17 +0530 Subject: [PATCH] refactor: use qb for patching flag --- erpnext/patches/v14_0/update_batch_valuation_flag.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/erpnext/patches/v14_0/update_batch_valuation_flag.py b/erpnext/patches/v14_0/update_batch_valuation_flag.py index d9f08d8d97b..55c8c48aa21 100644 --- a/erpnext/patches/v14_0/update_batch_valuation_flag.py +++ b/erpnext/patches/v14_0/update_batch_valuation_flag.py @@ -6,7 +6,6 @@ def execute(): - Don't use batchwise valuation for existing batches. - Only batches created after this patch shoule use it. """ - frappe.db.sql(""" - UPDATE `tabBatch` - SET use_batchwise_valuation=0 - """) + + batch = frappe.qb.DocType("Batch") + frappe.qb.update(batch).set(batch.use_batchwise_valuation, 0).run()