blob: db6419e946248e4fc5ac72316c0061669c7c964c [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
4from __future__ import unicode_literals
5
6import frappe
7from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
8
9def setup(company=None, patch=True):
10 make_custom_fields()
11 add_custom_roles_for_reports()
12
13def make_custom_fields():
14 custom_fields = {
15 'Company': [
16 dict(fieldname='siren_number', label='SIREN Number',
17 fieldtype='Data', insert_after='website')
18 ]
19 }
20
21 create_custom_fields(custom_fields)
22
23def add_custom_roles_for_reports():
24 report_name = 'Fichier des Ecritures Comptables [FEC]'
25
26 if not frappe.db.get_value('Custom Role', dict(report=report_name)):
27 frappe.get_doc(dict(
28 doctype='Custom Role',
29 report=report_name,
30 roles= [
31 dict(role='Accounts Manager')
32 ]
33 )).insert()