Skip to content

Commit

Permalink
[IMP] add fields to manage many things with hear about us
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieuvatel committed Dec 24, 2015
1 parent 5c1c817 commit 5e86c2f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
11 changes: 10 additions & 1 deletion crm_hear_about_us/crm.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,27 @@

from openerp import models, fields


class crm_heard_about_us(models.Model):
_name = 'crm.hear.about.us'
_description = 'How did the customer hear about us'
_order = 'sequence'

sequence = fields.Integer(default=10)
name = fields.Char(translate=True, required=True)
type = fields.Selection([
('all', 'All'),
('crm', 'CRM'),
], string='Type', default='all', required=True)
affiliate = fields.Boolean('Affiliate ?',)
other = fields.Boolean('Other',)


class crm_lead(models.Model):
_inherit = 'crm.lead'

hear_about_us_id = fields.Many2one('crm.hear.about.us',
'How did the customer hear about us ?')
'How did the customer hear about us ?',
domain=[('type', 'in', ('all', 'crm'))])

# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
4 changes: 4 additions & 0 deletions crm_hear_about_us/crm_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<tree string="Hear about us">
<field name="sequence" widget="handle"/>
<field name="name"/>
<field name="type"/>
</tree>
</field>
</record>
Expand All @@ -21,6 +22,9 @@
<group>
<field name="name"/>
<field name="sequence"/>
<field name="type"/>
<field name="affiliate"/>
<field name="other"/>
</group>
</form>
</field>
Expand Down

0 comments on commit 5e86c2f

Please sign in to comment.