mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-19 04:59:18 +00:00
[fix] [patch] party model patch
This commit is contained in:
@@ -102,6 +102,7 @@ execute:frappe.reload_doc('crm', 'doctype', 'opportunity')
|
|||||||
erpnext.patches.v5_0.rename_table_fieldnames
|
erpnext.patches.v5_0.rename_table_fieldnames
|
||||||
execute:frappe.db.sql("update `tabJournal Entry` set voucher_type='Journal Entry' where ifnull(voucher_type, '')=''")
|
execute:frappe.db.sql("update `tabJournal Entry` set voucher_type='Journal Entry' where ifnull(voucher_type, '')=''")
|
||||||
erpnext.patches.v4_2.party_model
|
erpnext.patches.v4_2.party_model
|
||||||
|
erpnext.patches.v5_0.party_model_patch_fix
|
||||||
erpnext.patches.v4_1.fix_jv_remarks
|
erpnext.patches.v4_1.fix_jv_remarks
|
||||||
erpnext.patches.v4_2.update_landed_cost_voucher
|
erpnext.patches.v4_2.update_landed_cost_voucher
|
||||||
erpnext.patches.v4_2.set_item_has_batch
|
erpnext.patches.v4_2.set_item_has_batch
|
||||||
|
|||||||
18
erpnext/patches/v5_0/party_model_patch_fix.py
Normal file
18
erpnext/patches/v5_0/party_model_patch_fix.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
from __future__ import unicode_literals
|
||||||
|
import frappe
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
for company in frappe.get_all("Company",
|
||||||
|
["name", "default_receivable_account", "default_payable_account"]):
|
||||||
|
|
||||||
|
if company.default_receivable_account:
|
||||||
|
frappe.db.sql("""update `tabSales Invoice` invoice set `debit_to`=%(account)s
|
||||||
|
where company=%(company)s
|
||||||
|
and not exists (select name from `tabAccount` account where account.name=invoice.debit_to)""",
|
||||||
|
{"company": company.name, "account": company.default_receivable_account})
|
||||||
|
|
||||||
|
if company.default_payable_account:
|
||||||
|
frappe.db.sql("""update `tabPurchase Invoice` invoice set `credit_to`=%(account)s
|
||||||
|
where company=%(company)s
|
||||||
|
and not exists (select name from `tabAccount` account where account.name=invoice.credit_to)""",
|
||||||
|
{"company": company.name, "account": company.default_payable_account})
|
||||||
@@ -157,9 +157,6 @@ rename_map = {
|
|||||||
["pp_so_details", "sales_orders"],
|
["pp_so_details", "sales_orders"],
|
||||||
["pp_details", "items"]
|
["pp_details", "items"]
|
||||||
],
|
],
|
||||||
"Project": [
|
|
||||||
["project_milestones", "milestones"]
|
|
||||||
],
|
|
||||||
"Quality Inspection": [
|
"Quality Inspection": [
|
||||||
["qa_specification_details", "readings"]
|
["qa_specification_details", "readings"]
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in New Issue
Block a user