2019-02-07 02:28:27 +00:00
|
|
|
import frappe
|
2021-04-07 18:03:59 +00:00
|
|
|
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
|
2019-02-07 02:28:27 +00:00
|
|
|
|
2019-01-27 22:32:41 +00:00
|
|
|
|
|
|
|
def setup(company=None, patch=True):
|
2021-04-07 18:03:59 +00:00
|
|
|
make_custom_fields()
|
2021-04-13 10:16:01 +00:00
|
|
|
add_custom_roles_for_reports()
|
2021-04-07 18:03:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
def make_custom_fields():
|
|
|
|
custom_fields = {
|
2022-03-28 13:22:46 +00:00
|
|
|
"Party Account": [
|
|
|
|
dict(
|
|
|
|
fieldname="debtor_creditor_number",
|
|
|
|
label="Debtor/Creditor Number",
|
|
|
|
fieldtype="Data",
|
|
|
|
insert_after="account",
|
|
|
|
translatable=0,
|
|
|
|
)
|
2021-04-07 18:03:59 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
create_custom_fields(custom_fields)
|
2021-04-16 10:37:14 +00:00
|
|
|
|
|
|
|
|
2021-04-13 10:16:01 +00:00
|
|
|
def add_custom_roles_for_reports():
|
|
|
|
"""Add Access Control to UAE VAT 201."""
|
2022-03-28 13:22:46 +00:00
|
|
|
if not frappe.db.get_value("Custom Role", dict(report="DATEV")):
|
|
|
|
frappe.get_doc(
|
|
|
|
dict(
|
|
|
|
doctype="Custom Role",
|
|
|
|
report="DATEV",
|
|
|
|
roles=[dict(role="Accounts User"), dict(role="Accounts Manager")],
|
|
|
|
)
|
|
|
|
).insert()
|