Skip to Content
Menu
This question has been flagged
1447 Rodiniai

I had a problem with the class setting. AClass has ohs_hms_vacc_record_ids with One2Many mapping. And then I also define ohs_hms_aclass_id in OhsHmsVaccRecord. But I also want to add BClass use ohs_hms_vacc_record_ids mapping to OhsHmsVaccRecord. The OhsHmsVaccRecord will also define ohs_hms_bclass_id. That is my problem. In this situation, how to design the architecture? I can let AClass and BClass both use OhsHmsVaccRecord at the same time?
 

class AClass(models.RayceModel):
   
_name = 'ohs.hms.aclass'

    ohs_hms_vacc_record_ids = fields.One2many('ohs.hms.vacc.record', 'ohs_hms_ aclass _id', string=' details')

class OhsHmsVaccRecord(models.RayceModel):
    _name = 'ohs.hms.vacc.record'

ohs_hms_aclass_id = fields.Many2one('ohs.hms.aclass', string='AClass', ondelete='cascade', index=True)

 

class BClass(models.RayceModel):
   
_name = 'ohs.hms.bclass

    ohs_hms_vacc_record_ids = fields.One2many('ohs.hms.vacc.record', 'ohs_hms_ bclass _id', string='details')

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
0
lapkr. 21
2366
1
vas. 24
1050
3
liep. 25
21992
2
kov. 24
1587
0
rugs. 23
144