Saurabh | 68ea608 | 2019-01-15 14:47:14 +0530 | [diff] [blame] | 1 | from __future__ import unicode_literals |
Suraj Shetty | 00cced1 | 2018-05-03 19:06:32 +0530 | [diff] [blame] | 2 | from frappe import _ |
| 3 | |
| 4 | doctype_list = [ |
Suraj Shetty | 627a3dc | 2019-09-17 15:54:41 +0530 | [diff] [blame] | 5 | 'Purchase Receipt', |
| 6 | 'Purchase Invoice', |
| 7 | 'Quotation', |
| 8 | 'Sales Order', |
| 9 | 'Delivery Note', |
| 10 | 'Sales Invoice' |
Suraj Shetty | 00cced1 | 2018-05-03 19:06:32 +0530 | [diff] [blame] | 11 | ] |
| 12 | |
| 13 | def get_message(doctype): |
Suraj Shetty | 627a3dc | 2019-09-17 15:54:41 +0530 | [diff] [blame] | 14 | return _("{0} has been submitted successfully").format(_(doctype)) |
Suraj Shetty | 00cced1 | 2018-05-03 19:06:32 +0530 | [diff] [blame] | 15 | |
| 16 | def get_first_success_message(doctype): |
Suraj Shetty | 627a3dc | 2019-09-17 15:54:41 +0530 | [diff] [blame] | 17 | return get_message(doctype) |
Suraj Shetty | 00cced1 | 2018-05-03 19:06:32 +0530 | [diff] [blame] | 18 | |
| 19 | def get_default_success_action(): |
Suraj Shetty | 627a3dc | 2019-09-17 15:54:41 +0530 | [diff] [blame] | 20 | return [{ |
| 21 | 'doctype': 'Success Action', |
| 22 | 'ref_doctype': doctype, |
| 23 | 'message': get_message(doctype), |
| 24 | 'first_success_message': get_first_success_message(doctype), |
| 25 | 'next_actions': 'new\nprint\nemail' |
| 26 | } for doctype in doctype_list] |
Suraj Shetty | 00cced1 | 2018-05-03 19:06:32 +0530 | [diff] [blame] | 27 | |