Hello guys, I changing compute logic of a compute stored field but the field is not recomputed (the dependence not change, only the logic change). I need it stored. Is there away to achived it. Thank you guy so much.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- 회계
- 재고 관리
- PoS
- 프로젝트
- MRP
신고된 질문입니다
This is all not accurate.
In odoo17 the only thing you need to do is call the method and then commit.
for record in env['your.model'].search([]):
record._your_compute_method()
# you can also commit after each commit in case you have concurrency errors that are difficult to track down
env.cr.commit()
The following code works in v16:
model = env['your.model'] env.add_to_compute(model._fields['your_fields_to_recompute'], model.search([])) model.recompute()
The following for v17:
model = env['your.model'] env.add_to_compute(model._fields['your_fields_to_recompute'], model.search([])) model._recompute_recordset()
Hi,
If the dependencies are properly set for the stored computed field, the compute logic will get retrigerred whenever there is a change in the dependency.
After adding your new logic, if the re-computation is not properly working, make sure no dependencies are missed. If you are sure the dependencies are correctly given, then please update the question with the relevant codes.
Thanks
| 관련 게시물 | 답글 | 화면 | 활동 | |
|---|---|---|---|---|
|
|
1
6월 25
|
17031 | ||
|
Compute Fields
해결 완료
|
|
2
7월 24
|
9385 | |
|
|
1
1월 24
|
2801 | ||
|
|
1
7월 22
|
3014 | ||
|
|
4
3월 24
|
12120 |