Skip to content

Commit

Permalink
Merge pull request #17 from alyf-de/perms
Browse files Browse the repository at this point in the history
  • Loading branch information
barredterra authored Jul 15, 2024
2 parents 3a3815f + f336731 commit 17480cd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
13 changes: 10 additions & 3 deletions erpnext_datev/erpnext_datev/report/datev/datev.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"add_total_row": 0,
"columns": [],
"creation": "2022-02-17 23:29:46.760108",
"disable_prepared_report": 0,
"disabled": 0,
"docstatus": 0,
"doctype": "Report",
"filters": [],
"idx": 0,
"is_standard": "Yes",
"modified": "2022-04-13 04:22:14.774093",
"letterhead": null,
"modified": "2024-07-15 23:10:51.572551",
"modified_by": "Administrator",
"module": "Erpnext Datev",
"name": "DATEV",
Expand All @@ -18,5 +18,12 @@
"ref_doctype": "GL Entry",
"report_name": "DATEV",
"report_type": "Script Report",
"roles": []
"roles": [
{
"role": "Accounts User"
},
{
"role": "Accounts Manager"
}
]
}
13 changes: 0 additions & 13 deletions erpnext_datev/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

def after_install():
make_custom_fields()
add_custom_roles_for_reports()


def make_custom_fields():
Expand All @@ -21,15 +20,3 @@ def make_custom_fields():
}

create_custom_fields(custom_fields)


def add_custom_roles_for_reports():
"""Add Access Control to DATEV."""
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()
4 changes: 4 additions & 0 deletions erpnext_datev/patches.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[pre_model_sync]

[post_model_sync]
execute:frappe.db.delete("Custom Role", {"report": "DATEV"})

0 comments on commit 17480cd

Please sign in to comment.