mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-06 13:49:13 +00:00
advance paid should not be copied and patch to fix affected records
This commit is contained in:
13
erpnext/patches/v4_2/update_advance_paid.py
Normal file
13
erpnext/patches/v4_2/update_advance_paid.py
Normal file
@@ -0,0 +1,13 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
def execute():
|
||||
for dt in ("Sales Order", "Purchase Order"):
|
||||
orders_with_advance = frappe.db.sql("""select name from `tab{0}`
|
||||
where docstatus < 2 and ifnull(advance_paid, 0) != 0""".format(dt), as_dict=1)
|
||||
|
||||
for order in orders_with_advance:
|
||||
frappe.get_doc(dt, order.name).set_total_advance_paid()
|
||||
Reference in New Issue
Block a user