Skip to Content
Menu
This question has been flagged

Hello everyone, i am trying to sync my Odoo application with a external ecommerce. When I import products by CSV, I need to then upload the products to this ecommerce. For this, was trying to overwrite the create and write methods Odoo provudes, to perform the syncing inside these methods. 

However, when I run the Test Import, the create method is called anyways and so is my external upload method. Is there a way I can differ when the methods are being called by a test or an actual import?

Avatar
Discard
Best Answer

Hello Arthur,

while syncing add any identification on context   

ex : super(yourmodel,self.with_context(sync=True)).create(vals)

so context.get('sync',False)   it will give true while sync and false while normal import

Avatar
Discard
Related Posts Replies Views Activity
1
Mar 24
1087
1
Mar 18
2529
1
Mar 16
2430
1
Mar 15
7908
2
Mar 15
9705