[refactor] [frappe 5.0]

This commit is contained in:
Rushabh Mehta
2014-09-09 16:15:35 +05:30
parent ed37cef32a
commit c0bb453b88
55 changed files with 80 additions and 655 deletions

View File

@@ -18,6 +18,10 @@ class BuyingController(StockController):
"other_charges": "templates/print_formats/includes/taxes.html",
}
def get_feed(self):
return _("From {0} | {1} {2}").format(self.supplier_name, self.currency,
self.grand_total_import)
def validate(self):
super(BuyingController, self).validate()
if getattr(self, "supplier", None) and not self.supplier_name:

View File

@@ -3,7 +3,7 @@
from __future__ import unicode_literals
import frappe
from frappe.widgets.reportview import get_match_cond
from frappe.desk.reportview import get_match_cond
from frappe.model.db_query import DatabaseQuery
def get_filters_cond(doctype, filters, conditions):
@@ -276,7 +276,7 @@ def get_account_list(doctype, txt, searchfield, start, page_len, filters):
if searchfield and txt:
filter_list.append([doctype, searchfield, "like", "%%%s%%" % txt])
return frappe.widgets.reportview.execute("Account", filters = filter_list,
return frappe.desk.reportview.execute("Account", filters = filter_list,
fields = ["name", "parent_account"],
limit_start=start, limit_page_length=page_len, as_list=True)

View File

@@ -134,7 +134,7 @@ def notify_errors(doc, doctype, customer, owner):
def assign_task_to_owner(doc, doctype, msg, users):
for d in users:
from frappe.widgets.form import assign_to
from frappe.desk.form import assign_to
args = {
'assign_to' : d,
'doctype' : doctype,

View File

@@ -18,6 +18,10 @@ class SellingController(StockController):
"other_charges": "templates/print_formats/includes/taxes.html",
}
def get_feed(self):
return _("To {0} | {1} {2}").format(self.customer_name, self.currency,
self.grand_total_export)
def onload(self):
if self.doctype in ("Sales Order", "Delivery Note", "Sales Invoice"):
for item in self.get(self.fname):