fix: reset update outstanding flag for old records

(cherry picked from commit a88bf8419e)
This commit is contained in:
ruthra kumar
2024-03-22 16:11:05 +05:30
parent 1c6f5b6525
commit 73c534cf1a
2 changed files with 9 additions and 1 deletions

View File

@@ -354,7 +354,7 @@ execute:frappe.db.set_single_value("Buying Settings", "project_update_frequency"
erpnext.patches.v14_0.clear_reconciliation_values_from_singles
erpnext.patches.v14_0.update_total_asset_cost_field
erpnext.patches.v14_0.create_accounting_dimensions_in_reconciliation_tool
erpnext.patches.v14_0.update_flag_for_return_invoices
erpnext.patches.v14_0.update_flag_for_return_invoices #2024-03-22
# below migration patch should always run last
erpnext.patches.v14_0.migrate_gl_to_payment_ledger
erpnext.stock.doctype.delivery_note.patches.drop_unused_return_against_index # 2023-12-20

View File

@@ -12,6 +12,10 @@ def execute():
creation_date = "2024-01-25"
si = qb.DocType("Sales Invoice")
# unset flag, as migration would have set it for all records, as the field was introduced with default '1'
qb.update(si).set(si.update_outstanding_for_self, False).run()
if cr_notes := (
qb.from_(si)
.select(si.name)
@@ -37,6 +41,10 @@ def execute():
).run()
pi = qb.DocType("Purchase Invoice")
# unset flag, as migration would have set it for all records, as the field was introduced with default '1'
qb.update(pi).set(pi.update_outstanding_for_self, False).run()
if dr_notes := (
qb.from_(pi)
.select(pi.name)