跳至內容
選單
此問題已被標幟
1457 瀏覽次數

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
11月 21
2375
1
2月 24
1053
3
7月 25
22003
2
3月 24
1598
0
9月 23
144