'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:
'case_default': True,
}
+
class crm_case_section(osv.osv):
""" Model for sales teams. """
_name = "crm.case.section"
_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),
'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 = {
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}}
</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>
<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'}"/>
<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"/>
<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" />
<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"/>
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"/>
<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"/>
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"/>
<group>
<label for="id" string="Features"/>
<div>
- <div>
+ <div>
<field name="module_crm_claim" class="oe_inline"/>
<label for="module_crm_claim"/>
</div>
<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"/>
<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')]"/>
<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>
* '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;
}</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">
<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>
<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>
<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>
#
##############################################################################
-from openerp.osv import osv, fields
from datetime import datetime
+from openerp.osv import osv, fields
class sale_order(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',