[route] refactor, wip
This commit is contained in:
parent
74bc2baa1d
commit
cb067aa579
@ -65,9 +65,11 @@ class StatusUpdater(Document):
|
||||
self.validate_qty()
|
||||
|
||||
def set_status(self, update=False):
|
||||
if self.get("__islocal"):
|
||||
if self.is_new():
|
||||
return
|
||||
|
||||
_status = self.status
|
||||
|
||||
if self.doctype in status_map:
|
||||
sl = status_map[self.doctype][:]
|
||||
sl.reverse()
|
||||
@ -83,9 +85,11 @@ class StatusUpdater(Document):
|
||||
self.status = s[0]
|
||||
break
|
||||
|
||||
if self.status != _status:
|
||||
self.add_comment("Label", self.status)
|
||||
|
||||
if update:
|
||||
frappe.db.set_value(self.doctype, self.name, "status", self.status)
|
||||
self.add_comment("Label", self.status)
|
||||
|
||||
def on_communication(self):
|
||||
if not self.get("communications"): return
|
||||
|
@ -18,7 +18,7 @@
|
||||
<span class="label label-warning filterable"
|
||||
data-filter="per_delivered,<,100|status,!=,Stopped"
|
||||
title="{%= __("Pending") %}">
|
||||
{%= doc.get_formatted("delivery_date")%}</span>
|
||||
{%= doc.get_formatted("delivery_date") || "Pending" %}</span>
|
||||
{% } %}
|
||||
{% } %}
|
||||
{% if(doc.per_delivered == 100 && doc.status!=="Stopped") { %}
|
||||
|
@ -83,10 +83,11 @@
|
||||
{
|
||||
"depends_on": "show_in_website",
|
||||
"fieldname": "parent_website_route",
|
||||
"fieldtype": "Link",
|
||||
"label": "Parent Website Page",
|
||||
"options": "Website Route",
|
||||
"permlevel": 0
|
||||
"fieldtype": "Read Only",
|
||||
"label": "Parent Website Route",
|
||||
"options": "",
|
||||
"permlevel": 0,
|
||||
"read_only": 1
|
||||
},
|
||||
{
|
||||
"depends_on": "show_in_website",
|
||||
@ -163,7 +164,7 @@
|
||||
"in_create": 1,
|
||||
"issingle": 0,
|
||||
"max_attachments": 3,
|
||||
"modified": "2014-06-10 05:37:03.763185",
|
||||
"modified": "2014-08-19 06:42:03.262273",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Setup",
|
||||
"name": "Item Group",
|
||||
|
@ -103,6 +103,6 @@ def invalidate_cache_for(doc, item_group=None):
|
||||
item_group = doc.name
|
||||
|
||||
for i in get_parent_item_groups(item_group):
|
||||
route = frappe.db.get_value("Website Route", {"ref_doctype":"Item Group", "docname": i.name})
|
||||
route = doc.get_route()
|
||||
if route:
|
||||
clear_cache(route)
|
||||
|
@ -190,16 +190,16 @@
|
||||
{
|
||||
"default": "partners",
|
||||
"fieldname": "parent_website_route",
|
||||
"fieldtype": "Link",
|
||||
"fieldtype": "Read Only",
|
||||
"label": "Parent Website Route",
|
||||
"options": "Website Route",
|
||||
"options": "",
|
||||
"permlevel": 0
|
||||
}
|
||||
],
|
||||
"icon": "icon-user",
|
||||
"idx": 1,
|
||||
"in_create": 0,
|
||||
"modified": "2014-06-27 09:21:33.687012",
|
||||
"modified": "2014-08-19 06:42:33.103060",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Setup",
|
||||
"name": "Sales Partner",
|
||||
|
@ -59,7 +59,7 @@ class website_maker(object):
|
||||
website_settings.append("top_bar_items", {
|
||||
"doctype": "Top Bar Item",
|
||||
"label": _("Products"),
|
||||
"url": frappe.db.get_value("Website Route", {"ref_doctype":"Item Group"})
|
||||
"url": "products"
|
||||
})
|
||||
website_settings.save()
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user