[added] domainify.py

This commit is contained in:
Rushabh Mehta 2016-05-11 15:13:44 +05:30
parent b81ed45b2b
commit 2dd0581134
4 changed files with 57 additions and 67 deletions

View File

@ -3,6 +3,7 @@
"allow_import": 1,
"allow_rename": 0,
"autoname": "naming_series:",
"beta": 0,
"creation": "2013-01-10 16:34:16",
"custom": 0,
"docstatus": 0,
@ -1089,7 +1090,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2016-04-18 08:42:47.582203",
"modified": "2016-05-11 12:17:29.480533",
"modified_by": "Administrator",
"module": "Manufacturing",
"name": "Production Order",
@ -1114,26 +1115,6 @@
"share": 1,
"submit": 1,
"write": 1
},
{
"amend": 0,
"apply_user_permissions": 0,
"cancel": 0,
"create": 0,
"delete": 0,
"email": 0,
"export": 0,
"if_owner": 0,
"import": 0,
"permlevel": 0,
"print": 0,
"read": 1,
"report": 1,
"role": "Stock User",
"set_user_permissions": 0,
"share": 0,
"submit": 0,
"write": 0
}
],
"quick_entry": 1,

View File

@ -124,49 +124,3 @@
.dashboard-list-item:last-child {
border-bottom: none;
}
.payment-toolbar {
margin-left: 35px;
}
.payment-mode {
cursor: pointer;
font-family: sans-serif;
font-size: 15px;
}
.pos-payment-row .col-xs-6 {
padding :10px;
}
.pos-payment-row {
border-bottom:1px solid #d1d8dd;
margin: 2px 0px 5px 0px;
}
.pos-payment-row:hover {
background-color: #FCFFDD;
cursor: pointer;
}
.pos-keyboard-key, .delete-btn {
border: 1px solid #d1d8dd;
height:85px;
width:85px;
margin:10px 10px;
font-size:24px;
font-weight:200;
}
.amount-label {
font-size: 16px;
}
.selected-payment-mode {
background-color: #FCFFDD;
cursor: pointer;
}
.pos-invoice-list {
padding: 15px 10px;
}

View File

@ -0,0 +1,53 @@
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# See license.txt
from __future__ import unicode_literals
import frappe
domains = {
'Manufacturing': {
'desktop_icons': ['Item', 'BOM', 'Customer', 'Supplier', 'Sales Order',
'Production Order', 'Stock Entry', 'Buying', 'Selling', 'Accounts']
},
'Retail': {
'remove_roles': ['Manufacturing User', 'Manufacturing Manager', 'Maintenance User'],
'desktop_icons': ['POS', 'Item', 'Customer', 'Sales Invoice', 'Accounts']
},
'Distribution': {
'remove_roles': ['Manufacturing User', 'Manufacturing Manager', 'Maintenance User'],
},
'Services': {
'desktop_icons': ['Project', 'Time Log', 'Customer', 'Sales Invoice', 'Lead', 'Opportunity',
'Expense Claim', 'Employee'],
'remove_roles': ['Manufacturing User', 'Manufacturing Manager', 'Maintenance User'],
'properties': [
{'doctype': 'Item', 'fieldname': 'is_stock_item', 'property': 'default', 'value': 0}
]
}
}
def setup_domain(domain):
if not domain in domains:
return
from frappe.desk.doctype.desktop_icon.desktop_icon import set_desktop_icons
data = frappe._dict(domains[domain])
if data.remove_roles:
for role in data.remove_roles:
frappe.db.sql('delete from tabUserRole where role=%s', role)
if data.desktop_icons:
set_desktop_icons(data.desktop_icons)
if data.properties:
for args in data.properties:
frappe.make_property_setter(args)
frappe.clear_cache()
def reset():
from frappe.desk.page.setup_wizard.setup_wizard import add_all_roles_to
add_all_roles_to('Administrator')
frappe.db.sql('delete from `tabProperty Setter`')

View File

@ -12,6 +12,7 @@ import install_fixtures
from .sample_data import make_sample_data
from erpnext.accounts.doctype.account.account import RootNotEditable
from frappe.core.doctype.communication.comment import add_info_comment
from erpnext.setup.setup_wizard.domainify import setup_domain
def setup_complete(args=None):
if frappe.db.sql("select name from tabCompany"):
@ -32,6 +33,7 @@ def setup_complete(args=None):
create_customers(args)
create_suppliers(args)
frappe.local.message_log = []
setup_domain(args.get('domain'))
website_maker(args.company_name.strip(), args.company_tagline, args.name)
create_logo(args)