Browse Source

[MIG] inital work to 10.0

pull/347/head
Nicolas JEUDY 8 years ago
parent
commit
a722dba696
  1. 7
      partner_contact_in_several_companies/README.rst
  2. 2
      partner_contact_in_several_companies/__init__.py
  3. 7
      partner_contact_in_several_companies/__manifest__.py
  4. 2
      partner_contact_in_several_companies/models/__init__.py
  5. 2
      partner_contact_in_several_companies/models/ir_actions.py
  6. 28
      partner_contact_in_several_companies/models/res_partner.py
  7. 2
      partner_contact_in_several_companies/tests/__init__.py
  8. 83
      partner_contact_in_several_companies/tests/test_partner_contact_in_several_companies.py
  9. 8
      partner_contact_in_several_companies/views/res_partner.xml

7
partner_contact_in_several_companies/README.rst

@ -32,7 +32,7 @@ For further information, please visit:
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot :alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/134/9.0
:target: https://runbot.odoo-community.org/runbot/134/10.0
Known issues / Roadmap Known issues / Roadmap
====================== ======================
@ -48,7 +48,7 @@ In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed feedback `here <https://github.com/OCA/ If you spotted it first, help us smashing it by providing a detailed and welcomed feedback `here <https://github.com/OCA/
partner-contact/issues/new?body=module:%20 partner-contact/issues/new?body=module:%20
partner_contact_in_serveral_companies%0Aversion:%20 partner_contact_in_serveral_companies%0Aversion:%20
9.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
10.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Credits Credits
@ -57,7 +57,7 @@ Credits
Contributors Contributors
------------ ------------
* Xavier ALT <xal@openerp.com> (original author)
* Xavier ALT <xal@odoo.com> (original author)
* El Hadji Dem <elhadji.dem@savoirfairelinux.com> * El Hadji Dem <elhadji.dem@savoirfairelinux.com>
* TheCloneMaster <the.clone.master@gmail.com> * TheCloneMaster <the.clone.master@gmail.com>
* Sandy Carter <bwrsandman@gmail.com> * Sandy Carter <bwrsandman@gmail.com>
@ -65,6 +65,7 @@ Contributors
* Sebastien Alix <sebastien.alix@osiell.com> * Sebastien Alix <sebastien.alix@osiell.com>
* Jairo Llopis <j.llopis@grupoesoc.es> * Jairo Llopis <j.llopis@grupoesoc.es>
* Richard deMeester <richard@willowit.com.au> * Richard deMeester <richard@willowit.com.au>
* Nicolas JEUDY <https://github.com/njeudy>
Maintainer Maintainer
---------- ----------

2
partner_contact_in_several_companies/__init__.py

@ -1,4 +1,4 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import models
import models

7
partner_contact_in_several_companies/__manifest__.py

@ -4,12 +4,12 @@
{ {
"name": "Contacts in several partners", "name": "Contacts in several partners",
"summary": "Allow to have one contact in several partners", "summary": "Allow to have one contact in several partners",
"version": "9.0.1.0.0",
"version": "10.0.1.0.0",
"category": "Customer Relationship Management", "category": "Customer Relationship Management",
"website": "https://odoo-community.org/", "website": "https://odoo-community.org/",
"author": "Odoo Community Association (OCA)", "author": "Odoo Community Association (OCA)",
"contributors": [ "contributors": [
'Xavier ALT <xal@openerp.com>',
'Xavier ALT <xal@odoo.com>',
'El Hadji Dem <elhadji.dem@savoirfairelinux.com>', 'El Hadji Dem <elhadji.dem@savoirfairelinux.com>',
'TheCloneMaster <the.clone.master@gmail.com>', 'TheCloneMaster <the.clone.master@gmail.com>',
'Sandy Carter <bwrsandman@gmail.com>', 'Sandy Carter <bwrsandman@gmail.com>',
@ -17,10 +17,11 @@
'Sebastien Alix <sebastien.alix@osiell.com>', 'Sebastien Alix <sebastien.alix@osiell.com>',
'Jairo Llopis <j.llopis@grupoesoc.es>', 'Jairo Llopis <j.llopis@grupoesoc.es>',
'Richard deMeester <richard@willowit.com.au>', 'Richard deMeester <richard@willowit.com.au>',
'Nicolas JEUDY <https://github.com/njeudy>',
], ],
"license": "AGPL-3", "license": "AGPL-3",
'application': False, 'application': False,
'installable': False,
'installable': True,
'auto_install': False, 'auto_install': False,
"depends": [ "depends": [
"base", "base",

2
partner_contact_in_several_companies/models/__init__.py

@ -1,4 +1,4 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import res_partner, ir_actions
import res_partner, ir_actions

2
partner_contact_in_several_companies/models/ir_actions.py

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, api
from odoo import models, api
class IRActionsWindow(models.Model): class IRActionsWindow(models.Model):

28
partner_contact_in_several_companies/models/res_partner.py

@ -1,8 +1,8 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import fields, models, _, api
from openerp.osv import expression
from odoo import fields, models, _, api
from odoo.osv import expression
class ResPartner(models.Model): class ResPartner(models.Model):
@ -12,8 +12,7 @@ class ResPartner(models.Model):
[('standalone', _('Standalone Contact')), [('standalone', _('Standalone Contact')),
('attached', _('Attached to existing Contact')), ('attached', _('Attached to existing Contact')),
], ],
compute='_get_contact_type',
required=True, select=1, store=True,
required=True,
default='standalone') default='standalone')
contact_id = fields.Many2one('res.partner', string='Main Contact', contact_id = fields.Many2one('res.partner', string='Main Contact',
domain=[('is_company', '=', False), domain=[('is_company', '=', False),
@ -23,10 +22,10 @@ class ResPartner(models.Model):
other_contact_ids = fields.One2many('res.partner', 'contact_id', other_contact_ids = fields.One2many('res.partner', 'contact_id',
string='Others Positions') string='Others Positions')
@api.one
@api.depends('contact_id')
@api.onchange('contact_id')
def _get_contact_type(self): def _get_contact_type(self):
self.contact_type = self.contact_id and 'attached' or 'standalone'
for record in self:
record.contact_type = record.contact_id and 'attached' or 'standalone'
def _basecontact_check_context(self, mode): def _basecontact_check_context(self, mode):
""" Remove 'search_show_all_positions' for non-search mode. """ Remove 'search_show_all_positions' for non-search mode.
@ -115,8 +114,7 @@ class ResPartner(models.Model):
self.ensure_one() self.ensure_one()
if self.contact_id: if self.contact_id:
contact_fields = self._contact_fields() contact_fields = self._contact_fields()
sync_vals = self._update_fields_values(self.contact_id,
contact_fields)
sync_vals = self._update_fields_values(contact_fields)
self.write(sync_vals) self.write(sync_vals)
def update_contact(self, vals): def update_contact(self, vals):
@ -130,24 +128,24 @@ class ResPartner(models.Model):
self.with_context(__update_contact_lock=True).write(contact_vals) self.with_context(__update_contact_lock=True).write(contact_vals)
@api.model @api.model
def _fields_sync(self, partner, update_values):
def _fields_sync(self, update_values):
"""Sync commercial fields and address fields from company and to """Sync commercial fields and address fields from company and to
children, contact fields from contact and to attached contact children, contact fields from contact and to attached contact
after create/update, just as if those were all modeled as after create/update, just as if those were all modeled as
fields.related to the parent fields.related to the parent
""" """
super(ResPartner, self)._fields_sync(partner, update_values)
super(ResPartner, self)._fields_sync(update_values)
contact_fields = self._contact_fields() contact_fields = self._contact_fields()
# 1. From UPSTREAM: sync from parent contact # 1. From UPSTREAM: sync from parent contact
if update_values.get('contact_id'): if update_values.get('contact_id'):
partner._contact_sync_from_parent()
self._contact_sync_from_parent()
# 2. To DOWNSTREAM: sync contact fields to parent or related # 2. To DOWNSTREAM: sync contact fields to parent or related
elif any(field in contact_fields for field in update_values): elif any(field in contact_fields for field in update_values):
update_ids = [ update_ids = [
c.id for c in partner.other_contact_ids if not c.is_company
c.id for c in self.other_contact_ids if not c.is_company
] ]
if partner.contact_id:
update_ids.append(partner.contact_id.id)
if self.contact_id:
update_ids.append(self.contact_id.id)
self.browse(update_ids).update_contact(update_values) self.browse(update_ids).update_contact(update_values)
@api.onchange('contact_id') @api.onchange('contact_id')

2
partner_contact_in_several_companies/tests/__init__.py

@ -1,4 +1,4 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import test_partner_contact_in_several_companies
import test_partner_contact_in_several_companies

83
partner_contact_in_several_companies/tests/test_partner_contact_in_several_companies.py

@ -1,7 +1,8 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp.tests import common
from odoo import api, SUPERUSER_ID
from odoo.tests import common
class PartnerContactInSeveralCompaniesCase(common.TransactionCase): class PartnerContactInSeveralCompaniesCase(common.TransactionCase):
@ -10,9 +11,10 @@ class PartnerContactInSeveralCompaniesCase(common.TransactionCase):
"""*****setUp*****""" """*****setUp*****"""
super(PartnerContactInSeveralCompaniesCase, self).setUp() super(PartnerContactInSeveralCompaniesCase, self).setUp()
cr, uid = self.cr, self.uid cr, uid = self.cr, self.uid
ModelData = self.registry('ir.model.data')
self.partner = self.registry('res.partner')
self.action = self.registry('ir.actions.act_window')
env = api.Environment(cr, SUPERUSER_ID, {})
ModelData = env['ir.model.data']
self.partner = env['res.partner']
self.action = env['ir.actions.act_window']
# Get test records reference # Get test records reference
for attr, module, name in [ for attr, module, name in [
@ -32,7 +34,7 @@ class PartnerContactInSeveralCompaniesCase(common.TransactionCase):
'partner_contact_in_several_companies', 'partner_contact_in_several_companies',
'action_partner_form'), 'action_partner_form'),
]: ]:
r = ModelData.get_object_reference(cr, uid, module, name)
r = ModelData.get_object_reference(module, name)
setattr(self, attr, r[1] if r else False) setattr(self, attr, r[1] if r else False)
def test_00_show_only_standalone_contact(self): def test_00_show_only_standalone_contact(self):
@ -43,7 +45,7 @@ class PartnerContactInSeveralCompaniesCase(common.TransactionCase):
ctx = {'search_show_all_positions': {'is_set': True, ctx = {'search_show_all_positions': {'is_set': True,
'set_value': False 'set_value': False
}} }}
partner_ids = self.partner.search(cr, uid, [], context=ctx)
partner_ids = self.partner.search([])
partner_ids.sort() partner_ids.sort()
self.assertTrue(self.bob_job1_id not in partner_ids) self.assertTrue(self.bob_job1_id not in partner_ids)
self.assertTrue(self.roger_job2_id not in partner_ids) self.assertTrue(self.roger_job2_id not in partner_ids)
@ -53,21 +55,20 @@ class PartnerContactInSeveralCompaniesCase(common.TransactionCase):
explicitly state to display all positions or the "is_set" explicitly state to display all positions or the "is_set"
value has been set to False. value has been set to False.
""" """
cr, uid = self.cr, self.uid
partner_ids = self.partner.search(cr, uid, [], context=None)
partner_ids = self.partner.search([])
self.assertTrue(self.bob_job1_id in partner_ids) self.assertTrue(self.bob_job1_id in partner_ids)
self.assertTrue(self.roger_job2_id in partner_ids) self.assertTrue(self.roger_job2_id in partner_ids)
ctx = {'search_show_all_positions': {'is_set': False}} ctx = {'search_show_all_positions': {'is_set': False}}
partner_ids = self.partner.search(cr, uid, [], context=ctx)
partner_ids = self.partner.search([])
self.assertTrue(self.bob_job1_id in partner_ids) self.assertTrue(self.bob_job1_id in partner_ids)
self.assertTrue(self.roger_job2_id in partner_ids) self.assertTrue(self.roger_job2_id in partner_ids)
ctx = {'search_show_all_positions': {'is_set': True, ctx = {'search_show_all_positions': {'is_set': True,
'set_value': True 'set_value': True
}} }}
partner_ids = self.partner.search(cr, uid, [], context=ctx)
partner_ids = self.partner.search([])
self.assertTrue(self.bob_job1_id in partner_ids) self.assertTrue(self.bob_job1_id in partner_ids)
self.assertTrue(self.roger_job2_id in partner_ids) self.assertTrue(self.roger_job2_id in partner_ids)
@ -75,16 +76,14 @@ class PartnerContactInSeveralCompaniesCase(common.TransactionCase):
"""Check that readonly partner's ``other_contact_ids`` return """Check that readonly partner's ``other_contact_ids`` return
all values whatever the context all values whatever the context
""" """
cr, uid = self.cr, self.uid
def read_other_contacts(pid, context=None): def read_other_contacts(pid, context=None):
return self.partner.read( return self.partner.read(
cr, uid, [pid], ['other_contact_ids'],
context=context)[0]['other_contact_ids']
cr, uid, [pid], ['other_contact_ids'])[0]['other_contact_ids']
def read_contacts(pid, context=None): def read_contacts(pid, context=None):
return self.partner.read( return self.partner.read(
cr, uid, [pid], ['child_ids'], context=context)[0]['child_ids']
[pid], ['child_ids'])[0]['child_ids']
ctx = None ctx = None
self.assertEqual( self.assertEqual(
@ -93,63 +92,59 @@ class PartnerContactInSeveralCompaniesCase(common.TransactionCase):
) )
ctx = {'search_show_all_positions': {'is_set': False}} ctx = {'search_show_all_positions': {'is_set': False}}
self.assertEqual(read_other_contacts( self.assertEqual(read_other_contacts(
self.bob_contact_id, context=ctx),
self.bob_contact_id),
[self.bob_job1_id], [self.bob_job1_id],
) )
ctx = {'search_show_all_positions': {'is_set': True, ctx = {'search_show_all_positions': {'is_set': True,
'set_value': False 'set_value': False
}} }}
self.assertEqual(read_other_contacts( self.assertEqual(read_other_contacts(
self.bob_contact_id, context=ctx),
self.bob_contact_id,),
[self.bob_job1_id], [self.bob_job1_id],
) )
ctx = {'search_show_all_positions': {'is_set': True, ctx = {'search_show_all_positions': {'is_set': True,
'set_value': True 'set_value': True
}} }}
self.assertEqual( self.assertEqual(
read_other_contacts(self.bob_contact_id, context=ctx),
read_other_contacts(self.bob_contact_id),
[self.bob_job1_id], [self.bob_job1_id],
) )
ctx = None ctx = None
self.assertIn( self.assertIn(
self.bob_job1_id, self.bob_job1_id,
read_contacts(self.main_partner_id, context=ctx),
read_contacts(self.main_partner_id),
) )
ctx = {'search_show_all_positions': {'is_set': False}} ctx = {'search_show_all_positions': {'is_set': False}}
self.assertIn( self.assertIn(
self.bob_job1_id, self.bob_job1_id,
read_contacts(self.main_partner_id, context=ctx),
read_contacts(self.main_partner_id),
) )
ctx = {'search_show_all_positions': {'is_set': True, ctx = {'search_show_all_positions': {'is_set': True,
'set_value': False 'set_value': False
}} }}
self.assertIn( self.assertIn(
self.bob_job1_id, self.bob_job1_id,
read_contacts(self.main_partner_id, context=ctx),
read_contacts(self.main_partner_id),
) )
ctx = {'search_show_all_positions': {'is_set': True, ctx = {'search_show_all_positions': {'is_set': True,
'set_value': True 'set_value': True
}} }}
self.assertIn( self.assertIn(
self.bob_job1_id, self.bob_job1_id,
read_contacts(self.main_partner_id, context=ctx),
read_contacts(self.main_partner_id),
) )
def test_03_search_match_attached_contacts(self): def test_03_search_match_attached_contacts(self):
"""Check that searching partner also return partners having """Check that searching partner also return partners having
attached contacts matching search criteria attached contacts matching search criteria
""" """
cr, uid = self.cr, self.uid
# Bob's contact has one other position which is related to # Bob's contact has one other position which is related to
# 'YourCompany' # 'YourCompany'
# so search for all contacts working for 'YourCompany' # so search for all contacts working for 'YourCompany'
# should contain Bob position. # should contain Bob position.
partner_ids = self.partner.search( partner_ids = self.partner.search(
cr, uid,
[('parent_id', 'ilike', 'YourCompany')],
context=None
)
[('parent_id', 'ilike', 'YourCompany')])
self.assertIn(self.bob_job1_id, partner_ids, ) self.assertIn(self.bob_job1_id, partner_ids, )
# but when searching without 'all positions', # but when searching without 'all positions',
@ -158,18 +153,14 @@ class PartnerContactInSeveralCompaniesCase(common.TransactionCase):
'set_value': False 'set_value': False
}} }}
partner_ids = self.partner.search( partner_ids = self.partner.search(
cr, uid,
[('parent_id', 'ilike', 'YourCompany')],
context=ctx
)
[('parent_id', 'ilike', 'YourCompany')])
self.assertIn(self.bob_contact_id, partner_ids, ) self.assertIn(self.bob_contact_id, partner_ids, )
def test_04_contact_creation(self): def test_04_contact_creation(self):
"""Check that we're begin to create a contact""" """Check that we're begin to create a contact"""
cr, uid = self.cr, self.uid
# Create a contact using only name # Create a contact using only name
new_contact_id = self.partner.create(cr, uid, {'name': 'Bob Egnops'})
new_contact_id = self.partner.create({'name': 'Bob Egnops'})
self.assertEqual( self.assertEqual(
self.partner.browse(cr, uid, new_contact_id).contact_type, self.partner.browse(cr, uid, new_contact_id).contact_type,
'standalone', 'standalone',
@ -177,26 +168,26 @@ class PartnerContactInSeveralCompaniesCase(common.TransactionCase):
# Create a contact with only contact_id # Create a contact with only contact_id
new_contact_id = self.partner.create( new_contact_id = self.partner.create(
cr, uid, {'contact_id': self.bob_contact_id}
{'contact_id': self.bob_contact_id}
) )
new_contact = self.partner.browse(cr, uid, new_contact_id)
new_contact = self.partner.browse(new_contact_id)
self.assertEqual(new_contact.name, 'Bob Egnops') self.assertEqual(new_contact.name, 'Bob Egnops')
self.assertEqual(new_contact.contact_type, 'attached') self.assertEqual(new_contact.contact_type, 'attached')
# Create a contact with both contact_id and name; # Create a contact with both contact_id and name;
# contact's name should override provided value in that case # contact's name should override provided value in that case
new_contact_id = self.partner.create( new_contact_id = self.partner.create(
cr, uid, {'contact_id': self.bob_contact_id, 'name': 'Rob Egnops'}
{'contact_id': self.bob_contact_id, 'name': 'Rob Egnops'}
) )
self.assertEqual( self.assertEqual(
self.partner.browse(cr, uid, new_contact_id).name,
self.partner.browse(new_contact_id).name,
'Bob Egnops' 'Bob Egnops'
) )
# Reset contact to standalone # Reset contact to standalone
self.partner.write(cr, uid, [new_contact_id], {'contact_id': False}) self.partner.write(cr, uid, [new_contact_id], {'contact_id': False})
self.assertEqual( self.assertEqual(
self.partner.browse(cr, uid, new_contact_id).contact_type,
self.partner.browse(new_contact_id).contact_type,
'standalone', 'standalone',
) )
@ -207,9 +198,9 @@ class PartnerContactInSeveralCompaniesCase(common.TransactionCase):
ctx = {'search_show_all_positions': {'is_set': True, ctx = {'search_show_all_positions': {'is_set': True,
'set_value': True 'set_value': True
}} }}
self.partner.unlink(cr, uid, [new_contact_id], context=ctx)
self.partner.unlink([new_contact_id])
partner_ids = self.partner.search( partner_ids = self.partner.search(
cr, uid, [('id', 'in', [new_contact_id, self.bob_contact_id])])
[('id', 'in', [new_contact_id, self.bob_contact_id])])
self.assertIn(self.bob_contact_id, partner_ids) self.assertIn(self.bob_contact_id, partner_ids)
self.assertNotIn(new_contact_id, partner_ids) self.assertNotIn(new_contact_id, partner_ids)
@ -217,34 +208,32 @@ class PartnerContactInSeveralCompaniesCase(common.TransactionCase):
"""Check that contact's fields are correctly synced between """Check that contact's fields are correctly synced between
parent contact or related contacts parent contact or related contacts
""" """
cr, uid = self.cr, self.uid
# Test DOWNSTREAM sync # Test DOWNSTREAM sync
self.partner.write( self.partner.write(
cr, uid, [self.bob_contact_id], {'name': 'Rob Egnops'}
[self.bob_contact_id], {'name': 'Rob Egnops'}
) )
self.assertEqual( self.assertEqual(
self.partner.browse(cr, uid, self.bob_job1_id).name,
self.partner.browse(self.bob_job1_id).name,
'Rob Egnops', 'Rob Egnops',
) )
# Test UPSTREAM sync # Test UPSTREAM sync
self.partner.write(cr, uid, [self.bob_job1_id], {'name': 'Bob Egnops'})
self.partner.write([self.bob_job1_id], {'name': 'Bob Egnops'})
self.assertEqual( self.assertEqual(
self.partner.browse(cr, uid, self.bob_contact_id).name,
self.partner.browse(self.bob_contact_id).name,
'Bob Egnops', 'Bob Egnops',
) )
def test_06_ir_action(self): def test_06_ir_action(self):
"""Check ir_action context is auto updated. """Check ir_action context is auto updated.
""" """
cr, uid = self.cr, self.uid
new_context_val = "'search_show_all_positions': " \ new_context_val = "'search_show_all_positions': " \
"{'is_set': True, 'set_value': False}," "{'is_set': True, 'set_value': False},"
details = self.action.read( details = self.action.read(
cr, uid, [self.base_partner_action_id]
[self.base_partner_action_id]
) )
self.assertIn( self.assertIn(
new_context_val, new_context_val,
@ -253,7 +242,7 @@ class PartnerContactInSeveralCompaniesCase(common.TransactionCase):
) )
details = self.action.read( details = self.action.read(
cr, uid, [self.custom_partner_action_id]
[self.custom_partner_action_id]
) )
self.assertNotIn( self.assertNotIn(
new_context_val, new_context_val,

8
partner_contact_in_several_companies/views/res_partner.xml

@ -75,7 +75,7 @@
</div> </div>
<div class="oe_kanban_details"> <div class="oe_kanban_details">
<field name="name"/> <field name="name"/>
<div t-if="record.function.raw_value"><field name="function"/></div>
<div t-if="record.function.raw_value"><field name="function"/> at <field name="parent_id"/></div>
<div t-if="record.email.raw_value"><field name="email"/></div> <div t-if="record.email.raw_value"><field name="email"/></div>
<div t-if="record.phone.raw_value">Phone: <field name="phone"/></div> <div t-if="record.phone.raw_value">Phone: <field name="phone"/></div>
<div t-if="record.mobile.raw_value">Mobile: <field name="mobile"/></div> <div t-if="record.mobile.raw_value">Mobile: <field name="mobile"/></div>
@ -123,12 +123,12 @@
</field> </field>
</page> </page>
</page> </page>
<xpath expr="//field[@name='category_id']" position="before">
<group>
<!-- <xpath expr="//field[@name='category_id']" position="before">
<group attrs="{'invisible': [('is_company','=',True)]}">
<label for="contact_type" class="oe_edit_only"/> <label for="contact_type" class="oe_edit_only"/>
<field name="contact_type" readonly="0" nolabel="1"/> <field name="contact_type" readonly="0" nolabel="1"/>
</group> </group>
</xpath>
</xpath> -->
<xpath expr="//field[@name='child_ids']/form//field[@name='name']" position="before"> <xpath expr="//field[@name='child_ids']/form//field[@name='name']" position="before">
<field name='contact_type' readonly='0'/> <field name='contact_type' readonly='0'/>
<field name="contact_id" string="Contact" <field name="contact_id" string="Contact"

Loading…
Cancel
Save