İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
1950 Görünümler

odoo16
I added field one2many named 

location_id in product.template but why the value disappear when i select it and click on save?
class ProductTemplate(models.Model):
_inherit = 'product.template'
location_id = fields.Many2one('stock.location', string="Default location ")




Avatar
Vazgeç
En İyi Yanıt

Try one of these or both:


in .py:

location_id = fields.Many2one('stock.location', string="Default location ", store=True)

in .xml:

name="location_id" force_save="1"/>

The field will show for sure...

Thanks.


Avatar
Vazgeç
En İyi Yanıt

Hi,

Did you try giving store=True in python file? If that doesn’t work try giving force_save="1" in the xml.

Regards

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
1
Nis 25
1387
Odoo App Çözüldü
1
Kas 23
1960
0
May 24
1687
0
Eyl 23
2645
0
Eyl 23
2257