[fixes] opportunity, task minor

This commit is contained in:
Rushabh Mehta
2015-02-23 14:40:19 +05:30
parent 281dc5d639
commit 93b2f167f8
4 changed files with 41 additions and 45 deletions

View File

@@ -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",

View File

@@ -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: