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?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- Müşteri İlişkileri Yönetimi
- e-Commerce
- Muhasebe
- Envanter
- PoS
- Project
- MRP
Bu soru işaretlendi
2
Cevaplar
6262
Görünümler
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.
for me in odoo11 i have to use store=True in py and force_save="1" in xml
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Üye Olİlgili Gönderiler | Cevaplar | Görünümler | Aktivite | |
---|---|---|---|---|
|
5
Nis 25
|
15851 | ||
|
2
Kas 18
|
2590 | ||
|
0
Kas 18
|
2494 | ||
|
1
Kas 18
|
5677 | ||
|
5
Şub 18
|
4805 |