콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
797 화면

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




아바타
취소
관련 게시물 답글 화면 활동
0
10월 24
1210
0
10월 24
928
0
9월 24
1112
1
6월 23
1952
1
5월 23
1925