blob: 5d482030233450b733730f87b4a60209f6ea31d4 [file] [log] [blame]
Charles-Henri Decultot90657fb2018-01-23 11:10:14 +01001# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and Contributors
2# License: GNU General Public License v3. See license.txt
3
Charles-Henri Decultot90657fb2018-01-23 11:10:14 +01004
5import frappe
6from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
7
8def setup(company=None, patch=True):
9 make_custom_fields()
10 add_custom_roles_for_reports()
11
12def make_custom_fields():
13 custom_fields = {
14 'Company': [
15 dict(fieldname='siren_number', label='SIREN Number',
16 fieldtype='Data', insert_after='website')
17 ]
18 }
19
20 create_custom_fields(custom_fields)
21
22def add_custom_roles_for_reports():
23 report_name = 'Fichier des Ecritures Comptables [FEC]'
24
25 if not frappe.db.get_value('Custom Role', dict(report=report_name)):
26 frappe.get_doc(dict(
27 doctype='Custom Role',
28 report=report_name,
29 roles= [
30 dict(role='Accounts Manager')
31 ]
32 )).insert()