Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
4816 Lượt xem

Hi everyone,

I hope you are doing well.

I got stuck in clearing cache in version 17.


@ormcache('self.state')
def get_state_selection(self):
"""Get the states of the wizard using standard values and optional
configuration steps set on the product.template via
config_step_line_ids"""
steps = [("select", "Select Template")]
wizard_id = self.env.context.get("wizard_id")
wiz = self.browse(wizard_id).exists()
open_lines = self.env['product.template'].search([('id','=',int(self.env.context.get("product_template_id")))]).config_step_line_ids.mapped('config_step_id')
if open_lines:
open_steps = open_lines.mapped(lambda x: (str(x.id), x.name))
steps = open_steps if wiz.product_id else steps + open_steps
else:
steps.append(("configure", "Configure"))
return steps

here is above my code to cache the values for my selection field dynamically. But i'm unable to clear it. I have tried every possible method like clear_caches(), invalidate_all() and flush(). These methods works fine till v16. Anyone have any idea for odoo17.



Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 3 25
2984
0
thg 3 25
1455
4
thg 1 25
2438
1
thg 11 24
2525
2
thg 4 25
2942