From bd99606a144c18247b0adda8a0419569df9a9e8b Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Tue, 1 May 2018 10:52:02 +0530 Subject: [PATCH] Change msgprint to unobtrusive alert --- erpnext/accounts/doctype/journal_entry/journal_entry.py | 4 ++-- .../doctype/production_order/production_order.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/erpnext/accounts/doctype/journal_entry/journal_entry.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py index 5e67e4423f..98d5880571 100644 --- a/erpnext/accounts/doctype/journal_entry/journal_entry.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -82,7 +82,7 @@ class JournalEntry(AccountsController): d.reference_type = '' d.reference_name = '' d.db_update() - + def unlink_asset_reference(self): for d in self.get("accounts"): if d.reference_type=="Asset" and d.reference_name: @@ -125,7 +125,7 @@ class JournalEntry(AccountsController): if (d.party_type == 'Customer' and flt(d.credit) > 0) or \ (d.party_type == 'Supplier' and flt(d.debit) > 0): if d.is_advance=="No": - msgprint(_("Row {0}: Please check 'Is Advance' against Account {1} if this is an advance entry.").format(d.idx, d.account)) + msgprint(_("Row {0}: Please check 'Is Advance' against Account {1} if this is an advance entry.").format(d.idx, d.account), alert=1) elif d.reference_type in ("Sales Order", "Purchase Order") and d.is_advance != "Yes": frappe.throw(_("Row {0}: Payment against Sales/Purchase Order should always be marked as advance").format(d.idx)) diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py index d3b7c5a498..158c4433d5 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.py +++ b/erpnext/manufacturing/doctype/production_order/production_order.py @@ -64,7 +64,7 @@ class ProductionOrder(Document): so.name, so_item.delivery_date, so.project from `tabSales Order` so, `tabSales Order Item` so_item, `tabPacked Item` packed_item - where so.name=%s + where so.name=%s and so.name=so_item.parent and so.name=packed_item.parent and so_item.item_code = packed_item.parent_item @@ -88,7 +88,7 @@ class ProductionOrder(Document): self.wip_warehouse = frappe.db.get_single_value("Manufacturing Settings", "default_wip_warehouse") if not self.fg_warehouse: self.fg_warehouse = frappe.db.get_single_value("Manufacturing Settings", "default_fg_warehouse") - + def validate_warehouse_belongs_to_company(self): warehouses = [self.fg_warehouse, self.wip_warehouse] for d in self.get("required_items"): @@ -524,7 +524,7 @@ def get_item_details(item, project = None): if not res["bom_no"]: if project: res = get_item_details(item) - frappe.msgprint(_("Default BOM not found for Item {0} and Project {1}").format(item, project)) + frappe.msgprint(_("Default BOM not found for Item {0} and Project {1}").format(item, project), alert=1) else: frappe.throw(_("Default BOM for {0} not found").format(item)) @@ -642,5 +642,5 @@ def query_sales_order(production_item): select distinct so.name from `tabSales Order` so, `tabPacked Item` pi_item where pi_item.parent=so.name and pi_item.item_code=%s and so.docstatus=1 """, (production_item, production_item)) - + return out