mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[MIG] web_widget_dropdown_dynamic: Migration to 17.0
This commit is contained in:
4
web_widget_dropdown_dynamic/models/__init__.py
Normal file
4
web_widget_dropdown_dynamic/models/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
from odoo.tools import config
|
||||
|
||||
if not config.get("without_demo"):
|
||||
from . import ir_filters
|
||||
19
web_widget_dropdown_dynamic/models/ir_filters.py
Normal file
19
web_widget_dropdown_dynamic/models/ir_filters.py
Normal 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
|
||||
Reference in New Issue
Block a user