Browse Source

[FIX] fixes on lastest comments

- better readability
- remove <data></data> tags
pull/347/head
Nicolas JEUDY 8 years ago
parent
commit
15805173c8
  1. 6
      partner_contact_in_several_companies/models/res_partner.py
  2. 10
      partner_contact_in_several_companies/views/res_partner.xml

6
partner_contact_in_several_companies/models/res_partner.py

@ -28,10 +28,8 @@ class ResPartner(models.Model):
@api.multi
@api.depends('contact_id')
def _get_contact_type(self):
for record in self:
record.contact_type = record.contact_id \
and 'attached' \
or 'standalone'
for rec in self:
rec.contact_type = 'attached' if rec.contact_id else 'standalone'
def _basecontact_check_context(self, mode):
""" Remove 'search_show_all_positions' for non-search mode.

10
partner_contact_in_several_companies/views/res_partner.xml

@ -1,7 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="view_res_partner_filter_contact" model="ir.ui.view">
<field name="name">res.partner.select.contact</field>
<field name="model">res.partner</field>
@ -123,12 +121,6 @@
</field>
</page>
</page>
<!-- <xpath expr="//field[@name='category_id']" position="before">
<group attrs="{'invisible': [('is_company','=',True)]}">
<label for="contact_type" class="oe_edit_only"/>
<field name="contact_type" readonly="0" nolabel="1"/>
</group>
</xpath> -->
<xpath expr="//field[@name='child_ids']/form//field[@name='name']" position="before">
<field name='contact_type' readonly='0'/>
<field name="contact_id" string="Contact"
@ -187,6 +179,4 @@
</xpath>
</field>
</record>
</data>
</odoo>
Loading…
Cancel
Save