Skip to content

Commit 56aaa6a

Browse files
Ernesto Tejedaschhatbar-initos
Ernesto Tejeda
authored andcommitted
[MIG] chained_swapper: Migration to 13.0
1 parent dbb7c5b commit 56aaa6a

File tree

7 files changed

+17
-24
lines changed

7 files changed

+17
-24
lines changed

chained_swapper/README.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ Chained Swapper
1414
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
1515
:alt: License: AGPL-3
1616
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--ux-lightgray.png?logo=github
17-
:target: https://github.com/OCA/server-ux/tree/12.0/chained_swapper
17+
:target: https://github.com/OCA/server-ux/tree/13.0/chained_swapper
1818
:alt: OCA/server-ux
1919
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
20-
:target: https://translation.odoo-community.org/projects/server-ux-12-0/server-ux-12-0-chained_swapper
20+
:target: https://translation.odoo-community.org/projects/server-ux-13-0/server-ux-13-0-chained_swapper
2121
:alt: Translate me on Weblate
2222
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
23-
:target: https://runbot.odoo-community.org/runbot/250/12.0
23+
:target: https://runbot.odoo-community.org/runbot/250/13.0
2424
:alt: Try me on Runbot
2525

2626
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -100,7 +100,7 @@ Bug Tracker
100100
Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-ux/issues>`_.
101101
In case of trouble, please check there if your issue has already been reported.
102102
If you spotted it first, help us smashing it by providing a detailed and welcomed
103-
`feedback <https://github.com/OCA/server-ux/issues/new?body=module:%20chained_swapper%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
103+
`feedback <https://github.com/OCA/server-ux/issues/new?body=module:%20chained_swapper%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
104104

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

@@ -133,6 +133,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
133133
mission is to support the collaborative development of Odoo features and
134134
promote its widespread use.
135135

136-
This module is part of the `OCA/server-ux <https://github.com/OCA/server-ux/tree/12.0/chained_swapper>`_ project on GitHub.
136+
This module is part of the `OCA/server-ux <https://github.com/OCA/server-ux/tree/13.0/chained_swapper>`_ project on GitHub.
137137

138138
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

chained_swapper/__manifest__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"name": "Chained Swapper",
55
"summary": "Chained Swapper",
6-
"version": "12.0.1.0.1",
6+
"version": "13.0.1.0.0",
77
"author": "Tecnativa, Odoo Community Association (OCA)",
88
"category": "Tools",
99
"website": "https://github.com/OCA/server-ux",
@@ -14,6 +14,6 @@
1414
"views/chained_swapper_views.xml",
1515
"wizard/chained_swapper_wizard_views.xml",
1616
],
17-
"demo": ["demo/chained_swapper_demo.xml",],
17+
"demo": ["demo/chained_swapper_demo.xml"],
1818
"uninstall_hook": "uninstall_hook",
1919
}

chained_swapper/demo/chained_swapper_demo.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
id="partner_chained_swap_lang_action_demo"
2424
name="Chained swap: Language"
2525
res_model="chained.swapper.wizard"
26-
src_model="res.partner"
26+
binding_model="res.partner"
2727
view_mode="form"
2828
context="{'chained_swapper_id': ref('chained_swapper_demo')}"
29-
key2="client_action_multi"
3029
target="new"
3130
/>
31+
<!-- pylint:disable=duplicate-xml-record-id -->
3232
<record id="chained_swapper_demo" model="chained.swapper">
3333
<field
3434
name="ref_ir_act_window_id"

chained_swapper/models/chained_swapper.py

+2-7
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class ChainedSwapper(models.Model):
1010
_name = "chained.swapper"
1111
_description = "Chained Swapper"
1212

13-
name = fields.Char(required=True, translate=True, index=1,)
13+
name = fields.Char(required=True, translate=True, index=1)
1414
model_id = fields.Many2one(
1515
comodel_name="ir.model",
1616
required=True,
@@ -92,22 +92,18 @@ def write(self, vals):
9292
self.mapped("ref_ir_act_window_id").write({"name": vals["name"]})
9393
return res
9494

95-
@api.multi
9695
def unlink(self):
9796
self.unlink_action()
9897
return super().unlink()
9998

100-
@api.multi
10199
def add_action(self):
102100
self.ensure_one()
103101
action = self.env["ir.actions.act_window"].create(
104102
{
105103
"name": _("Chained swap") + ": " + self.name,
106104
"type": "ir.actions.act_window",
107105
"res_model": "chained.swapper.wizard",
108-
"src_model": self.model_id.model,
109106
"groups_id": [(4, x.id) for x in self.group_ids],
110-
"view_type": "form",
111107
"context": "{'chained_swapper_id': %d}" % (self.id),
112108
"view_mode": "form",
113109
"target": "new",
@@ -118,7 +114,6 @@ def add_action(self):
118114
self.write({"ref_ir_act_window_id": action.id})
119115
return True
120116

121-
@api.multi
122117
def unlink_action(self):
123118
self.mapped("ref_ir_act_window_id").unlink()
124119
return True
@@ -177,7 +172,7 @@ class ChainedSwapperConstraint(models.Model):
177172
chained_swapper_id = fields.Many2one(
178173
comodel_name="chained.swapper", ondelete="cascade"
179174
)
180-
name = fields.Char(required=True, translate=True,)
175+
name = fields.Char(required=True, translate=True)
181176
expression = fields.Text(
182177
string="Constraint expression",
183178
required=True,

chained_swapper/static/description/index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ <h1 class="title">Chained Swapper</h1>
367367
!! This file is generated by oca-gen-addon-readme !!
368368
!! changes will be overwritten. !!
369369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
370-
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/server-ux/tree/12.0/chained_swapper"><img alt="OCA/server-ux" src="https://img.shields.io/badge/github-OCA%2Fserver--ux-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/server-ux-12-0/server-ux-12-0-chained_swapper"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/250/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
370+
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/server-ux/tree/13.0/chained_swapper"><img alt="OCA/server-ux" src="https://img.shields.io/badge/github-OCA%2Fserver--ux-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/server-ux-13-0/server-ux-13-0-chained_swapper"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/250/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
371371
<p>This module allows to swap the value of a field and propagate it in a chained
372372
way to linked records. Example: changing the delivery address in a confirmed
373373
sales order, it should be changed in its delivery orders as well.</p>
@@ -452,7 +452,7 @@ <h1><a class="toc-backref" href="#id3">Bug Tracker</a></h1>
452452
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/server-ux/issues">GitHub Issues</a>.
453453
In case of trouble, please check there if your issue has already been reported.
454454
If you spotted it first, help us smashing it by providing a detailed and welcomed
455-
<a class="reference external" href="https://github.com/OCA/server-ux/issues/new?body=module:%20chained_swapper%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
455+
<a class="reference external" href="https://github.com/OCA/server-ux/issues/new?body=module:%20chained_swapper%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
456456
<p>Do not contact contributors directly about support or help with technical issues.</p>
457457
</div>
458458
<div class="section" id="credits">
@@ -480,7 +480,7 @@ <h2><a class="toc-backref" href="#id7">Maintainers</a></h2>
480480
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
481481
mission is to support the collaborative development of Odoo features and
482482
promote its widespread use.</p>
483-
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-ux/tree/12.0/chained_swapper">OCA/server-ux</a> project on GitHub.</p>
483+
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/server-ux/tree/13.0/chained_swapper">OCA/server-ux</a> project on GitHub.</p>
484484
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
485485
</div>
486486
</div>

chained_swapper/views/chained_swapper_views.xml

-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@
8787
<record id="chained_swapper_action" model="ir.actions.act_window">
8888
<field name="name">Field Swaps</field>
8989
<field name="res_model">chained.swapper</field>
90-
<field name="view_type">form</field>
9190
<field name="view_mode">tree,form</field>
9291
</record>
9392
<!-- Chained Swapper Sub-fields -->

chained_swapper/wizard/chained_swapper_wizard.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ def default_get(self, fields):
4343
def fields_view_get(
4444
self, view_id=None, view_type="form", toolbar=False, submenu=False
4545
):
46-
""" As we don't have any field in this model, result['fields']
46+
"""As we don't have any field in this model, result['fields']
4747
and result['arch'] are modified to add dynamically the
4848
corresponding field.
4949
"""
5050
res = super().fields_view_get(
51-
view_id=view_id, view_type=view_type, toolbar=toolbar, submenu=submenu
51+
view_id=view_id, view_type=view_type, toolbar=toolbar, submenu=submenu,
5252
)
5353
if not self.env.context.get("chained_swapper_id"):
5454
return res
@@ -83,7 +83,7 @@ def fields_view_get(
8383

8484
@api.model
8585
def create(self, vals):
86-
""" As we don't have any field in this model, the key-value pair
86+
"""As we don't have any field in this model, the key-value pair
8787
received in vals dict are only used to change the value in the active
8888
models.
8989
"""
@@ -114,7 +114,6 @@ def create(self, vals):
114114
)
115115
return super().create({})
116116

117-
@api.multi
118117
def change_action(self):
119118
return {"type": "ir.actions.act_window_close"}
120119

0 commit comments

Comments
 (0)