fix: patch fails if accounts are frozen
(cherry picked from commit b0aa4a6e1c)
This commit is contained in:
committed by
mergify-bot
parent
c5660e8511
commit
7e44c30404
@@ -317,7 +317,7 @@ erpnext.patches.v13_0.replace_supplier_item_group_with_party_specific_item
|
||||
erpnext.patches.v13_0.gst_fields_for_pos_invoice
|
||||
erpnext.patches.v13_0.create_accounting_dimensions_in_pos_doctypes
|
||||
erpnext.patches.v13_0.create_custom_field_for_finance_book
|
||||
erpnext.patches.v13_0.modify_invalid_gain_loss_gl_entries
|
||||
erpnext.patches.v13_0.modify_invalid_gain_loss_gl_entries #2
|
||||
erpnext.patches.v13_0.fix_additional_cost_in_mfg_stock_entry
|
||||
erpnext.patches.v13_0.shopping_cart_to_ecommerce
|
||||
erpnext.patches.v13_0.set_status_in_maintenance_schedule_table
|
||||
|
||||
@@ -17,7 +17,7 @@ def execute():
|
||||
where
|
||||
ref_exchange_rate = 1
|
||||
and docstatus = 1
|
||||
and ifnull(exchange_gain_loss, '') != ''
|
||||
and ifnull(exchange_gain_loss, 0) != 0
|
||||
group by
|
||||
parent
|
||||
""", as_dict=1)
|
||||
@@ -30,7 +30,7 @@ def execute():
|
||||
where
|
||||
ref_exchange_rate = 1
|
||||
and docstatus = 1
|
||||
and ifnull(exchange_gain_loss, '') != ''
|
||||
and ifnull(exchange_gain_loss, 0) != 0
|
||||
group by
|
||||
parent
|
||||
""", as_dict=1)
|
||||
@@ -38,6 +38,8 @@ def execute():
|
||||
if purchase_invoices + sales_invoices:
|
||||
frappe.log_error(json.dumps(purchase_invoices + sales_invoices, indent=2), title="Patch Log")
|
||||
|
||||
acc_frozen_upto = frappe.db.get_value('Accounts Settings', None, 'acc_frozen_upto')
|
||||
frappe.db.set_value('Accounts Settings', None, 'acc_frozen_upto', None)
|
||||
for invoice in purchase_invoices + sales_invoices:
|
||||
doc = frappe.get_doc(invoice.type, invoice.name)
|
||||
doc.docstatus = 2
|
||||
@@ -46,4 +48,5 @@ def execute():
|
||||
if advance.ref_exchange_rate == 1:
|
||||
advance.db_set('exchange_gain_loss', 0, False)
|
||||
doc.docstatus = 1
|
||||
doc.make_gl_entries()
|
||||
doc.make_gl_entries()
|
||||
frappe.db.set_value('Accounts Settings', None, 'acc_frozen_upto', acc_frozen_upto)
|
||||
Reference in New Issue
Block a user