diff options
| author | Thibault Delavallée <tde@openerp.com> | 2012-06-28 17:12:32 +0200 |
|---|---|---|
| committer | Thibault Delavallée <tde@openerp.com> | 2012-06-28 17:12:32 +0200 |
| commit | 4e793c24cb11eb52df1435a2ad93fd507e48bd6f (patch) | |
| tree | 9272b9c3441017ad6fec3137656cc856728affc7 /addons | |
| parent | d70a606f40a37843a31842467124353706ae29e1 (diff) | |
| parent | 016d10e0c266199bbf7fd2fd452761c9f558f4ba (diff) | |
[MERGE] Separate crm.lead model from res.partner.
Currently, crm.lead inherit from res.partner, in order to have some address fields. It was previously inheriting from res.partner.address, and now from res.partner since the merge of the two models. In order to clean the models, crm.lead should be independent from res.partner.
Specs:
- copy fields required for the views
- remove the inherit from res.partner
bzr revid: tde@openerp.com-20120628151232-90b0ied228r82q38
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/crm/crm_lead.py | 16 | ||||
| -rw-r--r-- | addons/crm/crm_lead_view.xml | 2 |
2 files changed, 16 insertions, 2 deletions
diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index fa4643db156..92dd6d6e837 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -40,7 +40,7 @@ class crm_lead(base_stage, osv.osv): _name = "crm.lead" _description = "Lead/Opportunity" _order = "priority,date_action,id desc" - _inherit = ['ir.needaction_mixin', 'mail.thread','res.partner'] + _inherit = ['ir.needaction_mixin', 'mail.thread'] def _get_default_section_id(self, cr, uid, context=None): """ Gives default section by checking if present in the context """ @@ -245,6 +245,20 @@ class crm_lead(base_stage, osv.osv): 'company_currency': fields.related('company_id', 'currency_id', 'symbol', type='char', string='Company Currency', readonly=True), 'user_email': fields.related('user_id', 'user_email', type='char', string='User Email', readonly=True), 'user_login': fields.related('user_id', 'login', type='char', string='User Login', readonly=True), + + # Fields for address, due to separation from crm and res.partner + 'street': fields.char('Street', size=128), + 'street2': fields.char('Street2', size=128), + 'zip': fields.char('Zip', change_default=True, size=24), + 'city': fields.char('City', size=128), + 'state_id': fields.many2one("res.country.state", 'State', domain="[('country_id','=',country_id)]"), + 'country_id': fields.many2one('res.country', 'Country'), + 'phone': fields.char('Phone', size=64), + 'fax': fields.char('Fax', size=64), + 'mobile': fields.char('Mobile', size=64), + 'function': fields.char('Function', size=128), + 'title': fields.many2one('res.partner.title', 'Title'), + 'company_id': fields.many2one('res.company', 'Company', select=1), } _defaults = { diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index d9c65daaada..d9dd524447f 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -590,7 +590,7 @@ help="Opportunities that are assigned to either me or one of the sale teams I manage" /> <separator orientation="vertical"/> <field name="user_id"/> - <field name="country"/> + <field name="country_id"/> <field name="partner_id"/> <field name="section_id" context="{'invisible_section': False, 'default_section_id': self}"/> |
