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

I have a list of fields updated by a method:

wt = self.env['divina.custos']
wt.browse(curr_day).write({'day_costs': costs_d, 'month_costs': costs_m, 'day_sold': tot_val_d, 
         'month_sold':tot_val_m,'month_profit': profit_month, 'ord_proc': ord_proc,
'day_profit': profit_day})
self.env.cr.commit()
self.env.invalidate_all()

First of all, without invalidate the cache after the write I always get an error.

Secondly,  the field day_profit is always 0.0 (null) but all the other fields are correctly updated.

I need to add a second write statement after the first batch

wt.browse(curr_day).write({'day_profit': profit_day})
to make it work, and I don't understand why.
The variable is populated in the same part of the function where all the variables were declared, and _logger.info() clearly show it with the correct value on the log right after the self.write.
 What I'm doing wrong?
아바타
취소
관련 게시물 답글 화면 활동
1
2월 17
7550
1
3월 17
12302
5
7월 20
9251
1
12월 19
6140
2
7월 25
4951