brotherton-erpnext/erpnext/regional/france/setup.py

31 lines
808 B
Python
Raw Normal View History

# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
2022-03-28 13:22:46 +00:00
def setup(company=None, patch=True):
make_custom_fields()
add_custom_roles_for_reports()
2022-03-28 13:22:46 +00:00
def make_custom_fields():
custom_fields = {
2022-03-28 13:22:46 +00:00
"Company": [
dict(fieldname="siren_number", label="SIREN Number", fieldtype="Data", insert_after="website")
]
}
create_custom_fields(custom_fields)
2022-03-28 13:22:46 +00:00
def add_custom_roles_for_reports():
2022-03-28 13:22:46 +00:00
report_name = "Fichier des Ecritures Comptables [FEC]"
if not frappe.db.get_value("Custom Role", dict(report=report_name)):
frappe.get_doc(
dict(doctype="Custom Role", report=report_name, roles=[dict(role="Accounts Manager")])
).insert()