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
7350 Widoki

Hi,

I am trying to do mass editing of products (by matching image file names with internal refernce and writing to the image field in products). Since writing values will keep building up cache , i am trying to commit after each write and invalidating cache. But when a error occurs after commit , the rollback operation is not working . Can anyone help me with this ?


import pdb

try:

rec=self.env['product.template'].search([('id','in',self._context.get('active_ids',False))])

pdb.set_trace()

rec.image=_get_base64_image(file_path)

print "9=========",self.env.cache

self.env.cr.commit()

rec.invalidate_cache(None,[rec.id])

except:

self.env.cr.rollback()

raise

Awatar
Odrzuć
Autor Najlepsza odpowiedź

sorry for the incorrect question.....can't rollback after committing

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
lut 23
8510
0
wrz 20
3661
2
mar 15
6294
3
wrz 25
2260
problem backup Rozwiązane
3
cze 24
7010