Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c366347
[14.0] web_m2x_options_manager: New module to manage create/edit opti…
SilvioC2C Aug 2, 2021
4e15935
[UPD] Update web_m2x_options_manager.pot
oca-travis Oct 14, 2021
6816166
[UPD] README.rst
OCA-git-bot Oct 14, 2021
f537a78
[UPD] web_m2x_options_manager: Add option to prevent Create/Edit wiza…
yankinmax Oct 18, 2021
1c718b0
[UPD] Update web_m2x_options_manager.pot
oca-travis Oct 22, 2021
c313015
web_m2x_options_manager 14.0.1.1.0
OCA-git-bot Oct 22, 2021
8bc886c
Added translation using Weblate (Italian)
francesco-ooops Mar 21, 2023
170129c
Translated using Weblate (Italian)
francesco-ooops Mar 21, 2023
9241701
[UPD] README.rst
OCA-git-bot Sep 3, 2023
3e95785
Update translation files
weblate Oct 9, 2023
226b795
[FIX] all: fix pre-commit new checks
aleuffre Oct 30, 2023
d3e660c
[UPD] Update web_m2x_options_manager.pot
Oct 30, 2023
dc5b48d
[BOT] post-merge updates
OCA-git-bot Oct 30, 2023
e4b87db
Update translation files
weblate Oct 30, 2023
57472af
Translated using Weblate (Italian)
mymage Jan 16, 2025
f90f88e
[FIX] web_m2x_options_manager: writing mode when create/edit wizard i…
Chionne27 Apr 9, 2025
77c75fc
[BOT] post-merge updates
OCA-git-bot Apr 14, 2025
9408dcc
[IMP] web_m2x_options_manager: pre-commit auto fixes
SilvioC2C Nov 6, 2025
35a613a
[MIG] web_m2x_options_manager: Migration to 17.0
SilvioC2C Nov 6, 2025
03ffa22
[UPD] Update web_m2x_options_manager.pot
Nov 18, 2025
47b653b
[BOT] post-merge updates
OCA-git-bot Nov 18, 2025
c799fa1
[IMP] web_m2x_options_manager: pre-commit auto fixes
SilvioC2C Nov 20, 2025
936c959
[MIG] web_m2x_options_manager: Migration to 18.0
SilvioC2C Nov 20, 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
1 change: 1 addition & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
odoo_test_helper
99 changes: 99 additions & 0 deletions web_m2x_options_manager/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
=======================
Web M2X Options Manager
=======================

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

.. |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/licence-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/18.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-18-0/web-18-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=18.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:%2018.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/18.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
30 changes: 30 additions & 0 deletions web_m2x_options_manager/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# 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": "18.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",
],
"demo": [
"demo/res_partner_demo_view.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",
}
28 changes: 28 additions & 0 deletions web_m2x_options_manager/demo/res_partner_demo_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="res_partner_demo_form_view" model="ir.ui.view">
<field name="name">res.partner.demo.form.view</field>
<field name="model">res.partner</field>
<field name="priority">1000</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<!-- Many2one w/o options -->
<field name="title" />
<!-- Many2one w/ options -->
<field
name="parent_id"
options="{'create': False, 'create_edit': False}"
/>
<!-- Many2many w/ options -->
<field
name="category_id"
options="{'create': False, 'create_edit': False}"
/>
</group>
</sheet>
</form>
</field>
</record>
</odoo>
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 <[email protected]>\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