Skip to content

Commit

Permalink
[MIG]web_m2x_options: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelregidor committed Jul 24, 2024
1 parent 55c7df8 commit 5027c33
Show file tree
Hide file tree
Showing 18 changed files with 493 additions and 714 deletions.
47 changes: 13 additions & 34 deletions web_m2x_options/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ web_m2x_options
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:3a852d89e5cd927339a18898b21556fc15d261782fca8783b728cdc6a8ffa574
!! source digest: sha256:0afece0246fa101b62c0522c1df2070cea624097713b5c6991fce8a2903dc1ef
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand All @@ -32,9 +32,8 @@ This modules modifies "many2one" and "many2manytags" form widgets so as
to add some new display control options.

Options provided includes possibility to remove "Create..." and/or
"Create and Edit..." entries from many2one drop down. You can also
change default number of proposition appearing in the drop-down. Or
prevent the dialog box poping in case of validation error.
"Create and Edit..." entries drop down. You can also change default
number of proposition appearing in the drop-down.

If not specified, the module will avoid proposing any of the create
options if the current user has no permission rights to create the
Expand All @@ -53,16 +52,13 @@ in the field's options dict

``create`` *boolean* (Default: depends if user have create rights)

Whether to display the "Create..." entry in dropdown panel.
Whether to display the "Create..." entry in dropdown panel. Only for
m2o fields.

``create_edit`` *boolean* (Default: depends if user have create rights)

Whether to display "Create and Edit..." entry in dropdown panel

``m2o_dialog`` *boolean* (Default: depends if user have create rights)

Whether to display the many2one dialog in case of validation error.

``limit`` *int* (Default: odoo default value is ``8``)

Number of displayed record in drop-down panel
Expand All @@ -81,21 +77,9 @@ in the field's options dict
A dictionary to link field value with a HTML color. This option has
to be used with field_color.

``no_open_edit`` *boolean* (Default: value of ``no_open`` which is
``False`` if not set)

Causes a many2one not to offer to click through in edit mode, but
well in read mode

``open`` *boolean* (Default: ``False``)

Makes many2many_tags and one2many rows buttons that open the linked
resource

``no_color_picker`` *boolean* (Default: ``False``)

Deactivates the color picker on many2many_tags buttons to do nothing
(ignored if open is set)
Makes many2one buttons that open the linked resource.

ir.config_parameter options
---------------------------
Expand All @@ -117,12 +101,6 @@ create rights)
Whether to display "Create and Edit..." entry in dropdown panel for
all fields in the odoo instance.

``web_m2x_options.m2o_dialog`` *boolean* (Default: depends if user have
create rights)

Whether to display the many2one dialog in case of validation error
for all fields in the odoo instance.

``web_m2x_options.limit`` *int* (Default: odoo default value is ``8``)

Number of displayed record in drop-down panel for all fields in the
Expand All @@ -142,7 +120,6 @@ To add these parameters go to Configuration -> Technical -> Parameters

- web_m2x_options.create: False
- web_m2x_options.create_edit: False
- web_m2x_options.m2o_dialog: False
- web_m2x_options.limit: 10
- web_m2x_options.search_more: True
- web_m2x_options.field_limit_entries: 5
Expand All @@ -155,7 +132,7 @@ Your XML form view definition could contain:
.. code:: xml
...
<field name="partner_id" options="{'limit': 10, 'create': false, 'create_edit': false, 'search_more': true, 'field_color':'state', 'colors':{'active':'green'}}"/>
<field name="partner_id" options="{'limit': 10, 'create': false, 'create_edit': false, 'search_more': true, 'field_color':'type', 'colors':{'contact':'green', 'invoice': 'red', 'delivery': 'blue'}}"/>
...
Known issues / Roadmap
Expand All @@ -170,10 +147,6 @@ verify your installation.
- Instead of making the tags rectangle clickable, I think it's better
to put the text as a clickable link, so we will get a consistent
behaviour/aspect with other clickable elements (many2one...).
- In edit mode, it would be great to add an icon like the one on
many2one fields to allow to open the many2many in a popup window.
- Include this feature as a configurable option via parameter to have
this behaviour by default in all many2many tags.

Bug Tracker
===========
Expand Down Expand Up @@ -226,6 +199,12 @@ Contributors

- Hoang Diep <[email protected]>

- `Sygel <https://sygel.es>`__:

- Manuel Regidor <[email protected]>
- Valentín Vinagre <[email protected]>
- Harald Panten <[email protected]>

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

Expand Down
13 changes: 11 additions & 2 deletions web_m2x_options/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

{
"name": "web_m2x_options",
"version": "16.0.1.1.3",
"version": "17.0.1.0.0",
"category": "Web",
"author": "initOS GmbH,"
"ACSONE SA/NV, "
Expand All @@ -16,6 +16,15 @@
"website": "https://github.com/OCA/web",
"license": "AGPL-3",
"depends": ["web"],
"assets": {"web.assets_backend": ["web_m2x_options/static/src/components/*"]},
"assets": {
"web.assets_backend": [
(
"before",
"web/static/src/views/fields/*",
"web_m2x_options/static/src/components/form.esm.js",
),
"web_m2x_options/static/src/components/base.xml",
]
},
"installable": True,
}
3 changes: 0 additions & 3 deletions web_m2x_options/i18n/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,3 @@ msgstr "als neu"
#~ msgstr ""
#~ "Sie legen eine neue %s an, sind Sie sicher, dass diese nicht bereits "
#~ "vorhanden ist?"

#~ msgid "!(widget.nodeOptions.no_open || widget.nodeOptions.no_open_edit)"
#~ msgstr "!(widget.nodeOptions.no_open || widget.nodeOptions.no_open_edit)"
3 changes: 0 additions & 3 deletions web_m2x_options/i18n/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,3 @@ msgstr ""
#~ msgstr ""
#~ "Vous créez un nouveau %s, est-ce que vous êtes sur qu'il n'existe pas "
#~ "déjà ?"

#~ msgid "!(widget.nodeOptions.no_open || widget.nodeOptions.no_open_edit)"
#~ msgstr "!(widget.nodeOptions.no_open || widget.nodeOptions.no_open_edit)"
4 changes: 0 additions & 4 deletions web_m2x_options/i18n/hr.po
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,3 @@ msgstr ""
#, python-format
#~ msgid "You are creating a new %s, are you sure it does not exist yet?"
#~ msgstr "Želite kreirati novi %s, jeste li sigurni da već ne postoji?"

#, fuzzy
#~ msgid "!(widget.nodeOptions.no_open || widget.nodeOptions.no_open_edit)"
#~ msgstr "!(opcije isključuju otvaranje ili uređivanje)"
3 changes: 0 additions & 3 deletions web_m2x_options/i18n/nl.po
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,6 @@ msgstr ""
#~ msgid "You are creating a new %s, are you sure it does not exist yet?"
#~ msgstr "U maakt een nieuw %s, weet u het zeker dat dit nog niet bestaat?"

#~ msgid "!(widget.nodeOptions.no_open || widget.nodeOptions.no_open_edit)"
#~ msgstr "!(widget.nodeOptions.no_open || widget.nodeOptions.no_open_edit)"

#~ msgid "Display Name"
#~ msgstr "Weergavenaam"

Expand Down
3 changes: 0 additions & 3 deletions web_m2x_options/i18n/pt_BR.po
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,3 @@ msgstr "como um novo"
#~ msgid "You are creating a new %s, are you sure it does not exist yet?"
#~ msgstr ""
#~ "Você está criando um novo %s, você tem certeza de que ainda não existe?"

#~ msgid "!(widget.nodeOptions.no_open || widget.nodeOptions.no_open_edit)"
#~ msgstr "!(widget.options.no_open || widget.nodeOptions.no_open_edit)"
3 changes: 0 additions & 3 deletions web_m2x_options/i18n/zh_CN.po
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,3 @@ msgstr ""
#, python-format
#~ msgid "You are creating a new %s, are you sure it does not exist yet?"
#~ msgstr "你正在创建一个新的%s,你确定它还不存在吗?"

#~ msgid "!(widget.nodeOptions.no_open || widget.nodeOptions.no_open_edit)"
#~ msgstr "!(widget.nodeOptions.no_open || widget.nodeOptions.no_open_edit)"
2 changes: 1 addition & 1 deletion web_m2x_options/models/ir_config_parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ def get_web_m2x_options(self):
"web_m2x_options.create_edit",
"web_m2x_options.limit",
"web_m2x_options.search_more",
"web_m2x_options.m2o_dialog",
"web_m2x_options.field_limit_entries",
"web_m2x_options.open",
]
values = self.sudo().search_read([["key", "in", opts]], ["key", "value"])
return {res["key"]: res["value"] for res in values}
5 changes: 5 additions & 0 deletions web_m2x_options/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@

- [Trobz](https://trobz.com):
- Hoang Diep \<<[email protected]>\>

- [Sygel](https://sygel.es):
- Manuel Regidor \<<[email protected]>\>
- Valentín Vinagre \<<[email protected]>\>
- Harald Panten \<<[email protected]>\>
5 changes: 2 additions & 3 deletions web_m2x_options/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ This modules modifies "many2one" and "many2manytags" form widgets so as
to add some new display control options.

Options provided includes possibility to remove "Create..." and/or
"Create and Edit..." entries from many2one drop down. You can also
change default number of proposition appearing in the drop-down. Or
prevent the dialog box poping in case of validation error.
"Create and Edit..." entries drop down. You can also change default
number of proposition appearing in the drop-down.

If not specified, the module will avoid proposing any of the create
options if the current user has no permission rights to create the
Expand Down
4 changes: 0 additions & 4 deletions web_m2x_options/readme/ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,3 @@ your installation.
- Instead of making the tags rectangle clickable, I think it's better to
put the text as a clickable link, so we will get a consistent
behaviour/aspect with other clickable elements (many2one...).
- In edit mode, it would be great to add an icon like the one on
many2one fields to allow to open the many2many in a popup window.
- Include this feature as a configurable option via parameter to have
this behaviour by default in all many2many tags.
29 changes: 3 additions & 26 deletions web_m2x_options/readme/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@

`create` *boolean* (Default: depends if user have create rights)

> Whether to display the "Create..." entry in dropdown panel.
> Whether to display the "Create..." entry in dropdown panel. Only for m2o fields.
`create_edit` *boolean* (Default: depends if user have create rights)

> Whether to display "Create and Edit..." entry in dropdown panel
`m2o_dialog` *boolean* (Default: depends if user have create rights)

> Whether to display the many2one dialog in case of validation error.
`limit` *int* (Default: odoo default value is `8`)

> Number of displayed record in drop-down panel
Expand All @@ -30,21 +26,9 @@
> A dictionary to link field value with a HTML color. This option has to
> be used with field_color.
`no_open_edit` *boolean* (Default: value of `no_open` which is `False`
if not set)

> Causes a many2one not to offer to click through in edit mode, but well
> in read mode
`open` *boolean* (Default: `False`)

> Makes many2many_tags and one2many rows buttons that open the linked
> resource
`no_color_picker` *boolean* (Default: `False`)

> Deactivates the color picker on many2many_tags buttons to do nothing
> (ignored if open is set)
> Makes many2one buttons that open the linked resource.
## ir.config_parameter options

Expand All @@ -65,12 +49,6 @@ create rights)
> Whether to display "Create and Edit..." entry in dropdown panel for
> all fields in the odoo instance.
`web_m2x_options.m2o_dialog` *boolean* (Default: depends if user have
create rights)

> Whether to display the many2one dialog in case of validation error for
> all fields in the odoo instance.
`web_m2x_options.limit` *int* (Default: odoo default value is `8`)

> Number of displayed record in drop-down panel for all fields in the
Expand All @@ -90,7 +68,6 @@ To add these parameters go to Configuration -\> Technical -\> Parameters

- web_m2x_options.create: False
- web_m2x_options.create_edit: False
- web_m2x_options.m2o_dialog: False
- web_m2x_options.limit: 10
- web_m2x_options.search_more: True
- web_m2x_options.field_limit_entries: 5
Expand All @@ -101,6 +78,6 @@ Your XML form view definition could contain:

``` xml
...
<field name="partner_id" options="{'limit': 10, 'create': false, 'create_edit': false, 'search_more': true, 'field_color':'state', 'colors':{'active':'green'}}"/>
<field name="partner_id" options="{'limit': 10, 'create': false, 'create_edit': false, 'search_more': true, 'field_color':'type', 'colors':{'contact':'green', 'invoice': 'red', 'delivery': 'blue'}}"/>
...
```
Loading

0 comments on commit 5027c33

Please sign in to comment.