Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
0295134
[ADD] web_widget_dropdown_dynamic
alexey-pelykh Sep 11, 2019
9ba5d2b
[IMP] web_widget_dropdown_dynamic: black, isort, prettier
alexey-pelykh Apr 12, 2020
d547858
[MIG] web_widget_dropdown_dynamic: Migration to 13.0
alexey-pelykh Apr 12, 2020
fb45fca
[UPD] Brainbean Apps => CorporateHub
alexey-pelykh Nov 8, 2020
ffa099b
Added translation using Weblate (Spanish)
claudiagn Feb 17, 2021
04add5d
Translated using Weblate (Spanish)
claudiagn Feb 17, 2021
d4a9067
[IMP] web_widget_dropdown_dynamic: black, isort, prettier
NL66278 May 28, 2021
e3eb1c1
[MIG] web_widget_dropdown_dynamic: Migration to 14.0
NL66278 May 28, 2021
fd8c852
Added translation using Weblate (German)
Corneliuus Oct 13, 2021
ac5003f
Translated using Weblate (German)
Corneliuus Oct 13, 2021
61ab778
[IMP] web_widget_dropdown_dynamic: black, isort, prettier
BankyKmitl Nov 30, 2021
c21fb75
[MIG] web_widget_dropdown_dynamic: Migration to 15.0
BankyKmitl Dec 1, 2021
1656b82
[16.0][MIG] web_widget_dropdown_dynamic
gbrito Mar 28, 2023
45b6e2f
[16.0][MIG]web_widget_dropdown_dynamic: Migrate to version 16.0
Jul 6, 2023
106f3c1
Added translation using Weblate (Italian)
mymage Nov 27, 2023
01a82e5
[IMP] web_widget_dropdown_dynamic: pre-commit auto fixes
CarlosRoca13 Aug 12, 2024
1cf12ff
[MIG] web_widget_dropdown_dynamic: Migration to 17.0
CarlosRoca13 Aug 13, 2024
801b05c
[UPD] Update web_widget_dropdown_dynamic.pot
Aug 14, 2024
a03a191
[BOT] post-merge updates
OCA-git-bot Aug 14, 2024
ae49675
Update translation files
weblate Aug 14, 2024
5a7ab54
Translated using Weblate (Italian)
mymage Aug 14, 2024
d5bfc38
[MIG] web_widget_dropdown_dynamic: Migration to 18.0
BhaveshHeliconia Dec 23, 2024
a3b5bdd
[UPD] Update web_widget_dropdown_dynamic.pot
Feb 20, 2025
4c68e75
[BOT] post-merge updates
OCA-git-bot Feb 20, 2025
1777be4
Update translation files
weblate Feb 20, 2025
91b02dd
[IMP] web_widget_dropdown_dynamic: Remove QUnit import from tests
JasminSForgeFlow Apr 1, 2025
899d6f6
[BOT] post-merge updates
OCA-git-bot Apr 21, 2025
3e5e7a1
[IMP] web_widget_dropdown_dynamic: license change
Jun 5, 2025
067ef70
[BOT] post-merge updates
OCA-git-bot Jun 10, 2025
ba8658e
Added translation using Weblate (Turkish)
bo-eska Sep 16, 2025
a90e1d7
Translated using Weblate (Turkish)
bo-eska Sep 16, 2025
4085be7
Translated using Weblate (Spanish)
Ed-Spain Apr 13, 2026
dd55664
Translated using Weblate (Spanish)
Ed-Spain May 7, 2026
0a3cb63
Added translation using Weblate (Slovenian)
sysadminmatmoz Jun 6, 2026
530c5ef
Translated using Weblate (Slovenian)
sysadminmatmoz Jun 6, 2026
b3f6e80
[19.0][MIG] web_widget_dropdown_dynamic: Migration to 19.0
Jul 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
147 changes: 147 additions & 0 deletions web_widget_dropdown_dynamic/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=======================
Dynamic Dropdown Widget
=======================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:a17ae8884150a2e5fa14bc78ef967f2b08c26f54c726972057afc693c0f3d72d
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
:target: https://github.com/OCA/web/tree/19.0/web_widget_dropdown_dynamic
:alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/web-19-0/web-19-0-web_widget_dropdown_dynamic
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

Dynamic dropdown widget that supports resolving options from backend of:

- ``fields.Char``
- ``fields.Integer``
- ``fields.Selection``

**NOTE:** This widget is not intended to *extend* ``fields.Selection``,
but to filter selection values. For fully-dynamic set of options, use
``fields.Char`` instead.

**Table of contents**

.. contents::
:local:

Usage
=====

.. code:: python

@api.model
def method_name(self):
values = [
('value_a', 'Title A'),
]
if self.env.context.get('depending_on') == True:
values += [
('value_b', 'Title B'),
]
return values

.. code:: xml

<field
name="other_field"
/>
<field
name="char_field"
widget="dynamic_dropdown"
options="{'values':'method_name'}"
context="{'depending_on': other_field}"
/>

**DEMO**

On User defined filters added new field to show the feature, it is
called **Dropdown Integer**. If any user selected just One option shoud
appear, but if Mitchell Admin it should be possible to select option One
and Two.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/web/issues/new?body=module:%20web_widget_dropdown_dynamic%0Aversion:%2019.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* CorporateHub

Contributors
------------

- `CorporateHub <https://corporatehub.eu/>`__

- Alexey Pelykh <alexey.pelykh@corphub.eu>

- `Therp BV <https://therp.nl/>`__

- Ronald Portier <ronald@therp.nl>

- Thanakrit Pintana <thanakrit.p39@gmail.com>

- `Trobz <https://trobz.com>`__:

- Son Ho <sonho@trobz.com>

- `Tecnativa <https://www.tecnativa.com>`__:

- Carlos Roca

- ``Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>``\ \_

Other credits
-------------

The migration of this module from 15.0 to 16.0 was financially supported
by Camptocamp

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/web <https://github.com/OCA/web/tree/19.0/web_widget_dropdown_dynamic>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions web_widget_dropdown_dynamic/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
from . import models
26 changes: 26 additions & 0 deletions web_widget_dropdown_dynamic/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2019-2020 Brainbean Apps (https://brainbeanapps.com)
# Copyright 2020 CorporateHub (https://corporatehub.eu)
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
{
"name": "Dynamic Dropdown Widget",
"summary": "This module adds support for dynamic dropdown widget",
"category": "Web",
"version": "19.0.1.0.0",
"license": "LGPL-3",
"author": "CorporateHub, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/web",
"depends": ["web"],
"installable": True,
"assets": {
"web.assets_backend": [
"web_widget_dropdown_dynamic/static/src/js/field_dynamic_dropdown.esm.js",
],
"web.qunit_suite_tests": [
"web_widget_dropdown_dynamic/static/tests/web_widget_dropdown_dynamic_tests.esm.js",
],
},
"demo": [
"demo/ir_model_fields.xml",
"demo/ir_filters_view.xml",
],
}
20 changes: 20 additions & 0 deletions web_widget_dropdown_dynamic/demo/ir_filters_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="ir_filters_view_form" model="ir.ui.view">
<field name="model">ir.filters</field>
<field name="inherit_id" ref="base.ir_filters_view_form" />
<field name="arch" type="xml">
<!-- 19.0: ir.filters.user_id (Many2one) paso a user_ids (Many2many).
El ancla y el contexto se actualizan en consecuencia; ahora
depending_on llega como lista de ids. -->
<field name="user_ids" position="after">
<field
name="x_dynamic_dropdown_int"
widget="dynamic_dropdown"
options="{'values': 'dynamic_dropdown_int_method_demo'}"
context="{'depending_on': user_ids}"
/>
</field>
</field>
</record>
</odoo>
11 changes: 11 additions & 0 deletions web_widget_dropdown_dynamic/demo/ir_model_fields.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="field_dynamic_dropdown_int" model="ir.model.fields">
<field name="field_description">Dropdown Integer</field>
<field name="model">ir.filters</field>
<field name="model_id" ref="base.model_ir_filters" />
<field name="name">x_dynamic_dropdown_int</field>
<field name="state">manual</field>
<field name="ttype">integer</field>
</record>
</odoo>
33 changes: 33 additions & 0 deletions web_widget_dropdown_dynamic/i18n/de.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_widget_dropdown_dynamic
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2021-10-13 20:46+0000\n"
"Last-Translator: Corneliuus <cornelius@clk-it.de>\n"
"Language-Team: none\n"
"Language: de\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 4.3.2\n"

#. module: web_widget_dropdown_dynamic
#: model:ir.model.fields,field_description:web_widget_dropdown_dynamic.field_dynamic_dropdown_int
msgid "Dropdown Integer"
msgstr ""

#. module: web_widget_dropdown_dynamic
#. odoo-javascript
#: code:addons/web_widget_dropdown_dynamic/static/src/js/field_dynamic_dropdown.esm.js:0
msgid "Dynamic Dropdown"
msgstr "Dynamisches Dropdown"

#. module: web_widget_dropdown_dynamic
#: model:ir.model,name:web_widget_dropdown_dynamic.model_ir_filters
msgid "Filters"
msgstr ""
33 changes: 33 additions & 0 deletions web_widget_dropdown_dynamic/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_widget_dropdown_dynamic
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2026-05-07 17:46+0000\n"
"Last-Translator: Ed-Spain <eduamoros@gmail.com>\n"
"Language-Team: none\n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.15.2\n"

#. module: web_widget_dropdown_dynamic
#: model:ir.model.fields,field_description:web_widget_dropdown_dynamic.field_dynamic_dropdown_int
msgid "Dropdown Integer"
msgstr "Entero desplegable"

#. module: web_widget_dropdown_dynamic
#. odoo-javascript
#: code:addons/web_widget_dropdown_dynamic/static/src/js/field_dynamic_dropdown.esm.js:0
msgid "Dynamic Dropdown"
msgstr "Menú desplegable Dinámico"

#. module: web_widget_dropdown_dynamic
#: model:ir.model,name:web_widget_dropdown_dynamic.model_ir_filters
msgid "Filters"
msgstr "Filtros"
33 changes: 33 additions & 0 deletions web_widget_dropdown_dynamic/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_widget_dropdown_dynamic
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-08-14 16:58+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.6.2\n"

#. module: web_widget_dropdown_dynamic
#: model:ir.model.fields,field_description:web_widget_dropdown_dynamic.field_dynamic_dropdown_int
msgid "Dropdown Integer"
msgstr "Intero selezione tendina"

#. module: web_widget_dropdown_dynamic
#. odoo-javascript
#: code:addons/web_widget_dropdown_dynamic/static/src/js/field_dynamic_dropdown.esm.js:0
msgid "Dynamic Dropdown"
msgstr "Dropdown dinamico"

#. module: web_widget_dropdown_dynamic
#: model:ir.model,name:web_widget_dropdown_dynamic.model_ir_filters
msgid "Filters"
msgstr "Filtri"
34 changes: 34 additions & 0 deletions web_widget_dropdown_dynamic/i18n/sl.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_widget_dropdown_dynamic
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2026-06-06 14:47+0000\n"
"Last-Translator: Matjaz Mozetic <matjaz@luxim.si>\n"
"Language-Team: none\n"
"Language: sl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || "
"n%100==4 ? 2 : 3;\n"
"X-Generator: Weblate 5.15.2\n"

#. module: web_widget_dropdown_dynamic
#: model:ir.model.fields,field_description:web_widget_dropdown_dynamic.field_dynamic_dropdown_int
msgid "Dropdown Integer"
msgstr "Celo število spustni seznam"

#. module: web_widget_dropdown_dynamic
#. odoo-javascript
#: code:addons/web_widget_dropdown_dynamic/static/src/js/field_dynamic_dropdown.esm.js:0
msgid "Dynamic Dropdown"
msgstr "Dinamični spustni meni"

#. module: web_widget_dropdown_dynamic
#: model:ir.model,name:web_widget_dropdown_dynamic.model_ir_filters
msgid "Filters"
msgstr "Filtri"
33 changes: 33 additions & 0 deletions web_widget_dropdown_dynamic/i18n/tr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_widget_dropdown_dynamic
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2025-09-16 06:25+0000\n"
"Last-Translator: Betül Öğmen <betulo@eska.biz>\n"
"Language-Team: none\n"
"Language: tr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
"X-Generator: Weblate 5.10.4\n"

#. module: web_widget_dropdown_dynamic
#: model:ir.model.fields,field_description:web_widget_dropdown_dynamic.field_dynamic_dropdown_int
msgid "Dropdown Integer"
msgstr "Açılır Tamsayı"

#. module: web_widget_dropdown_dynamic
#. odoo-javascript
#: code:addons/web_widget_dropdown_dynamic/static/src/js/field_dynamic_dropdown.esm.js:0
msgid "Dynamic Dropdown"
msgstr "Dinamik Açılır Menü"

#. module: web_widget_dropdown_dynamic
#: model:ir.model,name:web_widget_dropdown_dynamic.model_ir_filters
msgid "Filters"
msgstr "Filtreler"
Loading
Loading