mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-06 05:39:12 +00:00
refactor: added naming series for pricing rule
This commit is contained in:
@@ -2,12 +2,13 @@
|
||||
"actions": [],
|
||||
"allow_import": 1,
|
||||
"allow_rename": 1,
|
||||
"autoname": "field:title",
|
||||
"autoname": "naming_series:",
|
||||
"creation": "2014-02-21 15:02:51",
|
||||
"doctype": "DocType",
|
||||
"engine": "InnoDB",
|
||||
"field_order": [
|
||||
"applicability_section",
|
||||
"naming_series",
|
||||
"title",
|
||||
"disable",
|
||||
"apply_on",
|
||||
@@ -95,8 +96,7 @@
|
||||
"fieldtype": "Data",
|
||||
"label": "Title",
|
||||
"no_copy": 1,
|
||||
"reqd": 1,
|
||||
"unique": 1
|
||||
"reqd": 1
|
||||
},
|
||||
{
|
||||
"default": "0",
|
||||
@@ -571,6 +571,13 @@
|
||||
"fieldname": "is_recursive",
|
||||
"fieldtype": "Check",
|
||||
"label": "Is Recursive"
|
||||
},
|
||||
{
|
||||
"default": "PRLE-.####",
|
||||
"fieldname": "naming_series",
|
||||
"fieldtype": "Select",
|
||||
"label": "Naming Series",
|
||||
"options": "PRLE-.####"
|
||||
}
|
||||
],
|
||||
"icon": "fa fa-gift",
|
||||
@@ -634,5 +641,6 @@
|
||||
],
|
||||
"show_name_in_global_search": 1,
|
||||
"sort_field": "modified",
|
||||
"sort_order": "DESC"
|
||||
"sort_order": "DESC",
|
||||
"title_field": "title"
|
||||
}
|
||||
@@ -81,7 +81,7 @@ def _get_pricing_rules(doc, child_doc, discount_fields, rules = {}):
|
||||
new_doc = []
|
||||
args = get_args_for_pricing_rule(doc)
|
||||
applicable_for = frappe.scrub(doc.get('applicable_for'))
|
||||
for d in doc.get(child_doc):
|
||||
for idx, d in enumerate(doc.get(child_doc)):
|
||||
if d.name in rules:
|
||||
for applicable_for_value in args.get(applicable_for):
|
||||
temp_args = args.copy()
|
||||
@@ -100,7 +100,7 @@ def _get_pricing_rules(doc, child_doc, discount_fields, rules = {}):
|
||||
pr = set_args(temp_args, pr, doc, child_doc, discount_fields, d)
|
||||
else:
|
||||
pr = frappe.new_doc("Pricing Rule")
|
||||
pr.title = make_autoname("{0}/.####".format(doc.name))
|
||||
pr.title = doc.name
|
||||
temp_args[applicable_for] = applicable_for_value
|
||||
pr = set_args(temp_args, pr, doc, child_doc, discount_fields, d)
|
||||
|
||||
@@ -110,7 +110,7 @@ def _get_pricing_rules(doc, child_doc, discount_fields, rules = {}):
|
||||
for i in range(len(args.get(applicable_for))) :
|
||||
|
||||
pr = frappe.new_doc("Pricing Rule")
|
||||
pr.title = make_autoname("{0}/.####".format(doc.name))
|
||||
pr.title = doc.name
|
||||
temp_args = args.copy()
|
||||
temp_args[applicable_for] = args[applicable_for][i]
|
||||
pr = set_args(temp_args, pr, doc, child_doc, discount_fields, d)
|
||||
|
||||
Reference in New Issue
Block a user