Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
1974 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
apr 25
1395
Odoo App Risolto
1
nov 23
1993
0
mag 24
1701
0
set 23
2663
0
set 23
2265