Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
1563 Vistas

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
Descartar
Mejor respuesta

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
Descartar
Mejor respuesta

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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
abr 25
783
Odoo App Resuelto
1
nov 23
1304
0
may 24
1031
0
sept 23
1923
0
sept 23
1647