Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
2002 Widoki

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? 

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
sty 24
3012
1
maj 23
1867
2
kwi 23
2789
8
sty 25
6630
1
kwi 25
1411