Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
1992 Weergaven

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
Annuleer
Beste antwoord

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
Annuleer
Beste antwoord

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
apr. 25
1417
Odoo App Opgelost
1
nov. 23
2010
0
mei 24
1729
0
sep. 23
2673
0
sep. 23
2297