[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 """ """ Partner adaptations """
_inherit = 'res.partner' _inherit = 'res.partner'
family_member = fields.Many2one(related='family_id')
family_member_ids = fields.One2many(related='family_id.member_ids') 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_id = fields.Many2one('golem.family', string='Family', index=True)
family_role = fields.Many2one('golem.family.role', string='Role', family_role = fields.Many2one('golem.family.role', string='Role',

View File

@ -31,19 +31,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<field name="family_role" /> <field name="family_role" />
</field> </field>
<notebook> <notebook>
<page string="Family members"> <xpath expr="//notebook/page[@name='other_page']" position="before" >
<div colspan="2" <page string="Family members" attrs="{'invisible': [('family_id', '=', False)]}">
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>
<group string="Address"> <group string="Address">
<group> <group>
<field name="street" placeholder="Street..." /> <field name="family_member" />
<field name="street2" /> <field name="family_street" placeholder="Street..." />
<field name="zip" placeholder="ZIP" /> <field name="family_street2" />
<field name="city" placeholder="City" /> <field name="family_zip" placeholder="ZIP" />
<field name="family_city" placeholder="City" />
</group> </group>
<group> <group>
<field name="state_id" class="oe_no_button" <field name="state_id" class="oe_no_button"
@ -52,8 +49,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
class="oe_no_button" /> class="oe_no_button" />
</group> </group>
</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> </group>
<field name="family_member_ids" context="{'default_family_id': active_id}"> <field name="family_member_ids" context="{'default_family_id': active_id}">
<tree delete="false"> <tree delete="false">
@ -65,7 +76,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</tree> </tree>
</field> </field>
</page> </page>
</xpath>
</notebook> </notebook>
</field> </field>
</record> </record>