Merge pull request #21163 from deepeshgarg007/gst_3b_user_perm

fix: User permissions in GSTR 3B report
This commit is contained in:
Deepesh Garg 2020-04-04 21:48:23 +05:30 committed by GitHub
commit 0268c553a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 24 deletions

View File

@ -581,7 +581,7 @@ erpnext.patches.v11_0.rename_bom_wo_fields
erpnext.patches.v12_0.set_default_homepage_type erpnext.patches.v12_0.set_default_homepage_type
erpnext.patches.v11_0.rename_additional_salary_component_additional_salary erpnext.patches.v11_0.rename_additional_salary_component_additional_salary
erpnext.patches.v11_0.renamed_from_to_fields_in_project erpnext.patches.v11_0.renamed_from_to_fields_in_project
erpnext.patches.v11_0.add_permissions_in_gst_settings erpnext.patches.v11_0.add_permissions_in_gst_settings #2020-04-04
erpnext.patches.v11_1.setup_guardian_role erpnext.patches.v11_1.setup_guardian_role
execute:frappe.delete_doc('DocType', 'Notification Control') execute:frappe.delete_doc('DocType', 'Notification Control')
erpnext.patches.v12_0.set_gst_category erpnext.patches.v12_0.set_gst_category

View File

@ -1,12 +1,9 @@
import frappe import frappe
from frappe.permissions import add_permission, update_permission_property from erpnext.regional.india.setup import add_permissions
def execute(): def execute():
company = frappe.get_all('Company', filters = {'country': 'India'}) company = frappe.get_all('Company', filters = {'country': 'India'})
if not company: if not company:
return return
for doctype in ('GST HSN Code', 'GST Settings'): add_permissions()
add_permission(doctype, 'Accounts Manager', 0)
update_permission_property(doctype, 'Accounts Manager', 0, 'write', 1)
update_permission_property(doctype, 'Accounts Manager', 0, 'create', 1)

View File

@ -29,7 +29,7 @@
</thead> </thead>
<tbody> <tbody>
<tr> <tr>
<td>(a) {{__("Outward taxable supplies(other than zero rated, nil rated and exempted")}}</td> <td>(a) {{__("Outward taxable supplies(other than zero rated, nil rated and exempted)")}}</td>
<td class="right">{{ flt(data.sup_details.osup_det.txval, 2) }}</td> <td class="right">{{ flt(data.sup_details.osup_det.txval, 2) }}</td>
<td class="right">{{ flt(data.sup_details.osup_det.iamt, 2) }}</td> <td class="right">{{ flt(data.sup_details.osup_det.iamt, 2) }}</td>
<td class="right">{{ flt(data.sup_details.osup_det.camt, 2) }}</td> <td class="right">{{ flt(data.sup_details.osup_det.camt, 2) }}</td>

View File

@ -1,4 +1,5 @@
{ {
"actions": [],
"autoname": "format:GSTR3B-{month}-{year}-{company_address}", "autoname": "format:GSTR3B-{month}-{year}-{company_address}",
"creation": "2019-02-04 11:35:55.964639", "creation": "2019-02-04 11:35:55.964639",
"doctype": "DocType", "doctype": "DocType",
@ -48,25 +49,13 @@
"read_only": 1 "read_only": 1
} }
], ],
"modified": "2019-08-10 22:30:26.727038", "links": [],
"modified": "2020-04-04 19:32:30.772908",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Regional", "module": "Regional",
"name": "GSTR 3B Report", "name": "GSTR 3B Report",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [],
{
"create": 1,
"delete": 1,
"email": 1,
"export": 1,
"print": 1,
"read": 1,
"report": 1,
"role": "System Manager",
"share": 1,
"write": 1
}
],
"sort_field": "modified", "sort_field": "modified",
"sort_order": "DESC", "sort_order": "DESC",
"track_changes": 1 "track_changes": 1

View File

@ -77,9 +77,15 @@ def add_custom_roles_for_reports():
)).insert() )).insert()
def add_permissions(): def add_permissions():
for doctype in ('GST HSN Code', 'GST Settings'): for doctype in ('GST HSN Code', 'GST Settings', 'GSTR 3B Report'):
add_permission(doctype, 'All', 0) add_permission(doctype, 'All', 0)
for role in ('Accounts Manager', 'System Manager', 'Item Manager', 'Stock Manager'): for role in ('Accounts Manager', 'Accounts User', 'System Manager'):
add_permission(doctype, role, 0)
update_permission_property(doctype, role, 0, 'write', 1)
update_permission_property(doctype, role, 0, 'create', 1)
if doctype == 'GST HSN Code':
for role in ('Item Manager', 'Stock Manager'):
add_permission(doctype, role, 0) add_permission(doctype, role, 0)
update_permission_property(doctype, role, 0, 'write', 1) update_permission_property(doctype, role, 0, 'write', 1)
update_permission_property(doctype, role, 0, 'create', 1) update_permission_property(doctype, role, 0, 'create', 1)