From 77ad668a6f4ae392846fcc3f6941b88d41db9d79 Mon Sep 17 00:00:00 2001 From: Frappe PR Bot Date: Wed, 18 Aug 2021 18:02:59 +0530 Subject: [PATCH] fix: date_unchanged calculation in "Update Items" (#26992) (#27010) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Branch corrected https://github.com/frappe/erpnext/pull/26058 ERPNext generates "Cannot set quantity less than delivered quantity" error even the delivered qty is zero when user clicks "Update Items". "date_unchanged" variable gets false value because of new_date is string. "getdate(new_date)" corrects the date comparison. ![ERPNext_PR](https://user-images.githubusercontent.com/710051/121928377-c0263180-cd48-11eb-8cd9-eda7dace09d6.gif) (cherry picked from commit d8a7abcd02f674bf6c4270a817ae9762a0b57140) Co-authored-by: Türker Tunalı --- erpnext/controllers/accounts_controller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 73d2411edef..803e5394fa9 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -1863,7 +1863,7 @@ def update_child_qty_rate(parent_doctype, trans_items, parent_doctype_name, chil qty_unchanged = prev_qty == new_qty uom_unchanged = prev_uom == new_uom conversion_factor_unchanged = prev_con_fac == new_con_fac - date_unchanged = prev_date == new_date if prev_date and new_date else False # in case of delivery note etc + date_unchanged = prev_date == getdate(new_date) if prev_date and new_date else False # in case of delivery note etc if rate_unchanged and qty_unchanged and conversion_factor_unchanged and uom_unchanged and date_unchanged: continue