From ba9412cb5d4580977c4d0a84be4fa8dbb42931ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 3 Apr 2013 10:10:09 +0200 Subject: [PATCH] [CLEAN] addons: various linkt cleanup (indentation, spaces, ...). bzr revid: tde@openerp.com-20130403081009-jy35sm7dl4pq7eyu --- addons/crm/__openerp__.py | 21 +++++++++++-- addons/crm/crm.py | 13 +++++--- addons/crm/crm_lead.py | 4 ++- addons/crm/crm_lead_view.xml | 5 +-- addons/crm/crm_phonecall_view.xml | 6 ++-- addons/crm/crm_report_view.xml | 9 ++++-- addons/crm/report/crm_lead_report_view.xml | 9 ++++-- .../crm/report/crm_phonecall_report_view.xml | 6 ++-- addons/crm/res_config_view.xml | 2 +- .../report/crm_claim_report_view.xml | 6 ++-- .../crm_partner_assign/res_partner_view.xml | 31 ++++++++++--------- addons/mail/static/src/css/mail.css | 1 + addons/project/project_view.xml | 20 ++++++------ addons/project_issue/project_issue_menu.xml | 10 +++--- addons/project_issue/project_issue_view.xml | 17 +++++----- addons/sale/sale_view.xml | 22 +++++++------ addons/sale_crm/sale_crm.py | 11 ++++--- 17 files changed, 118 insertions(+), 75 deletions(-) diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index d5e3808359e..c4e4db983a4 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -116,11 +116,26 @@ Dashboard for CRM will include: 'test/ui/duplicate_lead.yml', 'test/ui/delete_lead.yml', ], - 'css': ['static/src/css/crm.css'], - 'js': ['static/src/js/crm.js'], + 'css': [ + 'static/src/css/crm.css' + ], + 'js': [ + 'static/src/js/crm.js' + ], 'installable': True, 'application': True, 'auto_install': False, - 'images': ['images/crm_dashboard.png', 'images/customers.png','images/leads.png','images/opportunities_kanban.png','images/opportunities_form.png','images/opportunities_calendar.png','images/opportunities_graph.png','images/logged_calls.png','images/scheduled_calls.png','images/stages.png'], + 'images': [ + 'images/crm_dashboard.png', + 'images/customers.png', + 'images/leads.png', + 'images/opportunities_kanban.png', + 'images/opportunities_form.png', + 'images/opportunities_calendar.png', + 'images/opportunities_graph.png', + 'images/logged_calls.png', + 'images/scheduled_calls.png', + 'images/stages.png', + ], } # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/crm/crm.py b/addons/crm/crm.py index 714a2bc7f3f..58238de5640 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -98,6 +98,7 @@ class crm_case_stage(osv.osv): 'case_default': True, } + class crm_case_section(osv.osv): """ Model for sales teams. """ _name = "crm.case.section" @@ -107,7 +108,7 @@ class crm_case_section(osv.osv): _order = "complete_name" def get_full_name(self, cr, uid, ids, field_name, arg, context=None): - return dict(self.name_get(cr, uid, ids, context=context)) + return dict(self.name_get(cr, uid, ids, context=context)) _columns = { 'name': fields.char('Sales Team', size=64, required=True, translate=True), @@ -128,17 +129,19 @@ class crm_case_section(osv.osv): 'alias_id': fields.many2one('mail.alias', 'Alias', ondelete="cascade", required=True, help="The email address associated with this team. New emails received will automatically " "create new leads assigned to the team."), - 'open_lead_ids': fields.one2many('crm.lead', 'section_id', 'Open Leads', readonly=True, + 'open_lead_ids': fields.one2many('crm.lead', 'section_id', + string='Open Leads', readonly=True, domain=['&', ('type', '!=', 'opportunity'), ('state', 'not in', ['done', 'cancel'])]), - 'open_opportunity_ids': fields.one2many('crm.lead', 'section_id', 'Open Opportunities', readonly=True, + 'open_opportunity_ids': fields.one2many('crm.lead', 'section_id', + string='Open Opportunities', readonly=True, domain=['&', '|', ('type', '=', 'opportunity'), ('type', '=', 'both'), ('state', 'not in', ['done', 'cancel'])]), 'color': fields.integer('Color Index'), 'use_leads': fields.boolean('Leads', - help="If checked, this sales team will be available in the sales teams menu and you will be able to manage leads"), + help="This enables the management of leads in the sales team. Otherwise the sales team manages only opportunities."), } def _get_stage_common(self, cr, uid, context): - ids = self.pool.get('crm.case.stage').search(cr, uid, [('case_default','=',1)], context=context) + ids = self.pool.get('crm.case.stage').search(cr, uid, [('case_default', '=', 1)], context=context) return ids _defaults = { diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index ee2253fdf7b..0a51d4f6b49 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -92,9 +92,11 @@ class crm_lead(base_stage, format_address, osv.osv): return super(crm_lead, self).get_empty_list_help(cr, uid, help, context=context) def onchange_user_id(self, cr, uid, ids, section_id, user_id, context=None): + """ When changing the user, also set a section_id or restrict section id + to the ones user_id is member of. """ if user_id: section_ids = self.pool.get('crm.case.section').search(cr, uid, ['|', ('user_id', '=', user_id), ('member_ids', '=', user_id)], context=context) - if section_id and len(section_ids) > 0 and section_id not in section_ids: + if len(section_ids) > 0 and section_id not in section_ids: section_id = section_ids[0] return {'value': {'section_id': section_id}} diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index 29d428ff2b9..e61f80b8077 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -152,11 +152,12 @@ + context="{'default_groups_ref': ['base.group_user', 'base.group_sale_salesman_all_leads'] }"/> diff --git a/addons/crm/crm_phonecall_view.xml b/addons/crm/crm_phonecall_view.xml index d4c81503b87..3efb54f98b8 100644 --- a/addons/crm/crm_phonecall_view.xml +++ b/addons/crm/crm_phonecall_view.xml @@ -103,7 +103,8 @@ - + - + diff --git a/addons/crm/crm_report_view.xml b/addons/crm/crm_report_view.xml index 73f3a58232e..39a2967c947 100644 --- a/addons/crm/crm_report_view.xml +++ b/addons/crm/crm_report_view.xml @@ -33,7 +33,8 @@ - + @@ -53,7 +54,8 @@ - + @@ -115,7 +117,8 @@ - + diff --git a/addons/crm/report/crm_lead_report_view.xml b/addons/crm/report/crm_lead_report_view.xml index 5485e11688f..1009e1c376d 100644 --- a/addons/crm/report/crm_lead_report_view.xml +++ b/addons/crm/report/crm_lead_report_view.xml @@ -19,7 +19,8 @@ - + @@ -77,7 +78,8 @@ help="Leads/Opportunities that are assigned to one of the sale teams I manage"/> - + @@ -134,7 +136,8 @@ - + diff --git a/addons/crm/report/crm_phonecall_report_view.xml b/addons/crm/report/crm_phonecall_report_view.xml index 1513eaa82da..c27d876ddd7 100644 --- a/addons/crm/report/crm_phonecall_report_view.xml +++ b/addons/crm/report/crm_phonecall_report_view.xml @@ -11,7 +11,8 @@ - + @@ -59,7 +60,8 @@ help="Phone calls that are assigned to one of the sale teams I manage"/> - + diff --git a/addons/crm/res_config_view.xml b/addons/crm/res_config_view.xml index 1c460a12422..547ce1c2ae6 100644 --- a/addons/crm/res_config_view.xml +++ b/addons/crm/res_config_view.xml @@ -12,7 +12,7 @@