mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-05 05:09:11 +00:00
Merge branch 'develop' into separate-discount-account
This commit is contained in:
@@ -1,36 +0,0 @@
|
||||
# Copyright (c) 2019, Frappe and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
|
||||
import frappe
|
||||
|
||||
|
||||
def execute():
|
||||
"""Move account number into the new custom field debtor_creditor_number.
|
||||
|
||||
German companies used to use a dedicated payable/receivable account for
|
||||
every party to mimick party accounts in the external accounting software
|
||||
"DATEV". This is no longer necessary. The reference ID for DATEV will be
|
||||
stored in a new custom field "debtor_creditor_number".
|
||||
"""
|
||||
company_list = frappe.get_all("Company", filters={"country": "Germany"})
|
||||
|
||||
for company in company_list:
|
||||
party_account_list = frappe.get_all(
|
||||
"Party Account",
|
||||
filters={"company": company.name},
|
||||
fields=["name", "account", "debtor_creditor_number"],
|
||||
)
|
||||
for party_account in party_account_list:
|
||||
if (not party_account.account) or party_account.debtor_creditor_number:
|
||||
# account empty or debtor_creditor_number already filled
|
||||
continue
|
||||
|
||||
account_number = frappe.db.get_value("Account", party_account.account, "account_number")
|
||||
if not account_number:
|
||||
continue
|
||||
|
||||
frappe.db.set_value(
|
||||
"Party Account", party_account.name, "debtor_creditor_number", account_number
|
||||
)
|
||||
frappe.db.set_value("Party Account", party_account.name, "account", "")
|
||||
@@ -1,20 +0,0 @@
|
||||
# Copyright (c) 2019, Frappe and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
|
||||
import frappe
|
||||
|
||||
from erpnext.regional.germany.setup import make_custom_fields
|
||||
|
||||
|
||||
def execute():
|
||||
"""Execute the make_custom_fields method for german companies.
|
||||
|
||||
It is usually run once at setup of a new company. Since it's new, run it
|
||||
once for existing companies as well.
|
||||
"""
|
||||
company_list = frappe.get_all("Company", filters={"country": "Germany"})
|
||||
if not company_list:
|
||||
return
|
||||
|
||||
make_custom_fields()
|
||||
13
erpnext/patches/v14_0/delete_datev_doctypes.py
Normal file
13
erpnext/patches/v14_0/delete_datev_doctypes.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import frappe
|
||||
|
||||
|
||||
def execute():
|
||||
install_apps = frappe.get_installed_apps()
|
||||
if "erpnext_datev_uo" in install_apps or "erpnext_datev" in install_apps:
|
||||
return
|
||||
|
||||
# doctypes
|
||||
frappe.delete_doc("DocType", "DATEV Settings", ignore_missing=True, force=True)
|
||||
|
||||
# reports
|
||||
frappe.delete_doc("Report", "DATEV", ignore_missing=True, force=True)
|
||||
Reference in New Issue
Block a user