Success Action (#13666)

* success action config for  sales invoice

* remove "Notification Control" doctype and its usage

* add default success action after_install or while migration (patch)

* rename for_doctype to ref_doctype

* case change

* minor fix

* Remove unnecessary code

* Replace message with translatable message

* Fix 'cannot import error'
This commit is contained in:
Suraj Shetty
2018-05-03 19:06:32 +05:30
committed by Nabin Hait
parent 1aa3a11546
commit 00cced12a0
21 changed files with 46 additions and 675 deletions

View File

@@ -5,6 +5,7 @@ from __future__ import print_function, unicode_literals
import frappe
from erpnext.accounts.doctype.cash_flow_mapper.default_cash_flow_mapper import DEFAULT_MAPPERS
from .default_success_action import get_default_success_action
from frappe import _
from frappe.desk.page.setup_wizard.setup_wizard import add_all_roles_to
from frappe.custom.doctype.custom_field.custom_field import create_custom_field
@@ -20,6 +21,7 @@ def after_install():
create_print_zero_amount_taxes_custom_field()
add_all_roles_to("Administrator")
create_default_cash_flow_mapper_templates()
create_default_success_action()
frappe.db.commit()
@@ -72,9 +74,13 @@ def create_print_zero_amount_taxes_custom_field():
def create_default_cash_flow_mapper_templates():
mappers = DEFAULT_MAPPERS
for mapper in mappers:
for mapper in DEFAULT_MAPPERS:
if not frappe.db.exists('Cash Flow Mapper', mapper['section_name']):
doc = frappe.get_doc(mapper)
doc.insert(ignore_permissions=True)
def create_default_success_action():
for success_action in get_default_success_action():
if not frappe.db.exists('Success Action', success_action.get("ref_doctype")):
doc = frappe.get_doc(success_action)
doc.insert(ignore_permissions=True)