[MIG] web_widget_dropdown_dynamic: Migration to 17.0

This commit is contained in:
Carlos Roca
2024-08-13 12:33:49 +02:00
parent 920e5bf943
commit 1c6d9cd008
13 changed files with 164 additions and 124 deletions

View File

@@ -0,0 +1,4 @@
from odoo.tools import config
if not config.get("without_demo"):
from . import ir_filters

View File

@@ -0,0 +1,19 @@
# Copyright 2024 Tecnativa - Carlos Roca
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import api, models
class IrFilters(models.Model):
_inherit = "ir.filters"
@api.model
def dynamic_dropdown_int_method_demo(self):
values = [
("1", "One"),
]
if self.env.context.get("depending_on") == self.env.ref("base.user_admin").id:
values += [
("2", "Two"),
]
return values