Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
2 Vastaukset
2001 Näkymät

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
Hylkää
Paras vastaus

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
Hylkää
Paras vastaus

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
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
1
huhtik. 25
1428
Odoo App Ratkaistu
1
marrask. 23
2017
0
toukok. 24
1734
0
syysk. 23
2675
0
syysk. 23
2302