diff --git a/base_contact/base_contact.py b/base_contact/base_contact.py index cb4b79439..038336d5d 100644 --- a/base_contact/base_contact.py +++ b/base_contact/base_contact.py @@ -110,10 +110,16 @@ class res_partner(osv.osv): return result def onchange_contact_id(self, cr, uid, ids, contact_id, context=None): + values = {} if contact_id: - name = self.browse(cr, uid, contact_id, context=context).name - return {'value': {'name': name}} - return {} + values['name'] = self.browse(cr, uid, contact_id, context=context).name + return {'value': values} + + def onchange_contact_type(self, cr, uid, ids, contact_type, context=None): + values = {} + if contact_type == 'standalone': + values['contact_id'] = False + return {'value': values} class ir_actions_window(osv.osv): diff --git a/base_contact/base_contact_view.xml b/base_contact/base_contact_view.xml index 93eeac5aa..29080f270 100644 --- a/base_contact/base_contact_view.xml +++ b/base_contact/base_contact_view.xml @@ -153,7 +153,8 @@

- To see personal information about this contact, please go to to the his person form: + To see personal information about this contact, please go to to the his person form:

@@ -162,7 +163,7 @@
- +