Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1448 Widoki

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
lis 21
2369
1
lut 24
1051
3
lip 25
21996
2
mar 24
1595
0
wrz 23
144