From b4d72207b23d001758b30575c1918507a25bef5d Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Sun, 16 Dec 2012 16:58:43 +0100 Subject: [PATCH] [IMP] cleaning sales team stuff bzr revid: fp@tinyerp.com-20121216155843-kl2mgr3ecyi85mw1 --- addons/crm/crm.py | 6 ++---- addons/crm/crm_lead.py | 5 +++-- addons/crm/crm_view.xml | 5 +---- addons/sale/edi/sale_order_action_data.xml | 1 - addons/sale_journal/sale_journal_view.xml | 2 +- 5 files changed, 7 insertions(+), 12 deletions(-) diff --git a/addons/crm/crm.py b/addons/crm/crm.py index 00936bae463..5d61f57d505 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -78,9 +78,9 @@ class crm_case_stage(osv.osv): 'state': fields.selection(AVAILABLE_STATES, 'Related Status', required=True, help="The status of your document will automatically change regarding the selected stage. " \ "For example, if a stage is related to the status 'Close', when your document reaches this stage, it is automatically closed."), - 'case_default': fields.boolean('Common to All Teams', + 'case_default': fields.boolean('Default to New Sales Team', help="If you check this field, this stage will be proposed by default on each sales team. It will not assign this stage to existing teams."), - 'fold': fields.boolean('Hide in Views when Empty', + 'fold': fields.boolean('Fold by Default', help="This stage is not visible, for example in status bar or kanban view, when there are no records in that stage to display."), 'type': fields.selection([ ('lead','Lead'), ('opportunity', 'Opportunity'), @@ -194,14 +194,12 @@ class crm_case_categ(osv.osv): 'section_id': fields.many2one('crm.case.section', 'Sales Team'), 'object_id': fields.many2one('ir.model', 'Object Name'), } - def _find_object_id(self, cr, uid, context=None): """Finds id for case object""" context = context or {} object_id = context.get('object_id', False) ids = self.pool.get('ir.model').search(cr, uid, ['|',('id', '=', object_id),('model', '=', context.get('object_name', False))]) return ids and ids[0] or False - _defaults = { 'object_id' : _find_object_id } diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 64c17c4be2f..8303f858b7b 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -121,7 +121,9 @@ class crm_lead(base_stage, format_address, osv.osv): section_id = self._resolve_section_id_from_context(cr, uid, context=context) if section_id: search_domain += ['|', ('section_ids', '=', section_id)] - search_domain += ['|', ('id', 'in', ids), ('case_default', '=', True)] + search_domain += [('id', 'in', ids)] + else: + search_domain += ['|', ('id', 'in', ids), ('case_default', '=', True)] # retrieve type from the context (if set: choose 'type' or 'both') type = self._resolve_type_from_context(cr, uid, context=context) if type: @@ -135,7 +137,6 @@ class crm_lead(base_stage, format_address, osv.osv): fold = {} for stage in stage_obj.browse(cr, access_rights_uid, stage_ids, context=context): fold[stage.id] = stage.fold or False - return result, fold def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): diff --git a/addons/crm/crm_view.xml b/addons/crm/crm_view.xml index 529388c827d..de73c16864d 100644 --- a/addons/crm/crm_view.xml +++ b/addons/crm/crm_view.xml @@ -26,9 +26,6 @@ - - - crm.case.channel.tree @@ -173,7 +170,7 @@ + parent="base.menu_base_config" groups="base.group_sale_manager"/> diff --git a/addons/sale/edi/sale_order_action_data.xml b/addons/sale/edi/sale_order_action_data.xml index ad96ae39109..6907be52acf 100644 --- a/addons/sale/edi/sale_order_action_data.xml +++ b/addons/sale/edi/sale_order_action_data.xml @@ -11,7 +11,6 @@ -