Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1452 Tampilan

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')

Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
0
Nov 21
2370
1
Feb 24
1051
3
Jul 25
21997
2
Mar 24
1597
0
Sep 23
144