Suraj Shetty | 00cced1 | 2018-05-03 19:06:32 +0530 | [diff] [blame] | 1 | from frappe import _ |
| 2 | |
| 3 | doctype_list = [ |
Ankush Menat | 494bd9e | 2022-03-28 18:52:46 +0530 | [diff] [blame] | 4 | "Purchase Receipt", |
| 5 | "Purchase Invoice", |
| 6 | "Quotation", |
| 7 | "Sales Order", |
| 8 | "Delivery Note", |
| 9 | "Sales Invoice", |
Suraj Shetty | 00cced1 | 2018-05-03 19:06:32 +0530 | [diff] [blame] | 10 | ] |
| 11 | |
Ankush Menat | 494bd9e | 2022-03-28 18:52:46 +0530 | [diff] [blame] | 12 | |
Suraj Shetty | 00cced1 | 2018-05-03 19:06:32 +0530 | [diff] [blame] | 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 | |
Ankush Menat | 494bd9e | 2022-03-28 18:52:46 +0530 | [diff] [blame] | 16 | |
Suraj Shetty | 00cced1 | 2018-05-03 19:06:32 +0530 | [diff] [blame] | 17 | def get_first_success_message(doctype): |
Suraj Shetty | 627a3dc | 2019-09-17 15:54:41 +0530 | [diff] [blame] | 18 | return get_message(doctype) |
Suraj Shetty | 00cced1 | 2018-05-03 19:06:32 +0530 | [diff] [blame] | 19 | |
Ankush Menat | 494bd9e | 2022-03-28 18:52:46 +0530 | [diff] [blame] | 20 | |
Suraj Shetty | 00cced1 | 2018-05-03 19:06:32 +0530 | [diff] [blame] | 21 | def get_default_success_action(): |
Ankush Menat | 494bd9e | 2022-03-28 18:52:46 +0530 | [diff] [blame] | 22 | return [ |
| 23 | { |
| 24 | "doctype": "Success Action", |
| 25 | "ref_doctype": doctype, |
| 26 | "message": get_message(doctype), |
| 27 | "first_success_message": get_first_success_message(doctype), |
| 28 | "next_actions": "new\nprint\nemail", |
| 29 | } |
| 30 | for doctype in doctype_list |
| 31 | ] |