[TMP]If family member family notbook is visible

This commit is contained in:
michel 2018-01-26 13:51:37 +01:00
parent ed34d84a18
commit cc0c6b9b61
2 changed files with 56 additions and 31 deletions

View File

@ -24,7 +24,18 @@ class ResPartner(models.Model):
""" Partner adaptations """
_inherit = 'res.partner'
family_member = fields.Many2one(related='family_id')
family_member_ids = fields.One2many(related='family_id.member_ids')
family_street = fields.Char(related='family_id.street')
family_street2 = fields.Char(related='family_id.street2')
family_zip = fields.Char(related='family_id.zip')
family_city = fields.Char(related='family_id.city')
family_state_id = fields.Many2one(related='family_id.state_id')
family_country_id = fields.Many2one(related='family_id.country_id')
family_phone = fields.Char(related='family_id.phone')
family_mobile = fields.Char(related='family_id.mobile')
family_email = fields.Char(related='family_id.email')
family_website = fields.Char(related='family_id.website')
family_id = fields.Many2one('golem.family', string='Family', index=True)
family_role = fields.Many2one('golem.family.role', string='Role',

View File

@ -31,41 +31,55 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="family_role" />
</field>
<notebook>
<page string="Family members">
<div colspan="2"
style="background-color: #ccc; color: #fff; font-size: 150%; font-weight: bold; padding: 0.5%; text-align: center; margin-bottom: 1%;">Family form</div>
<group>
<group string="Address">
<group>
<field name="street" placeholder="Street..." />
<field name="street2" />
<field name="zip" placeholder="ZIP" />
<field name="city" placeholder="City" />
</group>
<group>
<field name="state_id" class="oe_no_button"
placeholder="State" />
<field name="country_id" placeholder="Country"
class="oe_no_button" />
<xpath expr="//notebook/page[@name='other_page']" position="before" >
<page string="Family members" attrs="{'invisible': [('family_id', '=', False)]}">
<group>
<group string="Address">
<group>
<field name="family_member" />
<field name="family_street" placeholder="Street..." />
<field name="family_street2" />
<field name="family_zip" placeholder="ZIP" />
<field name="family_city" placeholder="City" />
</group>
<group>
<field name="state_id" class="oe_no_button"
placeholder="State" />
<field name="country_id" placeholder="Country"
class="oe_no_button" />
</group>
</group>
</group>
<group>
<group string="Communication">
<group>
<field name="phone" placeholder="0000000000"
widget="phonefr" />
<field name="mobile" placeholder="0000000000"
widget="phonefr" />
</group>
<group>
<field name="email" widget="email"
placeholder="name@example.org" />
<field name="website" widget="url"
placeholder="e.g. www.odoo.com"/>
</group>
</group>
</group>
<field name="family_member_ids" context="{'default_family_id': active_id}">
<tree delete="false">
<field name="name" />
<field name="family_role" />
<field name="phone" />
<field name="mobile" />
<field name="email" widget="email" />
</tree>
</field>
</page>
</xpath>
</notebook>
</group>
<field name="family_member_ids" context="{'default_family_id': active_id}">
<tree delete="false">
<field name="name" />
<field name="family_role" />
<field name="phone" />
<field name="mobile" />
<field name="email" widget="email" />
</tree>
</field>
</page>
</notebook>
</field>
</record>