Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d1761f8
[14.0] web_m2x_options_manager: New module to manage create/edit opti…
SilvioC2C Aug 2, 2021
a800216
[UPD] Update web_m2x_options_manager.pot
oca-travis Oct 14, 2021
1dc86b8
[UPD] README.rst
OCA-git-bot Oct 14, 2021
6be3957
[UPD] web_m2x_options_manager: Add option to prevent Create/Edit wiza…
yankinmax Oct 18, 2021
daaf3b9
[UPD] Update web_m2x_options_manager.pot
oca-travis Oct 22, 2021
7ba76aa
web_m2x_options_manager 14.0.1.1.0
OCA-git-bot Oct 22, 2021
5288df5
Added translation using Weblate (Italian)
francesco-ooops Mar 21, 2023
e3937df
Translated using Weblate (Italian)
francesco-ooops Mar 21, 2023
84027e3
[UPD] README.rst
OCA-git-bot Sep 3, 2023
1ae42d1
Update translation files
weblate Oct 9, 2023
7375c81
[FIX] all: fix pre-commit new checks
HekkiMelody Oct 30, 2023
f46b270
[UPD] Update web_m2x_options_manager.pot
Oct 30, 2023
6972126
[BOT] post-merge updates
OCA-git-bot Oct 30, 2023
c30252d
Update translation files
weblate Oct 30, 2023
73e1d94
Translated using Weblate (Italian)
mymage Jan 16, 2025
cf2e19f
[FIX] web_m2x_options_manager: writing mode when create/edit wizard i…
Chionne27 Apr 9, 2025
cd41303
[BOT] post-merge updates
OCA-git-bot Apr 14, 2025
703821e
[IMP] web_m2x_options_manager: pre-commit auto fixes
SilvioC2C Nov 6, 2025
6d9f24b
[MIG] web_m2x_options_manager: Migration to 17.0
SilvioC2C Nov 6, 2025
cf6c413
[UPD] Update web_m2x_options_manager.pot
Nov 18, 2025
5f28722
[BOT] post-merge updates
OCA-git-bot Nov 18, 2025
91aef79
[IMP] web_m2x_options_manager: pre-commit auto fixes
SilvioC2C Nov 20, 2025
c1d4bb4
[MIG] web_m2x_options_manager: Migration to 18.0
SilvioC2C Nov 20, 2025
8817351
[UPD] Update web_m2x_options_manager.pot
Nov 21, 2025
6b2bfc5
[BOT] post-merge updates
OCA-git-bot Nov 21, 2025
244054a
[MIG] web_m2x_options_manager: Migration to 19.0
Alexgars73 Dec 15, 2025
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
102 changes: 102 additions & 0 deletions web_m2x_options_manager/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=======================
Web M2X Options Manager
=======================

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

.. |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-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-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_m2x_options_manager
: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_m2x_options_manager
: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|

Allows managing the "Create..." and "Create and Edit..." options for
``Many2one`` and ``Many2many`` fields directly from the ``ir.model``
form view.

**Table of contents**

.. contents::
:local:

Usage
=====

Go to Settings > Technical > Models.

Choose the model you wish to edit, and open its form view. Go to the
"Create/Edit Options" tab, and add the fields you want to manage in 2
different sections:

- the first list view allows you to handle fields for the selected model
- the second list view allows you to handle fields where the selected
model is the comodel

For both sections:

- button "Fill" will add every missing field to the options
- button "Empty" will remove every option

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_m2x_options_manager%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
-------

* Camptocamp

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

- `Camptocamp <https://www.camptocamp.com>`__:

- Silvio Gregorini

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_m2x_options_manager>`_ 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_m2x_options_manager/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from .hooks import pre_init_hook
27 changes: 27 additions & 0 deletions web_m2x_options_manager/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2021 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Web M2X Options Manager",
"summary": 'Adds an interface to manage the "Create" and'
' "Create and Edit" options for specific models and'
" fields.",
"version": "19.0.1.0.0",
"author": "Camptocamp, Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Web",
"data": [
"security/ir.model.access.csv",
"views/ir_model.xml",
"views/m2x_create_edit_option.xml",
],
"depends": [
# OCA/server-tools
"base_view_inheritance_extension",
# OCA/web
"web_m2x_options",
],
"website": "https://github.com/OCA/web",
"installable": True,
"pre_init_hook": "pre_init_hook",
}
11 changes: 11 additions & 0 deletions web_m2x_options_manager/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright 2025 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from .tools import prepare_column_can_have_options, prepare_column_comodel_id


def pre_init_hook(env):
# Pre-create and pre-fill these columns for perf reasons (might take a while to
# let Odoo do it via the ORM for huge DBs)
prepare_column_can_have_options(env.cr)
prepare_column_comodel_id(env.cr)
201 changes: 201 additions & 0 deletions web_m2x_options_manager/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_m2x_options_manager
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-11-14 18:06+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_m2x_options_manager
#. odoo-python
#: code:addons/web_m2x_options_manager/models/m2x_create_edit_option.py:0
#, python-format
msgid "'%(field_name)s' is not a valid field for model '%(model_name)s'!"
msgstr "'%(field_name)s' non è un campo valido per il modello '%(model_name)s'!"

#. module: web_m2x_options_manager
#: model:ir.model.fields.selection,name:web_m2x_options_manager.selection__m2x_create_edit_option__option_create__set_true
#: model:ir.model.fields.selection,name:web_m2x_options_manager.selection__m2x_create_edit_option__option_create_edit__set_true
msgid "Add"
msgstr "Aggiungi"

#. module: web_m2x_options_manager
#: model:ir.model.fields,field_description:web_m2x_options_manager.field_m2x_create_edit_option__option_create_edit
msgid "Create & Edit Option"
msgstr "Opzione crea & modifica"

#. module: web_m2x_options_manager
#: model:ir.model.fields,field_description:web_m2x_options_manager.field_m2x_create_edit_option__option_create
msgid "Create Option"
msgstr "Opzione crea"

#. module: web_m2x_options_manager
#: model_terms:ir.ui.view,arch_db:web_m2x_options_manager.view_model_form_inherit
msgid "Create/Edit Options"
msgstr "Opzioni crea/modifica"

#. module: web_m2x_options_manager
#: model:ir.model.fields,field_description:web_m2x_options_manager.field_m2x_create_edit_option__create_uid
msgid "Created by"
msgstr "Creato da"

#. module: web_m2x_options_manager
#: model:ir.model.fields,field_description:web_m2x_options_manager.field_m2x_create_edit_option__create_date
msgid "Created on"
msgstr "Creato il"

#. module: web_m2x_options_manager
#: model:ir.model.fields,help:web_m2x_options_manager.field_m2x_create_edit_option__option_create_edit
msgid ""
"Defines behaviour for 'Create & Edit' option:\n"
"* Do nothing: nothing is done\n"
"* Add/Remove: option 'Create & Edit' is set to True/False only if not already present in view definition\n"
"* Force Add/Remove: option 'Create & Edit' is always set to True/False, overriding any pre-existing option"
msgstr ""
"Definisce il comportamento per l'opzione 'Crea e modifica':\n"
"* Non fare nulla: non viene fatto nulla\n"
"* Aggiungi/Rimuovi: l'opzione 'Crea e modifica' è impostata su Vero/Falso "
"solo se non è già presente nella definizione della vista\n"
"* Forza Aggiungi/Rimuovi: l'opzione 'Crea e modifica' è sempre impostata su "
"Vero/Falso, sovrascrivendo qualsiasi opzione preesistente"

#. module: web_m2x_options_manager
#: model:ir.model.fields,help:web_m2x_options_manager.field_m2x_create_edit_option__option_create
msgid ""
"Defines behaviour for 'Create' option:\n"
"* Do nothing: nothing is done\n"
"* Add/Remove: option 'Create' is set to True/False only if not already present in view definition\n"
"* Force Add/Remove: option 'Create' is always set to True/False, overriding any pre-existing option"
msgstr ""
"Definisce il comportamento per l'opzione 'Crea':\n"
"* Non fare nulla: non viene fatto nulla\n"
"* Aggiungi/Rimuovi: l'opzione 'Crea' è impostata su Vero/Falso solo se non è "
"già presente nella definizione della vista\n"
"* Forza Aggiungi/Rimuovi: l'opzione 'Crea' è sempre impostata su Vero/Falso, "
"sovrascrivendo qualsiasi opzione preesistente"

#. module: web_m2x_options_manager
#: model:ir.model.fields,field_description:web_m2x_options_manager.field_m2x_create_edit_option__display_name
msgid "Display Name"
msgstr "Nome visualizzato"

#. module: web_m2x_options_manager
#: model:ir.model.fields.selection,name:web_m2x_options_manager.selection__m2x_create_edit_option__option_create__none
#: model:ir.model.fields.selection,name:web_m2x_options_manager.selection__m2x_create_edit_option__option_create_edit__none
msgid "Do nothing"
msgstr "Non fare nulla"

#. module: web_m2x_options_manager
#: model_terms:ir.ui.view,arch_db:web_m2x_options_manager.view_model_form_inherit
msgid "Empty"
msgstr "Vuoto"

#. module: web_m2x_options_manager
#: model:ir.model.fields,field_description:web_m2x_options_manager.field_m2x_create_edit_option__field_id
msgid "Field"
msgstr "Campo"

#. module: web_m2x_options_manager
#: model:ir.model.fields,field_description:web_m2x_options_manager.field_m2x_create_edit_option__field_name
msgid "Field Name"
msgstr "Nome campo"

#. module: web_m2x_options_manager
#: model:ir.model,name:web_m2x_options_manager.model_ir_model_fields
msgid "Fields"
msgstr "Campi"

#. module: web_m2x_options_manager
#: model_terms:ir.ui.view,arch_db:web_m2x_options_manager.view_model_form_inherit
msgid "Fill"
msgstr "Popola"

#. module: web_m2x_options_manager
#: model:ir.model.fields.selection,name:web_m2x_options_manager.selection__m2x_create_edit_option__option_create__force_true
#: model:ir.model.fields.selection,name:web_m2x_options_manager.selection__m2x_create_edit_option__option_create_edit__force_true
msgid "Force Add"
msgstr "Forza aggiungi"

#. module: web_m2x_options_manager
#: model:ir.model.fields.selection,name:web_m2x_options_manager.selection__m2x_create_edit_option__option_create__force_false
#: model:ir.model.fields.selection,name:web_m2x_options_manager.selection__m2x_create_edit_option__option_create_edit__force_false
msgid "Force Remove"
msgstr "Forza rimuovi"

#. module: web_m2x_options_manager
#: model:ir.model.fields,field_description:web_m2x_options_manager.field_m2x_create_edit_option__id
msgid "ID"
msgstr "ID"

#. module: web_m2x_options_manager
#: model:ir.model.fields,field_description:web_m2x_options_manager.field_m2x_create_edit_option____last_update
msgid "Last Modified on"
msgstr "Ultima modifica il"

#. module: web_m2x_options_manager
#: model:ir.model.fields,field_description:web_m2x_options_manager.field_m2x_create_edit_option__write_uid
msgid "Last Updated by"
msgstr "Ultimo aggiornamento di"

#. module: web_m2x_options_manager
#: model:ir.model.fields,field_description:web_m2x_options_manager.field_m2x_create_edit_option__write_date
msgid "Last Updated on"
msgstr "Ultimo aggiornamento il"

#. module: web_m2x_options_manager
#: model:ir.model.fields,field_description:web_m2x_options_manager.field_ir_model__m2x_option_ids
msgid "M2X Create Edit Option"
msgstr "Crea opzione modifica M2X"

#. module: web_m2x_options_manager
#: model:ir.model,name:web_m2x_options_manager.model_m2x_create_edit_option
msgid "Manage Options 'Create/Edit' For Fields"
msgstr "Gestione opzioni 'Crea/Modifica' per i campi"

#. module: web_m2x_options_manager
#: model:ir.model.fields,field_description:web_m2x_options_manager.field_m2x_create_edit_option__model_id
msgid "Model"
msgstr "Modello"

#. module: web_m2x_options_manager
#: model:ir.model.fields,field_description:web_m2x_options_manager.field_m2x_create_edit_option__model_name
msgid "Model Name"
msgstr "Nome modello"

#. module: web_m2x_options_manager
#: model:ir.model,name:web_m2x_options_manager.model_ir_model
msgid "Models"
msgstr "Modelli"

#. module: web_m2x_options_manager
#. odoo-python
#: code:addons/web_m2x_options_manager/models/m2x_create_edit_option.py:0
#, python-format
msgid "Only Many2many and Many2one fields can be chosen!"
msgstr "Si possono scegliere solo campi Many2many e Many2one!"

#. module: web_m2x_options_manager
#: model:ir.model.constraint,message:web_m2x_options_manager.constraint_m2x_create_edit_option_model_field_uniqueness
msgid "Options must be unique for each model/field couple!"
msgstr "Le opzioni devono essere univoche per ogni coppia modello/campo!"

#. module: web_m2x_options_manager
#: model:ir.model.fields.selection,name:web_m2x_options_manager.selection__m2x_create_edit_option__option_create__set_false
#: model:ir.model.fields.selection,name:web_m2x_options_manager.selection__m2x_create_edit_option__option_create_edit__set_false
msgid "Remove"
msgstr "Rimuovi"

#. module: web_m2x_options_manager
#: model:ir.model,name:web_m2x_options_manager.model_ir_ui_view
msgid "View"
msgstr "Vista"
Loading
Loading