def update(hidden_list, user=None):
    """update modules"""
    if not user:
        frappe.only_for('System Manager')

    set_hidden_list(hidden_list, user)
    frappe.msgprint(frappe._('Updated'))
Ejemplo n.º 2
0
	def test_show_desktop_icon(self):
		self.test_hide_desktop_icon()
		set_hidden_list([], '*****@*****.**')

		icon = self.get_icon('Desk')
		self.assertEqual(icon.hidden, 0)
		self.assertEqual(icon.standard, 0)
Ejemplo n.º 3
0
def update(hidden_list, user=None):
	"""update modules"""
	if not user:
		frappe.only_for('System Manager')

	set_hidden_list(hidden_list, user)
	frappe.msgprint(frappe._('Updated'))
Ejemplo n.º 4
0
def block_modules():
	modules= [
		"Accounts","Buying","CRM","Core",
		"Desk","File Manager","HR","Learn","Manufacturing","POS","Projects",
		"Selling","Stock","Support","Website"
	]
	set_hidden_list(modules)
Ejemplo n.º 5
0
def update(hidden_list, user=None):
	"""update modules"""
	if not user:
		frappe.only_for('System Manager')

	set_hidden_list(hidden_list, user)
	frappe.msgprint(frappe._('Updated'), indicator='green', title=_('Success'), alert=True)
Ejemplo n.º 6
0
	def test_globally_hidden_desktop_icon(self):
		set_hidden_list(["Desk"])

		icon = self.get_icon('Desk')
		self.assertEqual(icon.hidden, 1)

		frappe.set_user('*****@*****.**')
		icon = self.get_icon('Desk')
		self.assertEqual(icon.hidden, 1)
Ejemplo n.º 7
0
def update(hidden_list, user=None):
    """update modules"""
    if not user:
        frappe.only_for('System Manager')

    set_hidden_list(hidden_list, user)
    frappe.msgprint(frappe._('Updated'),
                    indicator='green',
                    title=_('Success'),
                    alert=True)
Ejemplo n.º 8
0
	def test_remove_custom_desktop_icon_on_hidden(self):
		self.test_add_desktop_icon()
		set_hidden_list(['User'], '*****@*****.**')

		icon = self.get_icon('User')
		self.assertEqual(icon, None)
Ejemplo n.º 9
0
def setup_complete(args=None):

    if frappe.db.sql("select name from tabCompany"):
        frappe.throw(_("Setup Already Complete!!"))

    install_fixtures.install(args.get("country"))

    create_price_lists(args)
    create_fiscal_year_and_company(args)
    create_sales_tax(args)
    create_users(args)
    set_defaults(args)
    create_professional_contact_card(args)
    create_territories()
    create_feed_and_todo()
    create_email_digest()
    create_letter_head(args)
    create_taxes(args)
    create_items(args)
    create_customers(args)
    create_suppliers(args)
    create_midwife_tax_template(args)

    install_fixtures.codifications(args.get("country"))

    #website_maker(args)

    create_logo(args)

    frappe.local.message_log = []
    setup_domain(args.get('domain'))

    frappe.db.commit()
    login_as_first_user(args)

    frappe.db.commit()
    frappe.clear_cache()

    set_mode_of_payment_account(args)
    frappe.db.commit()

    correct_midwife_accounts(args)

    initial_list = [
        'Stock', 'Manufacturing', 'Learn', 'Buying', 'Selling', 'Support',
        'Integrations', 'Maintenance', 'Schools', 'HR', 'CRM', 'Employee',
        'Issue', 'Lead', 'POS', 'Student', 'Student Group', 'Course Schedule',
        'Student Attendance', 'Course', 'Program', 'Student Applicant', 'Fees',
        'Instructor', 'Room'
    ]
    hidden_list = []

    for i in initial_list:
        try:
            frappe.get_doc('Desktop Icon', {'standard': 1, 'module_name': i})
            hidden_list.append(i)
        except Exception:
            pass

    set_hidden_list(hidden_list)

    if args.get("add_sample_data"):
        try:
            make_sample_data(args)
            frappe.clear_cache()
        except:
            # clear message
            if frappe.message_log:
                frappe.message_log.pop()

            pass
Ejemplo n.º 10
0
	def test_hide_desktop_icon(self):
		set_hidden_list(["Desk"], '*****@*****.**')

		icon = self.get_icon('Desk')
		self.assertEquals(icon.hidden, 1)
		self.assertEquals(icon.standard, 0)