From c06c5500ea2c47d9e6a8e1e84d183f17e4b9f29b Mon Sep 17 00:00:00 2001 From: hoangvv Date: Tue, 4 Mar 2025 18:10:05 +0700 Subject: [PATCH] fix bug (fix web.session missing error) --- cenhomes_student/__manifest__.py | 2 +- .../copy_link_form/copy_link_form.js | 16 +- .../views/co_so_vat_chat/views_ky_tuc_xa.xml | 10 +- .../views_quan_he_doi_tac_hoc_vien.xml | 22 +- .../views/hoc_tap/views_kiem_tra_bai_cu.xml | 17 +- .../views/hoc_vien/views_hoc_vien.xml | 225 ++++++++---------- .../view_quan_he_tuyen_sinh_hoc_vien.xml | 41 ++-- .../views/views_hoc_vien_phong_thu_tuc.xml | 164 ++++++------- 8 files changed, 217 insertions(+), 280 deletions(-) diff --git a/cenhomes_student/__manifest__.py b/cenhomes_student/__manifest__.py index 1849066..969fd96 100644 --- a/cenhomes_student/__manifest__.py +++ b/cenhomes_student/__manifest__.py @@ -31,7 +31,7 @@ # "views/nhom_nganh/view_danh_muc_hoc_vien_co_nguyen_vong_nganh5.xml", # "views/nhom_nganh/view_danh_muc_hoc_vien_co_nguyen_vong_nganh6.xml", # "views/nhom_nganh/view_danh_muc_hoc_vien_co_nguyen_vong_nganh7.xml", - # "views/hoc_vien/views_hoc_vien.xml", + "views/hoc_vien/views_hoc_vien.xml", "views/hoc_vien/views_bao_luu.xml", "views/hoc_vien/views_ban_giao_hoc_vien.xml", "views/views_co_so.xml", diff --git a/cenhomes_student/static/src/components/copy_link_form/copy_link_form.js b/cenhomes_student/static/src/components/copy_link_form/copy_link_form.js index 79b9476..eed3c84 100644 --- a/cenhomes_student/static/src/components/copy_link_form/copy_link_form.js +++ b/cenhomes_student/static/src/components/copy_link_form/copy_link_form.js @@ -1,13 +1,13 @@ /** @odoo-module **/ -import {_lt} from "@web/core/l10n/translation"; -import {registry} from "@web/core/registry"; -import {listView} from "@web/views/list/list_view"; -import {ListRenderer} from "@web/views/list/list_renderer"; -import {ListController} from "@web/views/list/list_controller"; -import {Component, useState} from "@odoo/owl"; +import { _lt } from "@web/core/l10n/translation"; +import { registry } from "@web/core/registry"; +import { listView } from "@web/views/list/list_view"; +import { ListRenderer } from "@web/views/list/list_renderer"; +import { ListController } from "@web/views/list/list_controller"; +import { Component, useState } from "@odoo/owl"; import { useService } from "@web/core/utils/hooks"; - +import { session } from "@web/session"; export class CenhomesComponent extends Component { setup() { @@ -15,7 +15,7 @@ export class CenhomesComponent extends Component { } async copyLinkForm() { - const session = require("web.session"); + const phong_thu_tuc = await session.user_has_group('cenhomes_student.group_cenhomes_phong_thu_tuc') let urlForm = window.location.origin + '/cenhomes/hoc_vien_phong_thu_tuc/'; if (!phong_thu_tuc) { diff --git a/cenhomes_student/views/co_so_vat_chat/views_ky_tuc_xa.xml b/cenhomes_student/views/co_so_vat_chat/views_ky_tuc_xa.xml index 1e8bd19..73b079b 100644 --- a/cenhomes_student/views/co_so_vat_chat/views_ky_tuc_xa.xml +++ b/cenhomes_student/views/co_so_vat_chat/views_ky_tuc_xa.xml @@ -1,14 +1,14 @@ - - cenhomes.ky_tuc_xa.tree + + cenhomes.ky_tuc_xa.list cenhomes.ky_tuc_xa - + - + @@ -44,6 +44,6 @@ Ký túc xá ir.actions.act_window cenhomes.ky_tuc_xa - tree,form + list,form \ No newline at end of file diff --git a/cenhomes_student/views/doi_tac/views_quan_he_doi_tac_hoc_vien.xml b/cenhomes_student/views/doi_tac/views_quan_he_doi_tac_hoc_vien.xml index fb7b28b..197f8c3 100644 --- a/cenhomes_student/views/doi_tac/views_quan_he_doi_tac_hoc_vien.xml +++ b/cenhomes_student/views/doi_tac/views_quan_he_doi_tac_hoc_vien.xml @@ -1,3 +1,4 @@ + cenhomes.quan_he_hoc_vien_doi_tac.list @@ -11,10 +12,8 @@ - - + - cenhomes.quan_he_hoc_vien_doi_tac.form cenhomes.quan_he_hoc_vien_doi_tac @@ -23,11 +22,11 @@ - - - - - + + + + + @@ -98,15 +97,12 @@ - - + - Quan hệ đối tác - học viên ir.actions.act_window cenhomes.quan_he_hoc_vien_doi_tac list,form - - \ No newline at end of file + diff --git a/cenhomes_student/views/hoc_tap/views_kiem_tra_bai_cu.xml b/cenhomes_student/views/hoc_tap/views_kiem_tra_bai_cu.xml index cd6a79f..705dfb1 100644 --- a/cenhomes_student/views/hoc_tap/views_kiem_tra_bai_cu.xml +++ b/cenhomes_student/views/hoc_tap/views_kiem_tra_bai_cu.xml @@ -1,3 +1,4 @@ + cenhomes.kiem_tra_bai_cu.list @@ -9,10 +10,8 @@ - - + - cenhomes.kiem_tra_bai_cu.search cenhomes.kiem_tra_bai_cu @@ -21,10 +20,8 @@ - - + - cenhomes.kiem_tra_bai_cu.form cenhomes.kiem_tra_bai_cu @@ -39,17 +36,15 @@ - + - - + - Kiểm tra bài cũ ir.actions.act_window cenhomes.kiem_tra_bai_cu list,form - \ No newline at end of file + diff --git a/cenhomes_student/views/hoc_vien/views_hoc_vien.xml b/cenhomes_student/views/hoc_vien/views_hoc_vien.xml index 00ccbc6..08d0d71 100644 --- a/cenhomes_student/views/hoc_vien/views_hoc_vien.xml +++ b/cenhomes_student/views/hoc_vien/views_hoc_vien.xml @@ -1,3 +1,4 @@ + cenhomes.hoc_vien.list @@ -10,11 +11,9 @@ - - - + + - cenhomes.hoc_vien.search cenhomes.hoc_vien @@ -26,20 +25,18 @@ - - + + - - + + - - + - cenhomes.hoc_vien.form cenhomes.hoc_vien @@ -47,13 +44,13 @@
-
- - + + - + @@ -61,19 +58,19 @@ - + - - - - + + + + - - - - + + + + @@ -104,10 +101,10 @@ - + - + @@ -118,18 +115,17 @@ - - - - - - + + + + + + - - + - + @@ -139,27 +135,26 @@
- - - - - + + + + + -
-
+
- - - - - - - - + + + + + + + + @@ -168,12 +163,12 @@ - +
- + @@ -205,11 +200,10 @@ - - + - + @@ -221,19 +215,18 @@
- - + + -
-
+
- + @@ -246,8 +239,8 @@
- - + + @@ -255,11 +248,10 @@ -
-
+
- + @@ -270,18 +262,17 @@
- - + + -
-
+
- + @@ -291,11 +282,10 @@ - - + - + @@ -305,11 +295,10 @@ - - + - + @@ -321,11 +310,10 @@ - - + - + @@ -336,8 +324,8 @@
- - + + @@ -353,11 +341,10 @@ -
-
+
- + @@ -369,12 +356,10 @@ - - + - - + @@ -390,13 +375,10 @@ - - - + - - + @@ -413,15 +395,13 @@ - - + - - + -