forked from Yaltik/golem
[TMP]Family form in member form
This commit is contained in:
parent
d69f8f7a10
commit
08510d0762
@ -24,6 +24,8 @@ class ResPartner(models.Model):
|
||||
""" Partner adaptations """
|
||||
_inherit = 'res.partner'
|
||||
|
||||
family_member_ids = fields.One2many(related='family_id.member_ids')
|
||||
|
||||
family_id = fields.Many2one('golem.family', string='Family', index=True)
|
||||
family_role = fields.Many2one('golem.family.role', string='Role',
|
||||
index=True)
|
||||
|
@ -35,9 +35,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
<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>
|
||||
|
||||
<!-- <div class="oe_title">
|
||||
<h1>
|
||||
<field name="family_member_ids" />
|
||||
</h1>
|
||||
</div> -->
|
||||
</group>
|
||||
<field name="member_ids" context="{'default_family_id': active_id}">
|
||||
<field name="family_member_ids" context="{'default_family_id': active_id}">
|
||||
<tree delete="false">
|
||||
<field name="name" />
|
||||
<field name="family_role" />
|
||||
|
@ -43,6 +43,7 @@ class ResPartner(models.Model):
|
||||
is_member = fields.Boolean('Is member', compute='_compute_is_member')
|
||||
member_number = fields.Char('Member number', related='member_id.number')
|
||||
|
||||
|
||||
@api.depends('member_id')
|
||||
def _compute_is_member(self):
|
||||
""" Computes is member """
|
||||
@ -79,9 +80,7 @@ class GolemMember(models.Model):
|
||||
|
||||
partner_id = fields.Many2one('res.partner', required=True, index=True,
|
||||
ondelete='cascade')
|
||||
|
||||
member_ids = fields.One2many('res.partner', 'family_id', 'Members',
|
||||
domain=[('is_company', '=', False)])
|
||||
|
||||
|
||||
@api.model
|
||||
def _default_season(self):
|
||||
|
Loading…
Reference in New Issue
Block a user