From 4ea9c4f05d44408904621fb6a3e83707ee890808 Mon Sep 17 00:00:00 2001 From: Jitendra Prajapati Date: Thu, 21 Aug 2014 16:10:13 +0530 Subject: [PATCH] [IMP] sale_crm: on opportunity form view, add a button linking to the sales related to the current opportunity, using a stat button. Two fields are introduced: opportunity_id on sale.order (automatically set when using the make sale wizard), and sale_amount_total on the opportunity, function field computing the total amount for the not canceled quotations related to the opportunity. --- addons/crm/crm_lead_view.xml | 2 +- addons/sale_crm/__init__.py | 1 + addons/sale_crm/crm_lead.py | 16 ++++++++++++++++ addons/sale_crm/sale_crm.py | 3 ++- addons/sale_crm/sale_crm_view.xml | 16 +++++++++++++++- addons/sale_crm/wizard/crm_make_sale.py | 1 + 6 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 addons/sale_crm/crm_lead.py diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index 4716127ba91..4af66725e12 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -379,7 +379,7 @@ domain="['&', ('section_ids', '=', section_id), '|', ('type', '=', type), ('type', '=', 'both')]"/> -
+
+ @@ -34,7 +46,9 @@ - + + + diff --git a/addons/sale_crm/wizard/crm_make_sale.py b/addons/sale_crm/wizard/crm_make_sale.py index 43abd33fa43..9712daec949 100644 --- a/addons/sale_crm/wizard/crm_make_sale.py +++ b/addons/sale_crm/wizard/crm_make_sale.py @@ -101,6 +101,7 @@ class crm_make_sale(osv.osv_memory): 'date_order': fields.date.context_today(self,cr,uid,context=context), 'fiscal_position': fpos, 'payment_term':payment_term, + 'opportunity_id': case.id } if partner.id: vals['user_id'] = partner.user_id and partner.user_id.id or uid