From 5c7557914b38698ffb2bfe3df4747dac52738c62 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 11 Jun 2015 16:50:28 +0530 Subject: [PATCH 1/3] Removed BOM No from mandatory from Stock Entry against Production Order --- erpnext/stock/doctype/stock_entry/stock_entry.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index da86432388a..d823e7ebbd4 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -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")) From 804b4acb9be21ab7e6ea574c22f1f2b868afc4d2 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 11 Jun 2015 16:56:36 +0530 Subject: [PATCH 2/3] [fix] Issue fixed in C-Form related to field renaming --- erpnext/accounts/doctype/c_form/c_form.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/c_form/c_form.py b/erpnext/accounts/doctype/c_form/c_form.py index 90647547fd3..c14990ae73b 100644 --- a/erpnext/accounts/doctype/c_form/c_form.py +++ b/erpnext/accounts/doctype/c_form/c_form.py @@ -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): From 89592c51804b110462a73d5e6f851449062dfda3 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 12 Jun 2015 17:37:28 +0530 Subject: [PATCH 3/3] Load tasks in project for printing purpose --- erpnext/projects/doctype/project/project.py | 30 ++++++++++++--------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py index 37a8b1b967b..05e40388bf9 100644 --- a/erpnext/projects/doctype/project/project.py +++ b/erpnext/projects/doctype/project/project.py @@ -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()