On Wednesday, October 15, 2014 9:29:58 AM UTC-3, Cédric Krier wrote:
>
> On 10 Oct 13:32, Mariano Ramon wrote: 
> > I apologize in advance for the vagueness of this request but I'm pretty 
> > lost. 
> > 
> > I have these entities 
> > 
> > FamilyMembers / Patient / Person ( this three are in hiearchy of the 
> Party 
> > Entity ) 
>
> I don't understand. 
>

Please disregard, is not relevant to the question. For clarity I only use 
FamiliyMember from now on.
 

>
> > Family (which has FamilyMembers) 
> > FamilyGroup (which has many Families) 
>
> Please provide standard Model definition. 
>



class FamilyMember(ModelSQL, ModelView):
    'Family Member'
    __name__ = 'custom.family_member'

    name = fields.Many2One(
        'custom.family', 'Family', required=True, readonly=True,
        help='Family code')




class Family(ModelSQL, ModelView):
    'Family'
    __name__ = 'custom.family'

    familygroup = fields.Many2One('custom.familygroup', 'FAMILYGROUP')
    name = fields.Char('Family', required=True, help='Family code')

    members = fields.One2Many(
        'custom.family_member', 'name', 'Family Members')




class FamilyGroup(ModelSQL, ModelView):
    'Family Group'
    __name__ = 'custom.familygroup'

    descripcion =  fields.Char('Descripcion del FAMILYGROUP',
        help='Descripcion del FAMILYGROUP')
    familias = fields.One2Many('custom.family', 'familygroup', 'Familias', 
add_remove=[('familygroup', '=', None)])



 
I removed non related fields and methods

I need to show in the FamilyMember view the description field of the 
FamilyGroup it belongs... only if this familymember belongs to a family and 
only if this family belongs to a familygroup.

Hope this make my request a bit clearer

Thanks.

Reply via email to