Skip to content

Commit 1cada9d

Browse files
committed
[MIG] web_m2x_options_manager: Migration to 18.0
1 parent 31ea98f commit 1cada9d

File tree

7 files changed

+26
-17
lines changed

7 files changed

+26
-17
lines changed

web_m2x_options_manager/README.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ Contributors
7575
- Duong (Tran Quoc) <[email protected]>
7676
- Chau Le <[email protected]>
7777

78+
Other credits
79+
-------------
80+
81+
The migration of this module from 17.0 to 18.0 was financially supported
82+
by Camptocamp
83+
7884
Maintainers
7985
-----------
8086

web_m2x_options_manager/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"summary": 'Adds an interface to manage the "Create" and'
77
' "Create and Edit" options for specific models and'
88
" fields.",
9-
"version": "17.0.1.0.0",
9+
"version": "18.0.1.0.0",
1010
"author": "Camptocamp, Odoo Community Association (OCA)",
1111
"license": "AGPL-3",
1212
"category": "Web",

web_m2x_options_manager/demo/res_partner_demo_view.xml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<odoo>
3-
43
<record id="res_partner_demo_form_view" model="ir.ui.view">
54
<field name="name">res.partner.demo.form.view</field>
65
<field name="model">res.partner</field>
@@ -15,15 +14,14 @@
1514
<field name="category_id" options="{'create': False}" />
1615
<!-- One2many -->
1716
<field name="user_ids">
18-
<tree>
19-
<!-- Many2one within tree -->
17+
<list>
18+
<!-- Many2one within list -->
2019
<field name="company_id" options="{'create': False}" />
21-
</tree>
20+
</list>
2221
</field>
2322
</group>
2423
</sheet>
2524
</form>
2625
</field>
2726
</record>
28-
2927
</odoo>

web_m2x_options_manager/models/m2x_create_edit_option.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright 2021 Camptocamp SA
22
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
33

4-
from odoo import _, api, fields, models
4+
from odoo import api, fields, models
55
from odoo.exceptions import ValidationError
66
from odoo.tools.cache import ormcache
77
from odoo.tools.safe_eval import safe_eval
@@ -123,7 +123,7 @@ def _inverse_model_name(self):
123123
def _check_field_in_model(self):
124124
for opt in self:
125125
if opt.field_id.model_id != opt.model_id:
126-
msg = _(
126+
msg = self.env._(
127127
"'%(field_name)s' is not a valid field for model '%(model_name)s'!",
128128
field_name=opt.field_name,
129129
model_name=opt.model_name,
@@ -134,7 +134,7 @@ def _check_field_in_model(self):
134134
def _check_field_type(self):
135135
ttypes = ("many2many", "many2one")
136136
if any(o.field_id.ttype not in ttypes for o in self):
137-
msg = _("Only Many2many and Many2one fields can be chosen!")
137+
msg = self.env._("Only Many2many and Many2one fields can be chosen!")
138138
raise ValidationError(msg)
139139

140140
def _apply_options(self, node):
@@ -145,14 +145,14 @@ def _apply_options(self, node):
145145
options = safe_eval(options, dict(self.env.context or [])) or {}
146146

147147
for k in ("create", "create_edit"):
148-
opt = self["option_%s" % k]
148+
opt = self[f"option_{k}"]
149149
if opt == "none":
150150
continue
151151
mode, val = opt.split("_")
152152
if k not in options:
153153
options[k] = val == "true"
154154
if mode == "force":
155-
options["no_%s" % k] = val == "false"
155+
options[f"no_{k}"] = val == "false"
156156
if not self.option_create_edit_wizard:
157157
options["no_quick_create"] = True
158158
node.set("options", str(options))
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The migration of this module from 17.0 to 18.0 was financially supported by Camptocamp

web_m2x_options_manager/static/description/index.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,8 @@ <h1 class="title">Web M2X Options Manager</h1>
380380
<li><a class="reference internal" href="#credits" id="toc-entry-3">Credits</a><ul>
381381
<li><a class="reference internal" href="#authors" id="toc-entry-4">Authors</a></li>
382382
<li><a class="reference internal" href="#contributors" id="toc-entry-5">Contributors</a></li>
383-
<li><a class="reference internal" href="#maintainers" id="toc-entry-6">Maintainers</a></li>
383+
<li><a class="reference internal" href="#other-credits" id="toc-entry-6">Other credits</a></li>
384+
<li><a class="reference internal" href="#maintainers" id="toc-entry-7">Maintainers</a></li>
384385
</ul>
385386
</li>
386387
</ul>
@@ -420,8 +421,13 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
420421
<li>Chau Le &lt;<a class="reference external" href="mailto:chaulb&#64;trobz.com">chaulb&#64;trobz.com</a>&gt;</li>
421422
</ul>
422423
</div>
424+
<div class="section" id="other-credits">
425+
<h2><a class="toc-backref" href="#toc-entry-6">Other credits</a></h2>
426+
<p>The migration of this module from 17.0 to 18.0 was financially supported
427+
by Camptocamp</p>
428+
</div>
423429
<div class="section" id="maintainers">
424-
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
430+
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
425431
<p>This module is maintained by the OCA.</p>
426432
<a class="reference external image-reference" href="https://odoo-community.org">
427433
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />

web_m2x_options_manager/views/ir_model.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8" ?>
22
<odoo>
3-
43
<record id="view_model_form_inherit" model="ir.ui.view">
54
<field name="name">view.model.form.inherit</field>
65
<field name="model">ir.model</field>
@@ -17,7 +16,7 @@
1716
nolabel="1"
1817
context="{'default_model_name': model}"
1918
>
20-
<tree editable="bottom">
19+
<list editable="bottom">
2120
<field name="model_name" column_invisible="1" />
2221
<field
2322
name="field_id"
@@ -28,11 +27,10 @@
2827
<field name="option_create" />
2928
<field name="option_create_edit" />
3029
<field name="option_create_edit_wizard" />
31-
</tree>
30+
</list>
3231
</field>
3332
</page>
3433
</xpath>
3534
</field>
3635
</record>
37-
3836
</odoo>

0 commit comments

Comments
 (0)