Skip to content

Commit 0ed0be9

Browse files
[MIG] web_form_banner: Migration to 18.0
1 parent d36566d commit 0ed0be9

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

web_form_banner/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
33
{
44
"name": "Web Form Banner",
5-
"version": "17.0.1.0.0",
5+
"version": "18.0.1.0.0",
66
"category": "Web",
77
"author": "Quartile, Odoo Community Association (OCA)",
88
"website": "https://github.com/OCA/web",

web_form_banner/models/web_form_banner_rule.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ class WebFormBannerRule(models.Model):
9898

9999
name = fields.Char(required=True)
100100
model_id = fields.Many2one("ir.model", ondelete="cascade", required=True)
101-
model_name = fields.Char(related="model_id.model", store=True, readonly=True)
101+
model_name = fields.Char(
102+
related="model_id.model", string="Model Name", store=True, readonly=True
103+
)
102104
view_ids = fields.Many2many(
103105
"ir.ui.view",
104106
string="Views",

web_form_banner/tests/test_web_form_banner.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ def _get_arch_tree(self, model, view):
3030

3131
def _find_banner_node(self, tree, rule):
3232
"""Find the injected placeholder node for the rule."""
33-
xpath = (
34-
"//div[@data-rule-id='%s' and contains(@class,'o_form_banner')]" % rule.id
35-
) # noqa: E501
33+
xpath = f"//div[@data-rule-id='{rule.id}' and contains(@class,'o_form_banner')]"
3634
nodes = tree.xpath(xpath)
3735
self.assertTrue(nodes, "Expected banner node injected in the form arch.")
3836
return nodes[0]

web_form_banner/views/web_form_banner_rule_views.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<field name="name">web.form.banner.rule.tree</field>
55
<field name="model">web.form.banner.rule</field>
66
<field name="arch" type="xml">
7-
<tree>
7+
<list>
88
<field name="sequence" widget="handle" />
99
<field name="name" />
1010
<field name="model_id" />
@@ -24,7 +24,7 @@
2424
placeholder="return {'visible': True, 'values': {'title': '...'}}"
2525
optional="show"
2626
/>
27-
</tree>
27+
</list>
2828
</field>
2929
</record>
3030
<record id="view_web_form_banner_rule_form" model="ir.ui.view">
@@ -197,7 +197,7 @@ else:
197197
<record id="action_web_form_banner_rule" model="ir.actions.act_window">
198198
<field name="name">Form Banner Rules</field>
199199
<field name="res_model">web.form.banner.rule</field>
200-
<field name="view_mode">tree,form</field>
200+
<field name="view_mode">list,form</field>
201201
</record>
202202
<menuitem
203203
action="action_web_form_banner_rule"

0 commit comments

Comments
 (0)