Skip to Content
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
2 Ответы
1567 Представления

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
784
Odoo App Решено
1
нояб. 23
1305
0
мая 24
1034
0
сент. 23
1926
0
сент. 23
1650