Skip to Content
Menu
This question has been flagged
4 Replies
4027 Views

Hello,

I want to relate a "many2many" field, with another "many2many" field from another module.

( i.e. the same value of the first field should be in the second field + i want add condition ) 

Avatar
Discard

may you explain more what you want to do for example

Author

I have two fields, the one field is declared in module 1 :

field1 = fields.Many2many('module1.information', string="relation1", required=True)

And the second field is declared in module 2 :

field2 = fields.Many2many('module2.information', string="relation2", required=True)

I want to make relation between them. To get the value of field 1 on field 2

Author Best Answer

Thank you so much ayman mohammed adam

I want try that, but i don't understand the meaning of  :   

'field_model1' and  'model1_model2_rel', 
 
 
Avatar
Discard
Best Answer

Dear Zakaria


try this: you 

field1 = fields.Many2many('module1.information','field_model1', 'field_model2', 'model1_model2_rel', string="relation1", required=True)

field2 = fields.Many2many('module2.information','field_model2', 'field_model1', 'model1_model2_rel', string="relation2", required=True)


I hope I helped you...
Avatar
Discard