Skip to content

Commit

Permalink
[18.0][MIG][base_export_manager] Migration to 18.0
Browse files Browse the repository at this point in the history
- Removing unnecessary rendering of the technical field in the export menu as odoo core already does it
- Fixing JS super call
- Replacing tree for list
- More fixes
  • Loading branch information
BT-crodriguez committed Nov 11, 2024
1 parent 9c70358 commit 89baa37
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 31 deletions.
2 changes: 0 additions & 2 deletions base_export_manager/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"views/ir_model_access.xml",
"views/res_groups.xml",
],
"qweb": ["static/src/xml/base.xml"],
"author": "Tecnativa, "
"LasLabs, "
"Ursa Information Systems, "
Expand All @@ -26,7 +25,6 @@
"assets": {
"web.assets_backend": [
"base_export_manager/static/src/views/list/list_controller.esm.js",
"base_export_manager/static/src/xml/base.xml",
],
},
"installable": True,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
/** @odoo-module **/

import {ListController} from "@web/views/list/list_controller";
const {onWillRender} = owl;
import {patch} from "@web/core/utils/patch";
import {session} from "@web/session";

patch(ListController.prototype, "base_export_manager", {
patch(ListController.prototype, {
setup() {
this._super(...arguments);
super.setup();
onWillRender(async () => {
if (this.isExportEnable) {
const is_export_enabled =
Expand Down
10 changes: 0 additions & 10 deletions base_export_manager/static/src/xml/base.xml

This file was deleted.

23 changes: 12 additions & 11 deletions base_export_manager/views/ir_exports.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<record id="ir_exports_action" model="ir.actions.act_window">
<field name="name">Export Profiles</field>
<field name="res_model">ir.exports</field>
<field name="view_mode">tree,form</field>
<field name="view_mode">list,form</field>
</record>
<menuitem
id="ir_exports_menu"
Expand All @@ -17,11 +17,11 @@
<field name="name">Export Profile tree</field>
<field name="model">ir.exports</field>
<field name="arch" type="xml">
<tree>
<list>
<field name="name" />
<field name="model_id" />
<field name="resource" />
</tree>
</list>
</field>
</record>
<record id="ir_exports_form_view" model="ir.ui.view">
Expand All @@ -42,12 +42,12 @@
colspan="4"
context="{'default_model1_id': model_id}"
>
<tree editable="bottom">
<list editable="bottom">
<field name="sequence" widget="handle" />
<field name="model1_id" invisible="True" />
<field name="model2_id" invisible="True" />
<field name="model3_id" invisible="True" />
<field name="model4_id" invisible="True" />
<field name="model1_id" column_invisible="True" />
<field name="model2_id" column_invisible="True" />
<field name="model3_id" column_invisible="True" />
<field name="model4_id" column_invisible="True" />
<field name="label" />
<field name="name" readonly="1" />
<field
Expand All @@ -57,20 +57,21 @@
/>
<field
name="field2_id"
attrs="{'readonly': [('model2_id', '=', False)]}"
readonly="'model2_id', '=', False"
options="{'no_open': True, 'no_create': True}"
/>
<field
name="field3_id"
attrs="{'readonly': [('model3_id', '=', False)]}"
readonly="'model3_id', '=', False"
options="{'no_open': True, 'no_create': True}"
/>
<field
name="field4_id"
attrs="{'readonly': [('model3_id', '=', False)]}"
readonly="'model4_id', '=', False"
options="{'no_open': True, 'no_create': True}"
/>
</tree>
</list>
</field>
</page>
</notebook>
Expand Down
2 changes: 1 addition & 1 deletion base_export_manager/views/ir_model.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<field name="inherit_id" ref="base.view_model_form" />
<field name="arch" type="xml">
<xpath
expr="//field[@name='access_ids']//tree//field[@name='perm_unlink']"
expr="//field[@name='access_ids']//list//field[@name='perm_unlink']"
position="after"
>
<field name="perm_export" />
Expand Down
4 changes: 2 additions & 2 deletions base_export_manager/views/ir_model_access.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" ?>
<odoo>
<record id="ir_model_access_view_tree" model="ir.ui.view">
<field name="name">ir.model.access.tree.base_export_manager</field>
<field name="name">ir.model.access.list.base_export_manager</field>
<field name="model">ir.model.access</field>
<field name="inherit_id" ref="base.ir_access_view_tree" />
<field name="arch" type="xml">
Expand All @@ -11,7 +11,7 @@
</field>
</record>
<record id="ir_model_access_view_tree_edition" model="ir.ui.view">
<field name="name">ir.model.access.tree.edition.base_export_manager</field>
<field name="name">ir.model.access.list.edition.base_export_manager</field>
<field name="model">ir.model.access</field>
<field name="inherit_id" ref="base.ir_access_view_tree_edition" />
<field name="arch" type="xml">
Expand Down
2 changes: 1 addition & 1 deletion base_export_manager/views/res_groups.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<field name="inherit_id" ref="base.view_groups_form" />
<field name="arch" type="xml">
<xpath
expr="//field[@name='model_access']//tree//field[@name='perm_unlink']"
expr="//field[@name='model_access']//list//field[@name='perm_unlink']"
position="after"
>
<field name="perm_export" />
Expand Down

0 comments on commit 89baa37

Please sign in to comment.