[IMP]GOLEM Member Minor Multiple legal guardians

This commit is contained in:
Fabien Bourgeois 2016-07-20 18:48:15 +02:00
parent 26e8c3b34f
commit ab040f1d82
2 changed files with 16 additions and 9 deletions

View File

@ -23,8 +23,11 @@ class GolemMember(models.Model):
_inherit = 'golem.member'
ADULT_DURATION = timedelta(days=365*18)
legal_guardian = fields.Many2one('res.partner', 'Legal guardian',
domain=[('is_company', '=', False)])
legal_guardian_ids = fields.Many2many('res.partner',
string='Legal guardians',
domain="['&', "
"('is_company', '=', False), "
"('id', '!=', partner_id)]")
activities_participation = fields.Boolean('Activities participation?')
is_minor = fields.Boolean('Is minor?', compute='_compute_is_minor',
store=True, default=False)

View File

@ -33,14 +33,18 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
<page name="minor_page" string="Minor"
attrs="{'invisible': [('is_minor', '=', False)]}">
<group name="minor_group">
<group>
<field name="is_minor" invisible="True" />
<field name="legal_guardian"
domain="[('id', '!=', partner_id)]" />
</group>
<group>
<field name="activities_participation"/>
</group>
<field name="partner_id" invisible="True" required="False" />
<field name="is_minor" invisible="True" />
<field name="legal_guardian_ids">
<tree name="legal_guardian_ids_tree">
<field name="name" />
<field name="contact_address" />
<field name="phone" />
<field name="mobile" />
<field name="email" widget="email" />
</tree>
</field>
</group>
</page>
</page>