Merge pull request #1862 from anandpdoshi/anand-wip-4.1
Fixes in Website Route system and other misc fixes
This commit is contained in:
commit
7cac2884ae
@ -16,23 +16,24 @@
|
||||
<tr>
|
||||
{% if(data[i].posting_date) { %}
|
||||
<td>{%= dateutil.str_to_user(data[i].posting_date) %}</td>
|
||||
<td>{%= data[i].voucher_no %}</td>
|
||||
<td>{%= data[i].voucher_type%}
|
||||
<br>{%= data[i].voucher_no %}</td>
|
||||
<td>{%= data[i].account %}
|
||||
<br>{%= __("Against") %}: {%= data[i].account %}
|
||||
<br>{%= __("Remarks") %}: {%= data[i].remarks %}</td>
|
||||
<td style="text-align: right">{%= fmt_money(data[i].debit) %}</td>
|
||||
<td style="text-align: right">{%= fmt_money(data[i].credit) %}</td>
|
||||
<td style="text-align: right">{%= format_currency(data[i].debit) %}</td>
|
||||
<td style="text-align: right">{%= format_currency(data[i].credit) %}</td>
|
||||
{% } else { %}
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><b>{%= data[i].account || " " %}</b></td>
|
||||
<td style="text-align: right">
|
||||
{%= data[i].account && fmt_money(data[i].debit) %}</td>
|
||||
{%= data[i].account && format_currency(data[i].debit) %}</td>
|
||||
<td style="text-align: right">
|
||||
{%= data[i].account && fmt_money(data[i].credit) %}</td>
|
||||
{%= data[i].account && format_currency(data[i].credit) %}</td>
|
||||
{% } %}
|
||||
</tr>
|
||||
{% } %}
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="text-right text-muted">Printed On {%= dateutil.get_datetime_as_string() %}</p>
|
||||
<p class="text-right text-muted">Printed On {%= dateutil.str_to_user(dateutil.get_datetime_as_string()) %}</p>
|
||||
|
@ -91,6 +91,11 @@ def get_data():
|
||||
"description": _("Manage Territory Tree."),
|
||||
"doctype": "Territory",
|
||||
},
|
||||
{
|
||||
"type": "doctype",
|
||||
"name": "Sales Partner",
|
||||
"description": _("Manage Sales Partners."),
|
||||
},
|
||||
{
|
||||
"type": "page",
|
||||
"label": _("Sales Person"),
|
||||
|
@ -64,3 +64,4 @@ execute:frappe.db.sql("update `tabItem` set end_of_life=null where end_of_life='
|
||||
erpnext.patches.v4_0.update_users_report_view_settings
|
||||
erpnext.patches.v4_0.set_pricing_rule_for_buying_or_selling
|
||||
erpnext.patches.v4_0.set_naming_series_property_setter
|
||||
erpnext.patches.v4_1.set_outgoing_email_footer
|
||||
|
0
erpnext/patches/v4_1/__init__.py
Normal file
0
erpnext/patches/v4_1/__init__.py
Normal file
11
erpnext/patches/v4_1/set_outgoing_email_footer.py
Normal file
11
erpnext/patches/v4_1/set_outgoing_email_footer.py
Normal file
@ -0,0 +1,11 @@
|
||||
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
|
||||
# License: GNU General Public License v3. See license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from erpnext.setup.install import default_mail_footer
|
||||
|
||||
def execute():
|
||||
mail_footer = frappe.db.get_default('mail_footer') or ''
|
||||
mail_footer += default_mail_footer
|
||||
frappe.db.set_value("Outgoing Email Settings", "Outgoing Email Settings", "footer", mail_footer)
|
@ -64,6 +64,7 @@ class Customer(TransactionBase):
|
||||
c.customer = self.name
|
||||
c.customer_name = self.customer_name
|
||||
c.is_primary_contact = 1
|
||||
c.ignore_permissions = getattr(self, "ignore_permissions", None)
|
||||
try:
|
||||
c.save()
|
||||
except frappe.NameError:
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -102,5 +102,6 @@ def invalidate_cache_for(doc, item_group=None):
|
||||
item_group = doc.name
|
||||
|
||||
for i in get_parent_item_groups(item_group):
|
||||
if i.page_name:
|
||||
clear_cache(i.page_name)
|
||||
route = frappe.db.get_value("Website Route", {"ref_doctype":"Item Group", "docname": i.name})
|
||||
if route:
|
||||
clear_cache(route)
|
||||
|
@ -17,6 +17,11 @@ cur_frm.cscript.refresh = function(doc,dt,dn){
|
||||
// make lists
|
||||
cur_frm.cscript.make_address(doc,dt,dn);
|
||||
cur_frm.cscript.make_contact(doc,dt,dn);
|
||||
|
||||
if (doc.show_in_website) {
|
||||
cur_frm.set_intro(__("Published on website at: {0}",
|
||||
[repl('<a href="/%(website_route)s" target="_blank">/%(website_route)s</a>', doc.__onload)]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -188,6 +188,7 @@
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"default": "partners",
|
||||
"fieldname": "parent_website_route",
|
||||
"fieldtype": "Link",
|
||||
"label": "Parent Website Route",
|
||||
@ -198,7 +199,7 @@
|
||||
"icon": "icon-user",
|
||||
"idx": 1,
|
||||
"in_create": 0,
|
||||
"modified": "2014-05-27 03:49:18.661354",
|
||||
"modified": "2014-06-27 09:21:33.687012",
|
||||
"modified_by": "Administrator",
|
||||
"module": "Setup",
|
||||
"name": "Sales Partner",
|
||||
|
@ -46,3 +46,6 @@ class SalesPartner(WebsiteGenerator):
|
||||
|
||||
return context
|
||||
|
||||
def get_parent_website_route(self):
|
||||
parent_website_sitemap = super(SalesPartner, self).get_parent_website_route()
|
||||
return parent_website_sitemap or "partners"
|
||||
|
@ -50,8 +50,10 @@ class Item(WebsiteGenerator):
|
||||
if not self.parent_website_route:
|
||||
self.parent_website_route = frappe.get_website_route("Item Group", self.item_group)
|
||||
|
||||
if self.name:
|
||||
self.old_page_name = frappe.db.get_value('Item', self.name, 'page_name')
|
||||
if not self.get("__islocal"):
|
||||
self.old_item_group = frappe.db.get_value(self.doctype, self.name, "item_group")
|
||||
self.old_website_item_groups = frappe.db.sql_list("""select item_group from `tabWebsite Item Group`
|
||||
where parentfield='website_item_groups' and parenttype='Item' and parent=%s""", self.name)
|
||||
|
||||
def on_update(self):
|
||||
super(Item, self).on_update()
|
||||
@ -216,7 +218,7 @@ class Item(WebsiteGenerator):
|
||||
if self.name==self.item_name:
|
||||
page_name_from = self.name
|
||||
else:
|
||||
page_name_from = self.name + " " + self.item_name
|
||||
page_name_from = self.name + " - " + self.item_name
|
||||
|
||||
return page_name_from
|
||||
|
||||
@ -363,6 +365,12 @@ def get_last_purchase_details(item_code, doc_name=None, conversion_rate=1.0):
|
||||
|
||||
def invalidate_cache_for_item(doc):
|
||||
invalidate_cache_for(doc, doc.item_group)
|
||||
for d in doc.get({"doctype":"Website Item Group"}):
|
||||
if d.item_group:
|
||||
invalidate_cache_for(doc, d.item_group)
|
||||
|
||||
website_item_groups = list(set((doc.get("old_website_item_groups") or [])
|
||||
+ [d.item_group for d in doc.get({"doctype":"Website Item Group"}) if d.item_group]))
|
||||
|
||||
for item_group in website_item_groups:
|
||||
invalidate_cache_for(doc, item_group)
|
||||
|
||||
if doc.get("old_item_group"):
|
||||
invalidate_cache_for(doc, doc.old_item_group)
|
||||
|
@ -9,13 +9,13 @@
|
||||
<div class="col-md-3">
|
||||
{% if partner_info.logo -%}
|
||||
<a href="{{ partner_info.page_name }}">
|
||||
<img itemprop="brand" src="{{ partner_info.logo }}" class="partner-logo"
|
||||
<img itemprop="brand" src="{{ partner_info.logo }}" class="partner-logo"
|
||||
alt="{{ partner_info.partner_name }}" title="{{ partner_info.partner_name }}" />
|
||||
</a>
|
||||
{%- endif %}
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<a href="{{ partner_info.page_name }}">
|
||||
<a href="{{ partner_info.route }}">
|
||||
<h4>{{ partner_info.partner_name }}</h4>
|
||||
</a>
|
||||
<p style="color: #999">{{ partner_info.territory }} - {{ partner_info.partner_type }}</p>
|
||||
@ -27,4 +27,4 @@
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block sidebar %}{% include "templates/includes/sidebar.html" %}{% endblock %}
|
||||
{% block sidebar %}{% include "templates/includes/sidebar.html" %}{% endblock %}
|
||||
|
@ -5,9 +5,16 @@ from __future__ import unicode_literals
|
||||
import frappe
|
||||
import frappe.website.render
|
||||
|
||||
page_title = "Partners"
|
||||
|
||||
def get_context(context):
|
||||
partners = frappe.db.sql("""select * from `tabSales Partner`
|
||||
where show_in_website=1 order by name asc""", as_dict=True)
|
||||
|
||||
for p in partners:
|
||||
p.route = frappe.get_doc("Sales Partner", p.name).get_route()
|
||||
|
||||
return {
|
||||
"partners": frappe.db.sql("""select * from `tabSales Partner`
|
||||
where show_in_website=1 order by name asc""", as_dict=True),
|
||||
"title": "Partners"
|
||||
"partners": partners,
|
||||
"title": page_title
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user