Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
2264 Näkymät

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? 

Avatar
Hylkää
Paras vastaus

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

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
2
tammik. 24
3364
1
toukok. 23
2053
2
huhtik. 23
3058
8
tammik. 25
6962
1
huhtik. 25
1608