Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
6984 Представления

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

Аватар
Отменить
Автор Лучший ответ

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

Аватар
Отменить
Related Posts Ответы Просмотры Активность
2
февр. 23
8080
0
сент. 20
3315
2
мар. 15
5879
3
июн. 24
1784
problem backup Решено
3
июн. 24
6555