[CLEAN] addons: various linkt cleanup (indentation, spaces, ...).
authorThibault Delavallée <tde@openerp.com>
Wed, 3 Apr 2013 08:10:09 +0000 (10:10 +0200)
committerThibault Delavallée <tde@openerp.com>
Wed, 3 Apr 2013 08:10:09 +0000 (10:10 +0200)
bzr revid: tde@openerp.com-20130403081009-jy35sm7dl4pq7eyu

17 files changed:
addons/crm/__openerp__.py
addons/crm/crm.py
addons/crm/crm_lead.py
addons/crm/crm_lead_view.xml
addons/crm/crm_phonecall_view.xml
addons/crm/crm_report_view.xml
addons/crm/report/crm_lead_report_view.xml
addons/crm/report/crm_phonecall_report_view.xml
addons/crm/res_config_view.xml
addons/crm_claim/report/crm_claim_report_view.xml
addons/crm_partner_assign/res_partner_view.xml
addons/mail/static/src/css/mail.css
addons/project/project_view.xml
addons/project_issue/project_issue_menu.xml
addons/project_issue/project_issue_view.xml
addons/sale/sale_view.xml
addons/sale_crm/sale_crm.py

index d5e3808..c4e4db9 100644 (file)
@@ -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:
index 714a2bc..58238de 100644 (file)
@@ -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 = {
index ee2253f..0a51d4f 100644 (file)
@@ -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}}
 
index 29d428f..e61f80b 100644 (file)
                         </group>
                         <group>
                             <field name="user_id" on_change="onchange_user_id(section_id, user_id)"
-                                context="{'default_groups_ref': ['base.group_user', 'base.group_sale_salesman_all_leads']}"/>
+                                context="{'default_groups_ref': ['base.group_user', 'base.group_sale_salesman_all_leads'] }"/>
                             <label for="section_id" groups="base.group_multi_salesteams"/>
                             <div groups="base.group_multi_salesteams">
                                 <field name="section_id"/>
-                                <button name="case_escalate" string="Escalate" type="object" attrs="{'invisible': ['|', ('section_id','=',False), ('state', 'not in', ['draft','open','pending'])]}"/>
+                                <button name="case_escalate" string="Escalate" type="object"
+                                        attrs="{'invisible': ['|', ('section_id','=',False), ('state', 'not in', ['draft','open','pending'])]}"/>
                             </div>
                             <field name="type" invisible="1"/>
                         </group>
index d4c8150..3efb54f 100644 (file)
                         <field name="date"/>
                         <field name="user_id"/>
                         <field name="duration" widget="float_time"/>
-                        <field name="section_id" colspan="1" widget="selection" groups="base.group_multi_salesteams"/>
+                        <field name="section_id" colspan="1" widget="selection"
+                                groups="base.group_multi_salesteams"/>
                         <field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
                         <field name="email_from" invisible="1"/> <!--not needed because of the chatter, thus invisible, but must be in the view as it's returned by onchange_partner_id()-->
                         <field name="categ_id" widget="selection"
                        help="Phone Calls Assigned to the current user or with a team having the current user as team leader"/>
                <field name="partner_id"/>
                <field name="user_id"/>
-               <field name="section_id" string="Sales Team" groups="base.group_multi_salesteams"/>
+               <field name="section_id" string="Sales Team"
+                        groups="base.group_multi_salesteams"/>
                <group expand="0" string="Group By...">
                    <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
                    <filter string="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
index 73f3a58..39a2967 100644 (file)
@@ -33,7 +33,8 @@
                 <field name="name"/>
                 <field name="month"/>
                 <field name="user_id"/>
-                <field name="section_id"  widget="selection" groups="base.group_multi_salesteams"/>
+                <field name="section_id" widget="selection"
+                        groups="base.group_multi_salesteams"/>
                 <field name="category2_id" />
                 <field name="stage_id"/>
                 <field name="amount_revenue"/>
@@ -53,7 +54,8 @@
             <graph string="Cases by Teams and Type" type="bar" orientation="horizontal">
                 <field name="category2_id"/>
                 <field name="amount_revenue" operator="+"/>
-                <field name="section_id" group="True" groups="base.group_multi_salesteams"/>
+                <field name="section_id" group="True"
+                        groups="base.group_multi_salesteams"/>
             </graph>
         </field>
     </record>
                 <field name="name"/>
                 <field name="month"/>
                 <field name="user_id"/>
-                <field name="section_id"  widget="selection" groups="base.group_multi_salesteams"/>
+                <field name="section_id" widget="selection"
+                        groups="base.group_multi_salesteams"/>
                 <field name="stage_id"/>
                 <field name="amount_revenue"/>
                 <field name="nbr" />
index 5485e11..1009e1c 100644 (file)
@@ -19,7 +19,8 @@
                 <field name="channel_id" invisible="1"/>
                 <field name="type" invisible="1"/>
                 <field name="priority" invisible="1"/>
-                <field name="section_id" invisible="1" groups="base.group_multi_salesteams"/>
+                <field name="section_id" invisible="1"
+                        groups="base.group_multi_salesteams"/>
                 <field name="user_id" invisible="1"/>
                 <field name="company_id" invisible="1"/>
                 <field name="partner_id" invisible="1"/>
@@ -77,7 +78,8 @@
                             help="Leads/Opportunities that are assigned to one of the sale teams I manage"/>
                     <separator/>
                     <filter icon="terp-personal" string="My Case(s)" help="Leads/Opportunities that are assigned to me" domain="[('user_id','=',uid)]"/>
-                    <field name="section_id" context="{'invisible_section': False}" groups="base.group_multi_salesteams"/>
+                    <field name="section_id" context="{'invisible_section': False}"
+                            groups="base.group_multi_salesteams"/>
                     <field name="user_id" string="Salesperson"/>
                     <group expand="0" string="Extended Filters...">
                         <field name="partner_id"/>
                 <field name="creation_month" invisible="1"/>
                 <field name="creation_day" invisible="1"/>
                 <field name="deadline_month" invisible="1"/>
-                <field name="section_id" invisible="1" groups="base.group_multi_salesteams"/>
+                <field name="section_id" invisible="1"
+                        groups="base.group_multi_salesteams"/>
                 <field name="user_id" invisible="1"/>
                 <field name="partner_id" invisible="1"/>
                 <field name="country_id" invisible="1"/>
index 1513eaa..c27d876 100644 (file)
@@ -11,7 +11,8 @@
                 <tree string="Phone calls" create="false">
                     <field name="name" invisible="1"/>
                     <field name="month" invisible="1"/>
-                    <field name="section_id" invisible="1" groups="base.group_multi_salesteams"/>
+                    <field name="section_id" invisible="1"
+                            groups="base.group_multi_salesteams"/>
                     <field name="priority" invisible="1"/>
                     <field name="user_id" invisible="1"/>
                     <field name="company_id" invisible="1"/>
@@ -59,7 +60,8 @@
                             help="Phone calls that are assigned to one of the sale teams I manage"/>
                     <separator/>
                     <filter icon="terp-personal" string="My Phone Calls" help="Phone Calls that are assigned to me" domain="[('user_id','=',uid)]" />
-                    <field name="section_id" string="Sales Team" context="{'invisible_section': False}" groups="base.group_multi_salesteams"/>
+                    <field name="section_id" string="Sales Team" context="{'invisible_section': False}"
+                            groups="base.group_multi_salesteams"/>
                     <field name="user_id" string="Salesperson"/>
                     <group expand="0" string="Extended Filters...">
                         <field name="partner_id"/>
index 1c460a1..547ce1c 100644 (file)
@@ -12,7 +12,7 @@
                     <group>
                         <label for="id" string="Features"/>
                         <div>
-                            <div> 
+                            <div>
                                 <field name="module_crm_claim" class="oe_inline"/>
                                 <label for="module_crm_claim"/>
                             </div>
index 991810e..febf9ca 100644 (file)
@@ -11,7 +11,8 @@
                <tree string="Claims" create="false">
                     <field name="name" invisible="1"/>
                     <field name="month" invisible="1"/>
-                    <field name="section_id" invisible="1" groups="base.group_multi_salesteams"/>
+                    <field name="section_id" invisible="1"
+                            groups="base.group_multi_salesteams"/>
                     <field name="user_id" invisible="1"/>
                     <field name="company_id" invisible="1"/>
                     <field name="partner_id" invisible="1"/>
@@ -61,7 +62,8 @@
                     <filter icon="terp-personal" string="My Case(s)" help="My Case(s)" domain="[('user_id','=',uid)]" />
                     <field name="company_id" groups="base.group_multi_company"/>
                     <field name="user_id" string="Salesperson"/>
-                    <field name="section_id" string="Sales Team" context="{'invisible_section': False}" groups="base.group_multi_salesteams"/>
+                    <field name="section_id" string="Sales Team" context="{'invisible_section': False}"
+                            groups="base.group_multi_salesteams"/>
                     <group  expand="0" string="Extended Filters...">
                         <field name="partner_id"/>
                         <field name="stage_id" domain="[('section_ids', '=', 'section_id')]"/>
index a6e2e69..9e70835 100644 (file)
                              <field name="type"/>
                              <field name="stage_id"/>
                              <button name="stage_previous" string="Previous"
-                                 states="open,pending" type="object" icon="gtk-go-back" />
+                                    states="open,pending" type="object" icon="gtk-go-back" />
                              <button name="stage_next" string="Next"
-                                 states="open,pending" type="object"
-                                 icon="gtk-go-forward" />
+                                    states="open,pending" type="object"
+                                    icon="gtk-go-forward" />
                              <field name="section_id"
-                                 invisible="context.get('invisible_section', True)"  groups="base.group_multi_salesteams"/>
+                                    invisible="context.get('invisible_section', True)"
+                                    groups="base.group_multi_salesteams"/>
                              <field name="user_id" />
                              <field name="state" />
                              <button name="case_cancel" string="Cancel"
-                                 states="draft,open,pending" type="object"
-                                 icon="gtk-cancel" />
+                                    states="draft,open,pending" type="object"
+                                    icon="gtk-cancel" />
                              <button name="case_open" string="Open"
-                                 states="draft,pending" type="object"
-                                 icon="gtk-go-forward" />
+                                    states="draft,pending" type="object"
+                                    icon="gtk-go-forward" />
                              <button name="case_close" string="Close"
-                                 states="open,draft,pending" type="object"
-                                 icon="gtk-close" />
+                                    states="open,draft,pending" type="object"
+                                    icon="gtk-close" />
                              <button string="Convert to Opportunity"
-                                 name="convert_opportunity"
-                                 states="draft,open,pending" icon="gtk-index"
-                                 type="object" attrs="{'invisible':[('type','=','opportunity')]}" />
+                                    name="convert_opportunity"
+                                    states="draft,open,pending" icon="gtk-index"
+                                    type="object" attrs="{'invisible':[('type','=','opportunity')]}" />
                              <button name="case_escalate" string="Escalate"
-                                 states="open,draft,pending" type="object"
-                                 icon="gtk-go-up" />
+                                    states="open,draft,pending" type="object"
+                                    icon="gtk-go-up" />
                          </tree>
                     </field>
                 </page>
index e54a2d0..2b5100f 100644 (file)
@@ -4,6 +4,7 @@
  * 'button' element wich comes with a lot of inappropriate 
  * styling. Entypo is also a headache to center properly
  * */
 .openerp .oe_topbar_item.oe_topbar_compose_full_email{ 
     padding: 0px;
     width: 32px;
index d2086c3..183bc9a 100644 (file)
             }</field>
             <field name="search_view_id" ref="view_task_search_form"/>
             <field name="help" type="html">
-              <p>
-                OpenERP's project management allows you to manage the pipeline
-                of tasks in order to get things done efficiently. You can
-                track progress, discuss on tasks, attach documents, etc.
-              </p>
+                <p>
+                    OpenERP's project management allows you to manage the pipeline
+                    of tasks in order to get things done efficiently. You can
+                    track progress, discuss on tasks, attach documents, etc.
+                </p>
             </field>
         </record>
 
             <field name="view_mode">kanban,tree,form,calendar,gantt,graph</field>
             <field name="search_view_id" ref="view_task_search_form"/>
             <field name="help" type="html">
-              <p>
-                OpenERP's project management allows you to manage the pipeline
-                of tasks in order to get things done efficiently. You can
-                track progress, discuss on tasks, attach documents, etc.
-              </p>
+                <p>
+                    OpenERP's project management allows you to manage the pipeline
+                    of tasks in order to get things done efficiently. You can
+                    track progress, discuss on tasks, attach documents, etc.
+                </p>
             </field>
         </record>
         <record id="open_view_task_list_kanban" model="ir.actions.act_window.view">
index ad08eda..308b488 100644 (file)
         <field name="domain" eval=""/>
         <field name="search_view_id" ref="view_project_issue_filter"/>
         <field name="help" type="html">
-          <p>
-            The OpenERP issues tacker allows you to efficiantly manage things
-            like internal requests, software development bugs, customer
-            complaints, project troubles, material breakdowns, etc.
-          </p>
+            <p>
+                The OpenERP issues tacker allows you to efficiantly manage things
+                like internal requests, software development bugs, customer
+                complaints, project troubles, material breakdowns, etc.
+            </p>
         </field>
     </record>
 
index 6547b3e..c0132bc 100644 (file)
             <field name="name">Issues</field>
             <field name="view_mode">kanban,tree,form,calendar,graph</field>
             <field name="context">{
-                'search_default_project_id': [active_id], 
-                'default_project_id': active_id
-            }</field>
+                    'search_default_project_id': [active_id], 
+                    'default_project_id': active_id,
+                }
+            </field>
             <field name="help" type="html">
-              <p>
-                The OpenERP issues tacker allows you to efficiantly manage things
-                like internal requests, software development bugs, customer
-                complaints, project troubles, material breakdowns, etc.
-              </p>
+                <p>
+                    The OpenERP issues tacker allows you to efficiantly manage things
+                    like internal requests, software development bugs, customer
+                    complaints, project troubles, material breakdowns, etc.
+                </p>
             </field>
         </record>
 
index 8de0bd3..9766b5f 100644 (file)
             <field name="view_type">form</field>
             <field name="view_mode">tree,form,calendar,graph</field>
             <field name="search_view_id" ref="view_sales_order_filter"/>
-            <field name="context">{'show_address': 1, 'search_default_my_sale_orders_filter': 1}</field>
-            <field name="domain">[('state','not in',('draft','sent','cancel'))]</field>
+            <field name="context">{
+                    'show_address': 1,
+                    'search_default_my_sale_orders_filter': 1
+                }
+            </field>
+            <field name="domain">[('state', 'not in', ('draft', 'sent', 'cancel'))]</field>
             <field name="help" type="html">
-              <p class="oe_view_nocontent_create">
-                Click to create a quotation that can be converted into a sales
-                order.
-              </p><p>
-                OpenERP will help you efficiently handle the complete sales flow:
-                quotation, sales order, delivery, invoicing and payment.
-              </p>
+                <p class="oe_view_nocontent_create">
+                    Click to create a quotation that can be converted into a sales
+                    order.
+                </p><p>
+                    OpenERP will help you efficiently handle the complete sales flow:
+                    quotation, sales order, delivery, invoicing and payment.
+                </p>
             </field>
         </record>
 
index 76ce06f..3177aec 100644 (file)
@@ -19,8 +19,8 @@
 #
 ##############################################################################
 
-from openerp.osv import osv, fields
 from datetime import datetime
+from openerp.osv import osv, fields
 
 
 class sale_order(osv.osv):
@@ -46,11 +46,14 @@ class crm_case_section(osv.osv):
         return res
 
     _columns = {
-        'quotation_ids': fields.one2many('sale.order', 'section_id', 'Quotations', readonly=True,
+        'quotation_ids': fields.one2many('sale.order', 'section_id',
+            string='Quotations', readonly=True,
             domain=[('state', 'in', ['draft', 'sent', 'cancel'])]),
-        'sale_order_ids': fields.one2many('sale.order', 'section_id', 'Sale Orders', readonly=True,
+        'sale_order_ids': fields.one2many('sale.order', 'section_id',
+            string='Sale Orders', readonly=True,
             domain=[('state', 'not in', ['draft', 'sent', 'cancel'])]),
-        'invoice_ids': fields.one2many('account.invoice', 'section_id', 'Invoices', readonly=True,
+        'invoice_ids': fields.one2many('account.invoice', 'section_id',
+            string='Invoices', readonly=True,
             domain=[('state', 'not in', ['draft', 'cancel'])]),
         'sum_month_invoice': fields.function(_get_sum_month_invoice,
             string='Total invoiced this month',