Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
4822 Представления

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.



Аватар
Отменить
Related Posts Ответы Просмотры Активность
3
мар. 25
2987
0
мар. 25
1456
4
янв. 25
2438
1
нояб. 24
2526
2
апр. 25
2945