From 93b2f167f83b94ee169fd904d087e7701ad15953 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 23 Feb 2015 14:40:19 +0530 Subject: [PATCH] [fixes] opportunity, task minor --- .../crm/doctype/opportunity/opportunity.json | 4 +- .../crm/doctype/opportunity/opportunity.py | 8 +++ .../doctype/project_task/project_task.json | 4 +- .../opportunity_item/opportunity_item.json | 70 ++++++++----------- 4 files changed, 41 insertions(+), 45 deletions(-) diff --git a/erpnext/crm/doctype/opportunity/opportunity.json b/erpnext/crm/doctype/opportunity/opportunity.json index 9517e5d31e9..186e866d9dd 100644 --- a/erpnext/crm/doctype/opportunity/opportunity.json +++ b/erpnext/crm/doctype/opportunity/opportunity.json @@ -48,7 +48,7 @@ "in_filter": 1, "in_list_view": 0, "label": "Customer", - "no_copy": 1, + "no_copy": 0, "oldfieldname": "customer", "oldfieldtype": "Link", "options": "Customer", @@ -391,7 +391,7 @@ "icon": "icon-info-sign", "idx": 1, "is_submittable": 1, - "modified": "2015-02-21 06:18:43.345191", + "modified": "2015-02-23 02:19:39.853388", "modified_by": "Administrator", "module": "CRM", "name": "Opportunity", diff --git a/erpnext/crm/doctype/opportunity/opportunity.py b/erpnext/crm/doctype/opportunity/opportunity.py index f368998dad6..c2378a76756 100644 --- a/erpnext/crm/doctype/opportunity/opportunity.py +++ b/erpnext/crm/doctype/opportunity/opportunity.py @@ -120,6 +120,14 @@ class Opportunity(TransactionBase): if not self.get('items'): frappe.throw(_("Items required")) + # set missing values + item_fields = ("item_name", "description", "item_group", "brand") + + for d in self.items: + item = frappe.db.get_value("Item", d.item_code, item_fields, as_dict=True) + for key in item_fields: + if not d.get(key): d.set(key, item.get(key)) + def validate_lead_cust(self): if self.enquiry_from == 'Lead': if not self.lead: diff --git a/erpnext/projects/doctype/project_task/project_task.json b/erpnext/projects/doctype/project_task/project_task.json index 25bf1eb5d4f..c29dcc05d69 100644 --- a/erpnext/projects/doctype/project_task/project_task.json +++ b/erpnext/projects/doctype/project_task/project_task.json @@ -38,7 +38,7 @@ "in_list_view": 1, "label": "Status", "no_copy": 0, - "options": "Open\nClosed", + "options": "Open\nWorking\nPending Review\nClosed\nCancelled", "permlevel": 0, "precision": "", "print_hide": 0, @@ -143,7 +143,7 @@ "is_submittable": 0, "issingle": 0, "istable": 1, - "modified": "2015-02-22 11:53:23.317993", + "modified": "2015-02-23 01:55:18.865117", "modified_by": "Administrator", "module": "Projects", "name": "Project Task", diff --git a/erpnext/selling/doctype/opportunity_item/opportunity_item.json b/erpnext/selling/doctype/opportunity_item/opportunity_item.json index e9342dc7df9..889b05ff3e6 100644 --- a/erpnext/selling/doctype/opportunity_item/opportunity_item.json +++ b/erpnext/selling/doctype/opportunity_item/opportunity_item.json @@ -20,14 +20,13 @@ "permlevel": 0 }, { - "fieldname": "item_name", - "fieldtype": "Data", + "fieldname": "qty", + "fieldtype": "Float", "in_list_view": 1, - "label": "Item Name", - "oldfieldname": "item_name", - "oldfieldtype": "Data", - "permlevel": 0, - "reqd": 1 + "label": "Qty", + "oldfieldname": "qty", + "oldfieldtype": "Currency", + "permlevel": 0 }, { "description": "", @@ -62,6 +61,27 @@ "permlevel": 0, "precision": "" }, + { + "fieldname": "uom", + "fieldtype": "Link", + "in_list_view": 0, + "label": "UOM", + "oldfieldname": "uom", + "oldfieldtype": "Link", + "options": "UOM", + "permlevel": 0, + "search_index": 0 + }, + { + "fieldname": "item_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Item Name", + "oldfieldname": "item_name", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 0 + }, { "fieldname": "description", "fieldtype": "Text", @@ -71,7 +91,7 @@ "oldfieldtype": "Text", "permlevel": 0, "print_width": "300px", - "reqd": 1, + "reqd": 0, "width": "300px" }, { @@ -98,22 +118,6 @@ "permlevel": 0, "precision": "" }, - { - "fieldname": "quantity_and_rate", - "fieldtype": "Section Break", - "in_list_view": 0, - "label": "Quantity and Rate", - "permlevel": 0 - }, - { - "fieldname": "qty", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Qty", - "oldfieldname": "qty", - "oldfieldtype": "Currency", - "permlevel": 0 - }, { "fieldname": "basic_rate", "fieldtype": "Currency", @@ -125,27 +129,11 @@ "options": "Company:company:default_currency", "permlevel": 0, "print_hide": 1 - }, - { - "fieldname": "col_break2", - "fieldtype": "Column Break", - "permlevel": 0 - }, - { - "fieldname": "uom", - "fieldtype": "Link", - "in_list_view": 0, - "label": "UOM", - "oldfieldname": "uom", - "oldfieldtype": "Link", - "options": "UOM", - "permlevel": 0, - "search_index": 0 } ], "idx": 1, "istable": 1, - "modified": "2015-02-12 15:18:08.997193", + "modified": "2015-02-23 02:09:55.105233", "modified_by": "Administrator", "module": "Selling", "name": "Opportunity Item",