İçereği Atla
Menü
Bu soru işaretlendi
1450 Görünümler

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
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
0
Kas 21
2369
1
Şub 24
1051
3
Tem 25
21997
2
Mar 24
1596
0
Eyl 23
144