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

Hello, 




Is it possible to have One2many relation between 2 models from different modules without having circular dependency ?. How ?


---


Example:


Module A


class Model_A(models.Model):

_name = 'module_a.model_a'


model_b_ids = fields.One2many(comodel_name='module_b.model_b',inverse_name='inverse_a_id', string='model_b' )



Module B


class Model_b(models.Model):

_name = 'module_b.model_b'


inverse_a_id = fields.Many2one(comodel_name='module_a.model_a', string='Local association' )


------


To achieve the above scenario i have to include both modules in each other's dependency which cause circular dependency. 



So, Any Ideas .. 





Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
lip 24
1344
2
wrz 21
4671
0
maj 25
692
2
gru 23
6799
2
sie 23
2182