İçereği Atla
Menü
Bu soru işaretlendi
4802 Görünümler

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.



Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
3
Mar 25
2979
0
Mar 25
1454
4
Oca 25
2436
1
Kas 24
2524
2
Nis 25
2942