commit
85f825e98c
@ -54,7 +54,7 @@ class CForm(Document):
|
||||
frappe.throw(_("Please enter atleast 1 invoice in the table"))
|
||||
|
||||
def set_total_invoiced_amount(self):
|
||||
total = sum([flt(d.base_grand_total) for d in self.get('invoices')])
|
||||
total = sum([flt(d.grand_total) for d in self.get('invoices')])
|
||||
frappe.db.set(self, 'total_invoiced_amount', total)
|
||||
|
||||
def get_invoice_details(self, invoice_no):
|
||||
|
@ -13,19 +13,25 @@ class Project(Document):
|
||||
def get_feed(self):
|
||||
return '{0}: {1}'.format(_(self.status), self.project_name)
|
||||
|
||||
def __setup__(self):
|
||||
def onload(self):
|
||||
"""Load project tasks for quick view"""
|
||||
self.tasks = []
|
||||
for task in frappe.get_all("Task", "*", {"project": self.name}, order_by="exp_start_date asc"):
|
||||
self.append("tasks", {
|
||||
"title": task.subject,
|
||||
"status": task.status,
|
||||
"start_date": task.exp_start_date,
|
||||
"end_date": task.exp_end_date,
|
||||
"description": task.description,
|
||||
"task_id": task.name
|
||||
})
|
||||
|
||||
if not self.get("tasks"):
|
||||
for task in self.get_tasks():
|
||||
self.append("tasks", {
|
||||
"title": task.subject,
|
||||
"status": task.status,
|
||||
"start_date": task.exp_start_date,
|
||||
"end_date": task.exp_end_date,
|
||||
"description": task.description,
|
||||
"task_id": task.name
|
||||
})
|
||||
|
||||
def __setup__(self):
|
||||
self.onload()
|
||||
|
||||
def get_tasks(self):
|
||||
return frappe.get_all("Task", "*", {"project": self.name}, order_by="exp_start_date asc")
|
||||
|
||||
def validate(self):
|
||||
self.validate_dates()
|
||||
self.sync_tasks()
|
||||
|
@ -185,9 +185,6 @@ class StockEntry(StockController):
|
||||
|
||||
def validate_production_order(self):
|
||||
if self.purpose in ("Manufacture", "Material Transfer for Manufacture"):
|
||||
if not self.bom_no:
|
||||
frappe.throw(_("BOM No is mandatory"))
|
||||
|
||||
# check if production order is entered
|
||||
if not self.production_order:
|
||||
frappe.throw(_("Production order number is mandatory for stock entry purpose manufacture"))
|
||||
|
Loading…
x
Reference in New Issue
Block a user