跳至內容
選單
此問題已被標幟
1 回覆
2278 瀏覽次數

We have a field that is defined like this on the product.template model: 

fields.Char(        string='MPN',        compute='_compute_mpn',        inverse='_inverse_mpn',        store=True,    )

And like this on the product.product model: 

fields.Char(string='MPN')

Now when I import this field, it doesn't show any errors but doesn't get imported either, the field stays blank. Is there anything special that needs to be done to make this import work? 

頭像
捨棄
最佳答案

Hi,

While importing the compute fields will not get Imported,

Instead, you can create a scheduled action to trigger the compute function manually like this to update the compute field in the imported records,


env['product.template'].search([])._compute_mpn()

Thanks

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
1月 24
3383
1
5月 23
2065
2
4月 23
3086
8
1月 25
6993
1
4月 25
1618