Browse Source

[IMP] Add company size field

pull/224/head
Antonio Espinosa 10 years ago
committed by Jairo Llopis
parent
commit
204eaec590
  1. 5
      crm_capital/models/crm_lead.py
  2. 4
      crm_capital/models/res_partner.py
  3. 8
      crm_capital/views/crm_lead_view.xml
  4. 5
      crm_capital/views/res_partner_view.xml

5
crm_capital/models/crm_lead.py

@ -14,6 +14,10 @@ class CrmLead(models.Model):
capital_registered = fields.Integer(string="Capital registered")
turnover_range = fields.Many2one(comodel_name='crm.turnover_range')
turnover_number = fields.Integer()
company_size = fields.Selection(
string="Company size",
selection=[('micro', 'Micro'), ('small', 'Small'),
('medium', 'Medium'), ('big', 'Big')])
def _lead_create_contact(self, cr, uid, lead, name, is_company,
parent_id=False, context=None):
@ -28,5 +32,6 @@ class CrmLead(models.Model):
'capital_registered': lead.capital_registered,
'turnover_range': lead.turnover_range.id,
'turnover_number': lead.turnover_number,
'company_size': lead.company_size,
}, context=context)
return partner_id

4
crm_capital/models/res_partner.py

@ -14,3 +14,7 @@ class ResPartner(models.Model):
capital_registered = fields.Integer(string="Capital registered")
turnover_range = fields.Many2one(comodel_name='crm.turnover_range')
turnover_number = fields.Integer()
company_size = fields.Selection(
string="Company size",
selection=[('micro', 'Micro'), ('small', 'Small'),
('medium', 'Medium'), ('big', 'Big')])

8
crm_capital/views/crm_lead_view.xml

@ -14,6 +14,7 @@
<field name="turnover_range" placeholder="Turnover range"
options='{"no_open": True}'/>
<field name="turnover_number"/>
<field name="company_size"/>
</field>
</field>
</record>
@ -30,6 +31,9 @@
<filter string="Turnover"
domain="[]"
context="{'group_by': 'turnover_number'}"/>
<filter string="Company size"
domain="[]"
context="{'group_by': 'company_size'}"/>
</filter>
</field>
</record>
@ -46,6 +50,7 @@
<field name="turnover_range" placeholder="Turnover range"
options='{"no_open": True}'/>
<field name="turnover_number"/>
<field name="company_size"/>
</field>
</field>
</record>
@ -62,6 +67,9 @@
<filter string="Turnover"
domain="[]"
context="{'group_by': 'turnover_number'}"/>
<filter string="Company size"
domain="[]"
context="{'group_by': 'company_size'}"/>
</filter>
</field>
</record>

5
crm_capital/views/res_partner_view.xml

@ -18,6 +18,8 @@
options='{"no_open": True}'/>
<field name="turnover_number"
attrs="{'invisible': [('is_company', '=', False)]}"/>
<field name="company_size"
attrs="{'invisible': [('is_company', '=', False)]}"/>
</field>
</field>
</record>
@ -34,6 +36,9 @@
<filter string="Turnover"
domain="[('is_company', '=', True)]"
context="{'group_by': 'turnover_number'}"/>
<filter string="Company size"
domain="[('is_company', '=', True)]"
context="{'group_by': 'company_size'}"/>
</filter>
</field>
</record>

Loading…
Cancel
Save