コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
1956 ビュー

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

アバター
破棄
関連投稿 返信 ビュー 活動
1
4月 25
1389
Odoo App 解決済
1
11月 23
1962
0
5月 24
1689
0
9月 23
2646
0
9月 23
2259