[FIX] base_automation: avoid wrong server action view choice

When creating new primary views you should always specify the priority to
avoid having the specific view used as default. This one is specific to
base automation usage of server actions.

Also move view in its own file to respect guideines. RIP JEM.

Task-3527758 (Base Automation Refactor Fiximp)
Part of Task-3527752 (Mail: The Pre-Major Freeze FixImpLint)

Part-of: odoo/odoo#137133
This commit is contained in:
Thibault Delavallée
2023-10-02 06:54:38 +00:00
parent 5462b30b4f
commit 84b8ca626e
3 changed files with 27 additions and 23 deletions
+1
View File
@@ -19,6 +19,7 @@ trigger an automatic reminder email.
'data': [
'security/ir.model.access.csv',
'data/base_automation_data.xml',
'views/ir_actions_server_views.xml',
'views/base_automation_views.xml',
],
'assets': {
@@ -88,7 +88,7 @@
name="action_server_ids"
widget="one2many"
class="o_base_automation_actions_field"
context="{'default_model_id': model_id, 'default_state': False, 'form_view_ref': 'base_automation.view_server_action_form'}"
context="{'default_model_id': model_id, 'default_state': False, 'form_view_ref': 'base_automation.ir_actions_server_view_form_automation'}"
>
<kanban>
<control>
@@ -132,28 +132,6 @@
</field>
</record>
<!-- Automation: Server Action Form View -->
<record id="view_server_action_form" model="ir.ui.view">
<field name="name">base.automation.server.action.form</field>
<field name="model">ir.actions.server</field>
<field name="mode">primary</field>
<field name="inherit_id" ref="base.view_server_action_form"/>
<field name="arch" type="xml">
<xpath expr='//field[@name="name"]' position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr='//field[@name="state"]' position="attributes">
<attribute name="string">Type</attribute>
</xpath>
<xpath expr="//header" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='model_id']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
</field>
</record>
<!-- automation Tree View -->
<record id="view_base_automation_tree" model="ir.ui.view">
<field name="name">base.automation.tree</field>
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Automation: Server Action Form View -->
<record id="ir_actions_server_view_form_automation" model="ir.ui.view">
<field name="name">ir.actions.server.view.form.automation</field>
<field name="model">ir.actions.server</field>
<field name="mode">primary</field>
<field name="priority">32</field>
<field name="inherit_id" ref="base.view_server_action_form"/>
<field name="arch" type="xml">
<xpath expr='//field[@name="name"]' position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr='//field[@name="state"]' position="attributes">
<attribute name="string">Type</attribute>
</xpath>
<xpath expr="//header" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='model_id']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
</field>
</record>
</odoo>