콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
7348 화면

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

아바타
취소
관련 게시물 답글 화면 활동
2
2월 23
8508
0
9월 20
3660
2
3월 15
6291
3
9월 25
2256
problem backup 해결 완료
3
6월 24
7004