Letterhead in user progress (#11679)

* added letter-head to user progress slides

* added letterhead action to patch

* improvised

* added date in patches.txt
This commit is contained in:
Shreya Shah 2017-11-28 16:09:58 +05:30 committed by Nabin Hait
parent de82fe9e8f
commit 8d9edbf133
5 changed files with 38 additions and 1 deletions

View File

@ -439,7 +439,7 @@ erpnext.patches.v8_7.add_more_gst_fields #21-09-2017
erpnext.patches.v8_7.fix_purchase_receipt_status erpnext.patches.v8_7.fix_purchase_receipt_status
erpnext.patches.v8_6.rename_bom_update_tool erpnext.patches.v8_6.rename_bom_update_tool
erpnext.patches.v8_7.set_offline_in_pos_settings #11-09-17 erpnext.patches.v8_7.set_offline_in_pos_settings #11-09-17
erpnext.patches.v8_9.add_setup_progress_actions #08-09-2017 #26-09-2017 erpnext.patches.v8_9.add_setup_progress_actions #08-09-2017 #26-09-2017 #22-11-2017
erpnext.patches.v8_9.rename_company_sales_target_field erpnext.patches.v8_9.rename_company_sales_target_field
erpnext.patches.v8_8.set_bom_rate_as_per_uom erpnext.patches.v8_8.set_bom_rate_as_per_uom
erpnext.patches.v8_8.add_new_fields_in_accounts_settings erpnext.patches.v8_8.add_new_fields_in_accounts_settings

View File

@ -30,6 +30,8 @@ def execute():
{"action_name": "Add Rooms", "action_doctype": "Room", "min_doc_count": 1, "is_completed": 0, {"action_name": "Add Rooms", "action_doctype": "Room", "min_doc_count": 1, "is_completed": 0,
"domains": '["Education"]' }, "domains": '["Education"]' },
{"action_name": "Add Users", "action_doctype": "User", "min_doc_count": 4, "is_completed": 0, {"action_name": "Add Users", "action_doctype": "User", "min_doc_count": 4, "is_completed": 0,
"domains": '[]' },
{"action_name": "Add Letterhead", "action_doctype": "Letter Head", "min_doc_count": 1, "is_completed": 0,
"domains": '[]' } "domains": '[]' }
] ]

View File

@ -44,6 +44,8 @@ def install(country=None):
{"action_name": "Add Rooms", "action_doctype": "Room", "min_doc_count": 1, "is_completed": 0, {"action_name": "Add Rooms", "action_doctype": "Room", "min_doc_count": 1, "is_completed": 0,
"domains": '["Education"]' }, "domains": '["Education"]' },
{"action_name": "Add Users", "action_doctype": "User", "min_doc_count": 4, "is_completed": 0, {"action_name": "Add Users", "action_doctype": "User", "min_doc_count": 4, "is_completed": 0,
"domains": '[]' },
{"action_name": "Add Letterhead", "action_doctype": "Letter Head", "min_doc_count": 1, "is_completed": 0,
"domains": '[]' } "domains": '[]' }
]}, ]},

View File

@ -81,6 +81,24 @@ def get_slide_settings():
} }
] ]
), ),
frappe._dict(
action_name='Add Letterhead',
domains=('Manufacturing', 'Services', 'Retail', 'Distribution', 'Education'),
title=_("Add Letterhead"),
help=_("Upload your letter head (Keep it web friendly as 900px by 100px)"),
fields=[
{"fieldtype":"Attach Image", "fieldname":"letterhead",
"is_private": 0,
"align": "center"
},
],
mandatory_entry=1,
submit_method="erpnext.utilities.user_progress_utils.create_letterhead",
done_state_title=_("Go to Letterheads"),
done_state_title_route=["List", "Letter Head"]
),
frappe._dict( frappe._dict(
action_name='Add Suppliers', action_name='Add Suppliers',
domains=('Manufacturing', 'Services', 'Retail', 'Distribution'), domains=('Manufacturing', 'Services', 'Retail', 'Distribution'),

View File

@ -37,6 +37,21 @@ def create_customers(args_data):
except frappe.NameError: except frappe.NameError:
pass pass
@frappe.whitelist()
def create_letterhead(args_data):
args = json.loads(args_data)
letterhead = args.get("letterhead")
if letterhead:
try:
frappe.get_doc({
"doctype":"Letter Head",
"content":"""<div><img src="{0}" style='max-width: 100%%;'><br></div>""".format(letterhead),
"letter_head_name": _("Standard"),
"is_default": 1
}).insert()
except frappe.NameError:
pass
@frappe.whitelist() @frappe.whitelist()
def create_suppliers(args_data): def create_suppliers(args_data):
args = json.loads(args_data) args = json.loads(args_data)