Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
6277 Vizualizări

I have two fields in model res.contract "society_id" and "phase_id" inherited from "file" model. And in "file" model these two fields are related. I think that is why it is not saving these fields in my current model. I have used force_save = "1" attribute but still no luck. Any help?

Imagine profil
Abandonează
Cel mai bun răspuns

In the file model, you are not saving the related fields into the database. In the file model write like this:

phase_id = fields.Many2one(comodel_name='your.model', string='Your String',
related='model_field.phase_id', store='True')
society_id = fields.Many2one(comodel_name='your.model', string='Your String',
related='model_field.society_id', store='True')

Now you should get the value.

Imagine profil
Abandonează
Cel mai bun răspuns

for me in odoo11 i have to use store=True in py and force_save="1" in xml

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
5
apr. 25
15862
2
nov. 18
2592
0
nov. 18
2500
1
nov. 18
5691
5
feb. 18
4809