Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
2 Відповіді
1932 Переглядів

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 ")




Аватар
Відмінити
Найкраща відповідь

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.


Аватар
Відмінити
Найкраща відповідь

Hi,

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

Regards

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
квіт. 25
1381
Odoo App Вирішено
1
лист. 23
1944
0
трав. 24
1676
0
вер. 23
2630
0
вер. 23
2247