Skip to Content
Menu
This question has been flagged
456 Views

I am working on an Odoo 16 Insurance Management Cybro Module and have encountered an issue with a JavaScript extension that is not being triggered as expected. My goal is for users to be redirected to a detailed view of an insurance claim when any field in a tree view within the insurance.details view is clicked, but the script doesn't appear to be called at all.

When a row in this tree view within the insurance.details view is clicked, I expect the JavaScript method _onRowClicked to be triggered. If the model is "insurance.details", it should then open the claim.details form. However, the script does not seem to be executed at all when clicking on fields; the console log "Script called" never appears in the browser's console. Clicking on the button "View Details" correctly triggers a transition to the claim.details form, but this is not the overall behavior I want, as I need the entire row to be clickable.


Any insights or suggestions would be highly appreciated!


manifest.py:

{ 'name': 'Insurance Management', 'version': '16.0.1.1.1', 'summary': """Insurance Management & Operations""", 'description': """Insurance Management""", 'author': 'Cybrosys Techno Solutions', 'company': 'Cybrosys Techno Solutions', 'website': 'https://www.cybrosys.com', 'category': 'Industries', 'depends': ['account', 'base', 'crm', 'web'], 'license': 'AGPL-3', 'data': [ 'security/ir.model.access.csv', 'data/insurance_management_data.xml', 'views/claim_details_views.xml', 'views/employee_details_views.xml', 'views/insurance_details_views.xml', 'views/policy_details_views.xml', 'views/insurance_management_menus.xml', 'views/crm_lead_views.xml' ], 'images': ['static/description/banner.png'], 'installable': True, 'application': True, 'auto_install': False, 'assets': { 'web.assets_backend': [ '/insurance_management_cybro/static/src/css/styles.css', '/insurance_management_cybro/static/src/js/list_controller.js' ] }, }


list_controller.js

odoo.define("insurance_management_cybro.list_controller", function (require) { "use strict"; console.log("Script called"); var ListController = require("web.ListController"); ListController.include({ _onRowClicked: function (event) { console.log("Row clicked", event); if (this.modelName === "insurance.details") { var action = { type: "ir.actions.act_window", view_type: "form", view_mode: "form", res_model: "claim.details", views: [[false, "form"]], target: "current", res_id: event.data.id, }; return this.do_action(action); } this._super.apply(this, arguments); }, }); });

insurance_details_views.xml




Avatar
Discard
Related Posts Replies Views Activity
0
Oct 24
514
0
Oct 24
326
0
Sep 24
540
1
Jun 23
1288
1
May 23
1143