From eab2e225a223d0919ee4dde65f4dfe7e269fa01c Mon Sep 17 00:00:00 2001 From: "Nimesh (Open ERP)" Date: Fri, 6 Jul 2012 14:46:08 +0530 Subject: [PATCH 01/34] [FIX]: add date validation. bzr revid: nco@tinyerp.com-20120706091608-f5o08ke6z84oilui --- addons/membership/membership.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/addons/membership/membership.py b/addons/membership/membership.py index dc4eadbada9..f7007ac28e7 100644 --- a/addons/membership/membership.py +++ b/addons/membership/membership.py @@ -478,7 +478,14 @@ class Product(osv.osv): 'membership_date_from': fields.date('Date from', help='Date from which membership becomes active.'), 'membership_date_to': fields.date('Date to', help='Date until which membership remains active.'), } - + def _check_end_date(self, cr, uid, ids, context=None): + for membership in self.browse(cr, uid, ids, context=context): + if membership.membership_date_to < membership.membership_date_from: + return False + return True + _constraints = [ + (_check_end_date, 'Error ! Ending Date cannot be set before Beginning Date.', ['membership_date_to']), + ] _defaults = { 'membership': False, } From 55ce6a560fb31e86b3a0ae8d21ccaec9e48db3da Mon Sep 17 00:00:00 2001 From: "pankita shah (Open ERP)" Date: Mon, 29 Oct 2012 18:12:26 +0530 Subject: [PATCH 02/34] [FIX] when user select lead and get draft mode bzr revid: shp@tinyerp.com-20121029124226-cjn6s3sj434rm5q7 --- addons/crm/crm_lead.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 9ee5aeb2301..00ee7582c4d 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -50,7 +50,7 @@ class crm_lead(base_stage, format_address, osv.osv): def _get_default_stage_id(self, cr, uid, context=None): """ Gives default stage_id """ section_id = self._get_default_section_id(cr, uid, context=context) - return self.stage_find(cr, uid, [], section_id, [('state', '=', 'draft'), ('type', '=', 'both')], context=context) + return self.stage_find(cr, uid, [], section_id, [('state', '=', 'draft'),'|', ('type', '=', 'lead'),('type', '=', 'both'),], context=context) def _resolve_section_id_from_context(self, cr, uid, context=None): """ Returns ID of section based on the value of 'section_id' @@ -340,7 +340,7 @@ class crm_lead(base_stage, format_address, osv.osv): cases = self.browse(cr, uid, cases, context=context) # collect all section_ids section_ids = [] - types = ['both'] + types = ['lead','opportunity','both'] if section_id: section_ids.append(section_id) for lead in cases: From 084a4217a7022fbf9ecaca6bbfed135798fe856c Mon Sep 17 00:00:00 2001 From: "pankita shah (Open ERP)" Date: Mon, 29 Oct 2012 18:53:13 +0530 Subject: [PATCH 03/34] [FIX] fixed when select type opportunuty then opportunuty in draft mode bzr revid: shp@tinyerp.com-20121029132313-5ctreoq9nv2fxvxc --- addons/crm/crm_lead.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 00ee7582c4d..da0a3f7d756 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -50,7 +50,7 @@ class crm_lead(base_stage, format_address, osv.osv): def _get_default_stage_id(self, cr, uid, context=None): """ Gives default stage_id """ section_id = self._get_default_section_id(cr, uid, context=context) - return self.stage_find(cr, uid, [], section_id, [('state', '=', 'draft'),'|', ('type', '=', 'lead'),('type', '=', 'both'),], context=context) + return self.stage_find(cr, uid, [], section_id, [('state', '=', 'draft'),'|', ('type', '=', 'lead'),'|',('type', '=', 'both'),('type','=','opportunity')], context=context) def _resolve_section_id_from_context(self, cr, uid, context=None): """ Returns ID of section based on the value of 'section_id' From 97208c971b9155cffa57f403109bc92104af9938 Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Mon, 29 Oct 2012 18:37:14 +0100 Subject: [PATCH 04/34] [IMP] avoid tabs (4 spaces) in the middle of help text bzr revid: abo@openerp.com-20121029173714-qpr4rrhll576jxmm --- addons/crm/crm_lead.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index da0a3f7d756..0366045b90f 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -224,11 +224,7 @@ class crm_lead(base_stage, format_address, osv.osv): multi='day_close', type="float", store=True), 'state': fields.related('stage_id', 'state', type="selection", store=True, selection=crm.AVAILABLE_STATES, string="Status", readonly=True, - help='The Status is set to \'Draft\', when a case is created.\ - If the case is in progress the Status is set to \'Open\'.\ - When the case is over, the Status is set to \'Done\'.\ - If the case needs to be reviewed then the Status is \ - set to \'Pending\'.'), + help='The Status is set to \'Draft\', when a case is created. If the case is in progress the Status is set to \'Open\'. When the case is over, the Status is set to \'Done\'. If the case needs to be reviewed then the Status is set to \'Pending\'.'), # Only used for type opportunity 'probability': fields.float('Success Rate (%)',group_operator="avg"), From 7a8d6753021ea86f72ab2a7aca374e70620aa03c Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Mon, 29 Oct 2012 19:11:56 +0100 Subject: [PATCH 05/34] [IMP] code style remove mutable default remove useless whitespaces bzr revid: abo@openerp.com-20121029181156-ao52q3uun3ilp2qk --- addons/crm/crm_lead.py | 4 ++- addons/crm/crm_lead_view.xml | 66 ++++++++++++++++++------------------ 2 files changed, 36 insertions(+), 34 deletions(-) diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 0366045b90f..4074856ad81 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -324,7 +324,7 @@ class crm_lead(base_stage, format_address, osv.osv): cases = self.browse(cr, uid, ids2, context=context) return self._action(cr, uid, cases, False, context=context) - def stage_find(self, cr, uid, cases, section_id, domain=[], order='sequence', context=None): + def stage_find(self, cr, uid, cases, section_id, domain=None, order='sequence', context=None): """ Override of the base.stage method Parameter of the stage search taken from the lead: - type: stage type must be the same or 'both' @@ -332,6 +332,8 @@ class crm_lead(base_stage, format_address, osv.osv): be a default stage; if not set, stages must be default stages """ + if domain == None: + domain = [] if isinstance(cases, (int, long)): cases = self.browse(cr, uid, cases, context=context) # collect all section_ids diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index b6890a7de07..a05af900bb9 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -14,9 +14,9 @@ action_crm_lead_unread - + action - + crm.lead client_action_multi @@ -32,9 +32,9 @@ action_crm_lead_read - + action - + crm.lead client_action_multi @@ -143,7 +143,7 @@
- @@ -253,12 +253,12 @@ - + - + @@ -276,8 +276,8 @@ - - + + @@ -354,14 +354,14 @@ - + - + - - + + @@ -415,7 +415,7 @@ name="action_makeMeeting" type="object" context="{'search_default_attendee_id': active_id, 'default_attendee_id' : active_id}" - /> + />