1156 lines
47 KiB
Python
1156 lines
47 KiB
Python
import re
|
|
from datetime import datetime
|
|
from odoo.tools import get_lang
|
|
|
|
from odoo import models, fields, api, _, http
|
|
from odoo.exceptions import ValidationError, MissingError
|
|
from .models_constants import BaoLuu, Common
|
|
|
|
|
|
class CenhomesHocVien(models.Model):
|
|
_name = "cenhomes.hoc_vien"
|
|
_description = "DUHOCKEP học viên"
|
|
_sql_constraints = [
|
|
("email_unique", "unique(email)", "Email đã tồn tại trong hệ thống!"),
|
|
(
|
|
"ma_ho_so_unique",
|
|
"unique(ma_ho_so)",
|
|
"Mã học viên đã tồn tại trong hệ thống!",
|
|
),
|
|
]
|
|
_base_path_url = "cenhomes/du_hoc_kep/hoc_vien"
|
|
|
|
stt = fields.Char(string="STT")
|
|
don_du_tuyen = fields.Char(string="Đơn dự tuyển")
|
|
ngay_tao_ho_so = fields.Date(string="Ngày tạo hồ sơ")
|
|
nguoi_tao_ho_so = fields.Char(string="Người tạo hồ sơ")
|
|
ngay_cap_nhat_lan_cuoi = fields.Date(string="Ngày cập nhật lần cuối")
|
|
nguoi_cap_nhat_lan_cuoi = fields.Char(string="Người cập nhật lần cuối")
|
|
ma_ho_so = fields.Char(string="Mã hồ sơ", required=True)
|
|
mshv = fields.Char(string="Mã số học viên", required=False)
|
|
khoa = fields.Char(string="Khóa")
|
|
|
|
ten = fields.Char(string="Tên", required=True)
|
|
ho = fields.Char(string="Họ", required=True)
|
|
dia_chi_thuong_tru = fields.Char(string="Địa chỉ thường trú")
|
|
que_quan = fields.Char(string="Quê quán")
|
|
so_dien_thoai_lien_he = fields.Char(string="Số điện thoại liên hệ")
|
|
so_dien_thoai_lien_he_hidden = fields.Char(
|
|
string="Số điện thoại liên hệ", compute="_compute_hidden_phone"
|
|
)
|
|
so_dien_thoai_khan_cap = fields.Char(string="Số điện thoại khẩn cấp")
|
|
email = fields.Char(string="Địa chỉ Email", required=True)
|
|
email_hidden = fields.Char(
|
|
string="Địa chỉ Email", required=True, compute="_compute_hidden_email"
|
|
)
|
|
|
|
gioi_tinh = fields.Selection(
|
|
string="Giới tính",
|
|
selection=[("male", "Nam"), ("female", "Nữ"), ("other", "Khác")],
|
|
)
|
|
ngay_thang_nam_sinh = fields.Date(string="Ngày sinh")
|
|
quoc_tich = fields.Char(string="Quốc tịch")
|
|
cccd = fields.Char(string="Số CCCD")
|
|
cccd_ngay_cap = fields.Date(string="Ngày cấp CCCD")
|
|
cccd_noi_cap = fields.Char(string="Nơi cấp CCCD")
|
|
|
|
anh_cccd_mat_truoc = fields.Binary(string="Ảnh CCCD mặt trước")
|
|
anh_cccd_mat_sau = fields.Binary(string="Ảnh CCCD mặt sau")
|
|
anh_profile = fields.Binary(string="Ảnh profile")
|
|
|
|
thong_tin_phu_huynhs = fields.One2many(
|
|
comodel_name="cenhomes.thong_tin_phu_huynh",
|
|
inverse_name="hoc_vien_id",
|
|
string="Thông tin phụ huynh",
|
|
)
|
|
lich_su_cham_socs = fields.One2many(
|
|
comodel_name="cenhomes.lich_su_cham_soc",
|
|
inverse_name="hoc_vien_id",
|
|
string="Lịch sử chăm sóc học viên",
|
|
)
|
|
thong_tin_giao_ducs = fields.One2many(
|
|
comodel_name="cenhomes.thong_tin_giao_duc",
|
|
inverse_name="hoc_vien_id",
|
|
string="Thông tin giáo dục / đào tạo",
|
|
)
|
|
kinh_nghiem_lam_viecs = fields.One2many(
|
|
comodel_name="cenhomes.kinh_nghiem_lam_viec",
|
|
inverse_name="hoc_vien_id",
|
|
string="Thông tin kinh nghiệm làm việc",
|
|
)
|
|
ky_nang_ngon_ngus = fields.One2many(
|
|
comodel_name="cenhomes.ky_nang_ngon_ngu",
|
|
inverse_name="hoc_vien_id",
|
|
string="Thông tin kỹ năng ngôn ngữ",
|
|
)
|
|
ky_nang_tin_hocs = fields.One2many(
|
|
comodel_name="cenhomes.ky_nang_tin_hoc",
|
|
inverse_name="hoc_vien_id",
|
|
string="Thông tin kỹ năng tin học",
|
|
)
|
|
ky_nang_khacs = fields.One2many(
|
|
comodel_name="cenhomes.ky_nang_khac",
|
|
inverse_name="hoc_vien_id",
|
|
string="Thông tin kỹ năng khác",
|
|
)
|
|
so_thich = fields.Char(string="Sở thích")
|
|
cac_hoat_dong_khac = fields.Text(string="Các hoạt động khác")
|
|
nguoi_than_tai_duc = fields.Char(
|
|
string="Bạn có người nhà / người thân bên CHLB Đức không? (Nếu có thì ở đâu?)"
|
|
)
|
|
tinh_trang_hon_nhan = fields.Char(
|
|
string="Tình trạng hôn nhân",
|
|
help="Tình trạng hôn nhân, anh chị em ruột, con ruột",
|
|
)
|
|
nguyen_vong_sinh_song_tai_duc = fields.Char(
|
|
string="Bạn có nguyện vọng sinh sống tại đâu ở CHLB Đức?"
|
|
)
|
|
nhom_nganh_muon_hoc = fields.Many2one(
|
|
comodel_name="cenhomes.nhom_nganh", string="Nhóm ngành"
|
|
)
|
|
nganh_nghe_muon_hoc = fields.Many2one(
|
|
comodel_name="cenhomes.chuyen_nganh",
|
|
string="Nguyện vọng ngành",
|
|
domain="[('nhom_nganh', '=', nhom_nganh_muon_hoc)]",
|
|
)
|
|
nghe_nghiep = fields.Char(string="Nguyện vọng ngành")
|
|
nhom_nganh_muon_hoc_2 = fields.Many2one(
|
|
comodel_name="cenhomes.nhom_nganh", string="Nhóm ngành 2"
|
|
)
|
|
nganh_nghe_muon_hoc_2 = fields.Many2one(
|
|
comodel_name="cenhomes.chuyen_nganh",
|
|
string="Nguyện vọng ngành 2",
|
|
domain="[('nhom_nganh', '=', nhom_nganh_muon_hoc_2)]",
|
|
)
|
|
nghe_nghiep_2 = fields.Char(string="Nguyện vọng ngành")
|
|
linh_vuc_muon_phat_trien = fields.Char(
|
|
string="Bạn muốn phát triển sự nghiệp trong lĩnh vực gì?"
|
|
)
|
|
|
|
lich_su_update_ho_so = fields.One2many(
|
|
comodel_name="cenhomes.lich_su_ho_so",
|
|
inverse_name="hoc_vien_id",
|
|
string="Thông tin lịch sử Update hồ sơ",
|
|
)
|
|
|
|
trang_thai_ho_so = fields.Char(string="Trạng thái hồ sơ hiện có")
|
|
|
|
trang_thai_dao_tao = fields.Char(string="Trạng thái đào tạo")
|
|
ngay_cap_nhat_trang_thai_dao_tao = fields.Date(
|
|
string="Ngày cập nhật trạng thái Đào tạo lần cuối"
|
|
)
|
|
lop_hoc_ids = fields.Many2many(
|
|
comodel_name="cenhomes.lop_hoc",
|
|
relation="cenhomes_hoc_vien_lop_hoc_rel",
|
|
column1="hoc_vien_id",
|
|
column2="lop_hoc_id",
|
|
string="Lớp học",
|
|
)
|
|
lich_su_dao_taos = fields.One2many(
|
|
comodel_name="cenhomes.lich_su_dao_tao",
|
|
inverse_name="hoc_vien_id",
|
|
string="Lịch sử đào tạo",
|
|
)
|
|
ho_so_chung_chis = fields.One2many(
|
|
comodel_name="cenhomes.chung_chi",
|
|
inverse_name="hoc_vien_id",
|
|
string="Hồ sơ chứng chỉ",
|
|
)
|
|
chuong_trinh_tham_gias = fields.One2many(
|
|
comodel_name="cenhomes.chuong_trinh_tham_gia",
|
|
inverse_name="hoc_vien_id",
|
|
string="Chương trình tham gia",
|
|
)
|
|
tinh_trang_ho_so_visas = fields.One2many(
|
|
comodel_name="cenhomes.ho_so_visa",
|
|
inverse_name="hoc_vien_id",
|
|
string="Hồ sơ visa",
|
|
)
|
|
files = fields.Many2many(comodel_name="ir.attachment", string="")
|
|
thu_dong_lucs = fields.One2many(
|
|
comodel_name="cenhomes.thu_dong_luc",
|
|
inverse_name="hoc_vien_id",
|
|
string="Thư động lực",
|
|
)
|
|
trang_thai_nhap_lieu = fields.Boolean(string="Trạng thái nhập liệu")
|
|
trang_thai_chung = fields.Selection(
|
|
string="Trạng thái chung",
|
|
selection=[
|
|
("can_bo_sung", "Cẩn bổ sung"),
|
|
("day_du_ho_so", "Đầy đủ hồ sơ"),
|
|
("duoc_tiep_nhan", "Được tiếp nhận"),
|
|
("chua_duoc_tiep_nhan", "Chưa được tiếp nhận"),
|
|
("dang_lam_thu_tuc_va_dao_tao", "Đang làm thủ tục và đào tạo"),
|
|
(
|
|
"hoan_thanh_thu_tuc_va_dao_tao_tai_vn",
|
|
"Hoàn thành thủ tục và đào tạo tại VN",
|
|
),
|
|
("da_trao_visa", "Đã trao visa"),
|
|
("da_bay", "Đã bay"),
|
|
("da_tiep_nhan_tai_duc", "Đã tiếp nhận học viên tại Đức"),
|
|
],
|
|
)
|
|
dia_diem_gui_cv = fields.Char(string="Nơi gửi CV")
|
|
link_ho_so = fields.Char(string="Link hồ sơ")
|
|
trinh_do_tieng_duc = fields.Char(
|
|
string="Trình độ tiếng Đức", compute="_compute_trinh_do_tieng_duc"
|
|
)
|
|
trang_thai_cv = fields.Selection(
|
|
string="Trạng thái CV",
|
|
selection=[("chua_dat", "Chưa đạt"), ("dat", "Đạt yêu cầu")],
|
|
default="chua_dat",
|
|
)
|
|
trang_thai_thu_dong_luc = fields.Selection(
|
|
string="Trạng thái Thư động lực",
|
|
selection=[("chua_dat", "Chưa đạt"), ("dat", "Đạt yêu cầu")],
|
|
default="chua_dat",
|
|
)
|
|
trang_thai_video_gioi_thieu_ban_than = fields.Selection(
|
|
string="Trạng thái Video giới thiệu bản thân",
|
|
selection=[("chua_dat", "Chưa đạt"), ("dat", "Đạt yêu cầu")],
|
|
default="chua_dat",
|
|
)
|
|
tuoi = fields.Char(string="Tuổi", compute="_compute_tuoi")
|
|
do_uu_tien = fields.Integer(
|
|
string="Độ ưu tiên",
|
|
help="Độ ưu tiên càng cao thì thứ tự trên danh sách càng trên đầu",
|
|
default=0,
|
|
)
|
|
quan_he_hoc_vien_doi_tacs = fields.One2many(
|
|
comodel_name="cenhomes.quan_he_hoc_vien_doi_tac",
|
|
inverse_name="hoc_vien_id",
|
|
string="Quan hệ học viên - đối tác",
|
|
)
|
|
|
|
def _compute_trinh_do_tieng_duc(self):
|
|
for session in self:
|
|
x = ""
|
|
for s in session.ky_nang_ngon_ngus:
|
|
if s.loai_ngon_ngu == "german":
|
|
x = s.loai_bang
|
|
session.trinh_do_tieng_duc = x
|
|
|
|
def _compute_hidden_phone(self):
|
|
for record in self:
|
|
original_value = record.so_dien_thoai_lien_he
|
|
if original_value and len(original_value) > 5:
|
|
record.so_dien_thoai_lien_he_hidden = original_value[:5] + "*" * min(
|
|
15, len(original_value) - 5
|
|
)
|
|
else:
|
|
record.so_dien_thoai_lien_he_hidden = original_value
|
|
|
|
def _compute_hidden_email(self):
|
|
for record in self:
|
|
original_value = record.email
|
|
if original_value and len(original_value) > 5:
|
|
record.email_hidden = original_value[:5] + "*" * min(
|
|
15, len(original_value) - 5
|
|
)
|
|
else:
|
|
record.email_hidden = original_value
|
|
|
|
def _compute_tuoi(self):
|
|
for session in self:
|
|
session.tuoi = (
|
|
datetime.now().year - session.ngay_thang_nam_sinh.year
|
|
if session.ngay_thang_nam_sinh
|
|
else False
|
|
)
|
|
|
|
@api.constrains("email")
|
|
def _check_valid_email(self):
|
|
regex = r"\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,7}\b"
|
|
if not re.fullmatch(regex, self.email):
|
|
raise ValidationError(_("Email không đúng định dạng"))
|
|
|
|
hocviens = self.search([]) - self
|
|
value = [x.email.lower() for x in hocviens]
|
|
if self.email and self.email.lower() in value:
|
|
raise ValidationError(_("Email đã tồn tại"))
|
|
return True
|
|
|
|
@api.constrains("ma_ho_so")
|
|
def _check_valid_ma_ho_so(self):
|
|
hocviens = self.search([]) - self
|
|
value = [x.ma_ho_so.lower() for x in hocviens]
|
|
if self.ma_ho_so and self.ma_ho_so.lower() in value:
|
|
raise ValidationError(_("Mã học viên đã tồn tại"))
|
|
return True
|
|
|
|
def action_view_huong_dan_anh_so_yeu_ly_lich(self):
|
|
record_url = f"{self._base_path_url}/huong_dan_anh_so_yeu_ly_lich"
|
|
|
|
client_action = {
|
|
"type": "ir.actions.act_url",
|
|
"name": "Hướng dẫn về ảnh chụp sơ yếu lý lịch",
|
|
"target": "new",
|
|
"url": record_url,
|
|
}
|
|
return client_action
|
|
|
|
def action_view_cv(self):
|
|
record_url = f"{self._base_path_url}/cv/{self.id}"
|
|
client_action = {
|
|
"type": "ir.actions.act_url",
|
|
"name": "CV",
|
|
"target": "new",
|
|
"url": record_url,
|
|
}
|
|
return client_action
|
|
|
|
def action_redirect_link_ho_so(self):
|
|
client_action = {
|
|
"type": "ir.actions.act_url",
|
|
"name": "Link hồ sơ",
|
|
"target": "new",
|
|
"url": self.link_ho_so,
|
|
}
|
|
return client_action
|
|
|
|
def write(self, vals):
|
|
if "trang_thai_nhap_lieu" not in vals:
|
|
vals["trang_thai_nhap_lieu"] = False
|
|
# for field1, field2, s1, s2 in [
|
|
# ('nganh_nghe_muon_hoc', 'nhom_nganh_muon_hoc', self.nganh_nghe_muon_hoc, self.nhom_nganh_muon_hoc),
|
|
# ('nganh_nghe_muon_hoc_2', 'nhom_nganh_muon_hoc_2', self.nganh_nghe_muon_hoc_2, self.nhom_nganh_muon_hoc_2)]:
|
|
# if field1 in vals or s1:
|
|
# if not s1 and field2 not in vals:
|
|
# raise ValidationError(_('Điền đủ trường nhóm ngành khi chọn chuyên ngành'))
|
|
# nganh_nghe_muon_hoc = vals[field1] if vals.get(field1) else s1.id
|
|
# nhom_nganh = vals[field2] if vals.get(field2) else s2.id
|
|
# nhom_nganh_muon_hoc = self.env['cenhomes.chuyen_nganh'].search([
|
|
# ('id', '=', nganh_nghe_muon_hoc)
|
|
# ])[0].nhom_nganh.id
|
|
#
|
|
# if nhom_nganh != nhom_nganh_muon_hoc:
|
|
# raise ValidationError(_('Chuyên ngành đã chọn không thuộc nhóm ngành đã chọn'))
|
|
if len(vals.keys()) == 0:
|
|
return
|
|
return super().write(vals)
|
|
|
|
def read(self, fields=None, load="_classic_read"):
|
|
res = None
|
|
args = http.request.params.get("args")
|
|
if not args or not isinstance(args[0][0], int):
|
|
kwargs = http.request.params.get("kwargs")
|
|
if kwargs:
|
|
nganh_nghe_muon_hoc = kwargs.get("context").get(
|
|
"sort_nganh_nghe_muon_hoc"
|
|
)
|
|
offset = kwargs.get("offset")
|
|
if nganh_nghe_muon_hoc:
|
|
nhom_nganh = self.env["cenhomes.nhom_nganh"].search(
|
|
[("menu", "=", str(nganh_nghe_muon_hoc))]
|
|
)
|
|
if nhom_nganh:
|
|
nganh_nghe_muon_hoc_id = [x.id for x in nhom_nganh]
|
|
res = super().search(
|
|
[
|
|
"|",
|
|
("nhom_nganh_muon_hoc", "in", nganh_nghe_muon_hoc_id),
|
|
("nhom_nganh_muon_hoc_2", "in", nganh_nghe_muon_hoc_id),
|
|
],
|
|
order="do_uu_tien desc",
|
|
)
|
|
if offset < len(res):
|
|
res += super().search(
|
|
[
|
|
"&",
|
|
(
|
|
"nhom_nganh_muon_hoc",
|
|
"not in",
|
|
nganh_nghe_muon_hoc_id,
|
|
),
|
|
(
|
|
"nhom_nganh_muon_hoc_2",
|
|
"not in",
|
|
nganh_nghe_muon_hoc_id,
|
|
),
|
|
],
|
|
)
|
|
else:
|
|
res = super().search(
|
|
[
|
|
"&",
|
|
(
|
|
"nhom_nganh_muon_hoc",
|
|
"not in",
|
|
nganh_nghe_muon_hoc_id,
|
|
),
|
|
(
|
|
"nhom_nganh_muon_hoc_2",
|
|
"not in",
|
|
nganh_nghe_muon_hoc_id,
|
|
),
|
|
],
|
|
offset=offset - len(res),
|
|
)
|
|
|
|
def valid(fname):
|
|
"""determine whether user has access to field ``fname``"""
|
|
field = self._fields.get(fname)
|
|
if field and field.groups:
|
|
return self.user_has_groups(field.groups)
|
|
else:
|
|
return True
|
|
|
|
if not fields:
|
|
fields = [name for name in self._fields if valid(name)]
|
|
|
|
data = [(record, {"id": record._ids[0]}) for record in res]
|
|
use_name_get = load == "_classic_read"
|
|
for name in fields:
|
|
convert = res._fields[name].convert_to_read
|
|
for record, vals in data:
|
|
# missing records have their vals empty
|
|
if not vals:
|
|
continue
|
|
try:
|
|
vals[name] = convert(
|
|
record[name], record, use_name_get
|
|
)
|
|
except MissingError:
|
|
vals.clear()
|
|
res = [vals for record, vals in data if vals]
|
|
if res is None:
|
|
res = super(CenhomesHocVien, self).read(fields=fields, load=load)
|
|
return res
|
|
|
|
def name_get(self):
|
|
return [(record.id, record.ten) for record in self]
|
|
|
|
@api.model
|
|
def search_read(
|
|
self, domain=None, fields=None, offset=0, limit=None, order=None, **read_kwargs
|
|
):
|
|
"""Perform a :meth:`search` followed by a :meth:`read`.
|
|
|
|
:param domain: Search domain, see ``args`` parameter in :meth:`search`.
|
|
Defaults to an empty domain that will match all records.
|
|
:param fields: List of fields to read, see ``fields`` parameter in :meth:`read`.
|
|
Defaults to all fields.
|
|
:param int offset: Number of records to skip, see ``offset`` parameter in :meth:`search`.
|
|
Defaults to 0.
|
|
:param int limit: Maximum number of records to return, see ``limit`` parameter in :meth:`search`.
|
|
Defaults to no limit.
|
|
:param order: Columns to sort result, see ``order`` parameter in :meth:`search`.
|
|
Defaults to no sort.
|
|
:param read_kwargs: All read keywords arguments used to call
|
|
``read(..., **read_kwargs)`` method e.g. you can use
|
|
``search_read(..., load='')`` in order to avoid computing name_get
|
|
:return: List of dictionaries containing the asked fields.
|
|
:rtype: list(dict).
|
|
"""
|
|
records = self.search(domain or [], offset=offset, limit=limit, order=order)
|
|
if not records:
|
|
return []
|
|
|
|
if fields and fields == ["id"]:
|
|
# shortcut read if we only want the ids
|
|
return [{"id": record.id} for record in records]
|
|
|
|
# read() ignores active_test, but it would forward it to any downstream search call
|
|
# (e.g. for x2m or function fields), and this is not the desired behavior, the flag
|
|
# was presumably only meant for the main search().
|
|
# TODO: Move this to read() directly?
|
|
if "active_test" in self._context:
|
|
context = dict(self._context)
|
|
del context["active_test"]
|
|
records = records.with_context(context)
|
|
|
|
result = records.read(fields, **read_kwargs)
|
|
if len(result) <= 1:
|
|
return result
|
|
|
|
args = http.request.params.get("args")
|
|
if not args or not isinstance(args[0][0], int):
|
|
kwargs = http.request.params.get("kwargs")
|
|
if kwargs:
|
|
nganh_nghe_muon_hoc = kwargs.get("context").get(
|
|
"sort_nganh_nghe_muon_hoc"
|
|
)
|
|
if nganh_nghe_muon_hoc:
|
|
return result
|
|
|
|
# reorder read
|
|
index = {vals["id"]: vals for vals in result}
|
|
return [index[record.id] for record in records if record.id in index]
|
|
|
|
|
|
class CenhomesThongTinGiaoDuc(models.Model):
|
|
_name = "cenhomes.thong_tin_giao_duc"
|
|
_description = "Thông tin giáo dục / đào tạo của học viên"
|
|
|
|
@api.model
|
|
def _check_valid_object(self):
|
|
if self.loai_bang_cap not in ["high_school", "middle_school", "primary_school"]:
|
|
if (
|
|
self.diem_thi is None
|
|
or self.diem_thi.strip() == ""
|
|
or self.chuyen_nganh is None
|
|
or self.chuyen_nganh.strip() == ""
|
|
):
|
|
raise ValidationError(
|
|
_(
|
|
"Trung cấp/Cao đẳng/Đại học/Cao học yêu cầu nhập điểm và chuyên ngành"
|
|
)
|
|
)
|
|
return True
|
|
|
|
_constraints = [
|
|
(
|
|
_check_valid_object,
|
|
"Trung cấp/Cao đẳng/Đại học/Cao học yêu cầu nhập điểm và chuyên ngành",
|
|
[""],
|
|
)
|
|
]
|
|
|
|
hoc_vien_id = fields.Many2one(comodel_name="cenhomes.hoc_vien", string="Học viên")
|
|
loai_bang_cap = fields.Selection(
|
|
string="Loại bằng cấp",
|
|
selection=[
|
|
("primary_school", "Tiểu học"),
|
|
("middle_school", "THCS"),
|
|
("high_school", "THPT"),
|
|
("intermediate_school", "Trung cấp"),
|
|
("college", "Cao đẳng"),
|
|
("university", "Đại học"),
|
|
("postgraduate", "Cao học"),
|
|
],
|
|
)
|
|
ten_co_so_giao_duc = fields.Char(string="Tên cơ sở giáo dục")
|
|
dia_diem = fields.Char(string="Địa điểm (Nhập Quận/Huyện, Thành phố, Đất nước)")
|
|
chuyen_nganh = fields.Char(string="Chuyên ngành")
|
|
diem_thi = fields.Char(string="Điểm thi")
|
|
thoi_gian_tu = fields.Char(string="Bắt đầu")
|
|
thoi_gian_den = fields.Char(string="Kết thúc")
|
|
|
|
|
|
class CenhomesThongTinPhuHuynh(models.Model):
|
|
_name = "cenhomes.thong_tin_phu_huynh"
|
|
_description = "Thông tin phụ huynh của học viên"
|
|
|
|
hoc_vien_id = fields.Many2one(
|
|
comodel_name="cenhomes.hoc_vien", string="Học viên", ondelete="cascade"
|
|
)
|
|
ten_phu_huynh = fields.Char(
|
|
string="Tên phụ huynh", required=True, help="Tên đầy đủ của phụ huynh."
|
|
)
|
|
moi_quan_he = fields.Selection(
|
|
string="Mối quan hệ",
|
|
selection=[
|
|
("father", "Cha"),
|
|
("mother", "Mẹ"),
|
|
("guardian", "Người giám hộ"),
|
|
("other", "Khác"),
|
|
],
|
|
required=True,
|
|
help="Mối quan hệ của phụ huynh với học viên.",
|
|
)
|
|
so_dien_thoai = fields.Char(
|
|
string="Số điện thoại",
|
|
required=True,
|
|
help="Số điện thoại liên hệ của phụ huynh.",
|
|
)
|
|
email = fields.Char(string="Email", help="Email liên lạc của phụ huynh.")
|
|
dia_chi = fields.Text(string="Địa chỉ", help="Địa chỉ của phụ huynh.")
|
|
ghi_chu = fields.Text(string="Ghi chú", help="Các ghi chú bổ sung về phụ huynh.")
|
|
|
|
# @api.constrains("email")
|
|
# def _check_valid_email(self):
|
|
# regex = r"\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,7}\b"
|
|
# if not re.fullmatch(regex, self.email):
|
|
# raise ValidationError(_("Email không đúng định dạng"))
|
|
# return True
|
|
|
|
|
|
class CenhomesLichSuChamSoc(models.Model):
|
|
_name = "cenhomes.lich_su_cham_soc"
|
|
_description = "Lịch sử chăm sóc học viên"
|
|
|
|
hoc_vien_id = fields.Many2one(
|
|
comodel_name="cenhomes.hoc_vien",
|
|
string="Học viên",
|
|
required=True,
|
|
ondelete="cascade",
|
|
)
|
|
ngay_cham_soc = fields.Char(
|
|
string="Ngày chăm sóc",
|
|
)
|
|
noi_dung = fields.Text(string="Nội dung chăm sóc", required=True)
|
|
danh_gia = fields.Selection(string="Đánh giá", selection=Common._priority_list)
|
|
ket_qua = fields.Selection(
|
|
string="Kết quả chăm sóc",
|
|
required=True,
|
|
selection=[("success", "Đạt"), ("failure", "Chưa đạt")],
|
|
)
|
|
ghi_chu = fields.Text(string="Ghi chú")
|
|
|
|
|
|
class CenhomesKinhNghiemLamViec(models.Model):
|
|
_name = "cenhomes.kinh_nghiem_lam_viec"
|
|
_description = "Thông tin kinh nghiệm làm việc"
|
|
|
|
hoc_vien_id = fields.Many2one(comodel_name="cenhomes.hoc_vien", string="Học viên")
|
|
thoi_gian_tu = fields.Char(string="Bắt đầu")
|
|
thoi_gian_den = fields.Char(string="Kết thúc")
|
|
vi_tri_lam_viec = fields.Char(string="Vị trí làm việc")
|
|
ten_cong_ty = fields.Char(string="Tên công ty")
|
|
website_cong_ty = fields.Char(string="Website công ty")
|
|
dia_diem_lam_viec = fields.Char(
|
|
string="Địa điểm làm việc (Nhập Thành phố, Đất nước)"
|
|
)
|
|
cong_viec_chinh = fields.Text(string="Công việc chính")
|
|
ket_qua_dat_duoc = fields.Char(string="Kết quả đạt được")
|
|
|
|
|
|
class CenhomesKyNangNgonNgu(models.Model):
|
|
_name = "cenhomes.ky_nang_ngon_ngu"
|
|
_description = "Thông tin kỹ năng ngôn ngữ"
|
|
|
|
hoc_vien_id = fields.Many2one(comodel_name="cenhomes.hoc_vien", string="Học viên")
|
|
thoi_gian_tu = fields.Char(string="Bắt đầu")
|
|
thoi_gian_den = fields.Char(string="Kết thúc")
|
|
|
|
loai_ngon_ngu = fields.Selection(
|
|
string="Loại ngôn ngữ",
|
|
selection=[
|
|
("english", "Tiếng Anh"),
|
|
("german", "Tiếng Đức"),
|
|
("french", "Tiếng Pháp"),
|
|
("chinese", "Tiếng Trung"),
|
|
("spanish", "Tiếng Tây Ban Nha"),
|
|
("vietnamese", "Tiếng Việt"),
|
|
("japanese", "Tiếng Nhật Bản"),
|
|
("korean", "Tiếng Hàn Quốc"),
|
|
("portuguese", "Tiếng Bồ Đào Nha"),
|
|
("arabic", "Tiếng Ả Rập"),
|
|
("hindi", "Tiếng Hindi"),
|
|
("bengali", "Tiếng Bengali"),
|
|
("lang_other", "Khác"),
|
|
],
|
|
)
|
|
trinh_do = fields.Char(string="Trình độ")
|
|
loai_bang = fields.Char(string="Loại bằng")
|
|
to_chuc_cap = fields.Char(string="Tổ chức cấp")
|
|
|
|
|
|
class CenhomesKyNangTinHoc(models.Model):
|
|
_name = "cenhomes.ky_nang_tin_hoc"
|
|
_description = "Thông tin kỹ năng tin học"
|
|
|
|
hoc_vien_id = fields.Many2one(comodel_name="cenhomes.hoc_vien", string="Học viên")
|
|
ten_ky_nang = fields.Char(string="Tên kỹ năng")
|
|
mo_ta = fields.Text(string="Mô tả", help="Trình độ đạt được, bằng cấp (nếu có)")
|
|
|
|
|
|
class CenhomesKyNangKhac(models.Model):
|
|
_name = "cenhomes.ky_nang_khac"
|
|
_description = "Thông tin kỹ năng khác"
|
|
|
|
hoc_vien_id = fields.Many2one(comodel_name="cenhomes.hoc_vien", string="Học viên")
|
|
ten_ky_nang = fields.Char(string="Tên kỹ năng")
|
|
mo_ta = fields.Text(string="Mô tả", help="Trình độ đạt được, bằng cấp (nếu có)")
|
|
|
|
|
|
class CenhomesLichSuHoSo(models.Model):
|
|
_name = "cenhomes.lich_su_ho_so"
|
|
_description = "Lịch sử hồ sơ"
|
|
|
|
hoc_vien_id = fields.Many2one(comodel_name="cenhomes.hoc_vien", string="Học viên")
|
|
ngay_cap_nhat = fields.Date(string="Ngày cập nhật")
|
|
nguoi_cap_nhat = fields.Char(string="Người cập nhật")
|
|
ghi_chu = fields.Char(string="Ghi chú thông tin về hồ sơ")
|
|
|
|
|
|
class CenhomesLichSuDaoTao(models.Model):
|
|
_name = "cenhomes.lich_su_dao_tao"
|
|
_description = "Lịch sử đào tạo"
|
|
|
|
hoc_vien_id = fields.Many2one(comodel_name="cenhomes.hoc_vien", string="Học viên")
|
|
thoi_gian_tu = fields.Char(string="Bắt đầu")
|
|
thoi_gian_den = fields.Char(string="Kết thúc")
|
|
|
|
level_bat_dau_tham_gia = fields.Selection(
|
|
string="Level khi bắt đầu tham gia học",
|
|
selection=[("A1", "A1"), ("A2", "A2"), ("A3", "A3")],
|
|
)
|
|
loai_hinh_hoc = fields.Selection(
|
|
string="Loại hình học",
|
|
selection=[
|
|
("Online", "Online"),
|
|
("Offline", "Offline"),
|
|
("edu_type_other", "Khác"),
|
|
],
|
|
)
|
|
co_so_hoc = fields.Many2one(comodel_name="cenhomes.co_so", string="Cơ sở đào tạo")
|
|
khung_chuong_trinh = fields.Char(string="Khung chương trình")
|
|
ngay_dat_chung_chi_A1 = fields.Date(string="Ngày đạt chứng chỉ A1")
|
|
ngay_dat_chung_chi_A2 = fields.Date(string="Ngày đạt chứng chỉ A2")
|
|
ngay_dat_chung_chi_B1 = fields.Date(string="Ngày đạt chứng chỉ B1")
|
|
ngay_dat_chung_chi_B2 = fields.Date(string="Ngày đạt chứng chỉ B2")
|
|
horen = fields.Char(string="Horen")
|
|
lesen = fields.Char(string="Lesen")
|
|
schreiben = fields.Char(string="Schreiben")
|
|
sprechen = fields.Char(string="Sprechen")
|
|
gesamtpunkte = fields.Char(string="Gesamtpunkte")
|
|
gesamtpunkte_100 = fields.Char(string="Gesamtpunkte (100)")
|
|
|
|
|
|
class CenhomesChungChi(models.Model):
|
|
_name = "cenhomes.chung_chi"
|
|
_description = "Chứng chỉ"
|
|
|
|
hoc_vien_id = fields.Many2one(comodel_name="cenhomes.hoc_vien", string="Học viên")
|
|
ten_file = fields.Char(string="Tên file")
|
|
loai_file = fields.Selection(
|
|
string="Loại file",
|
|
selection=[
|
|
("word", "Word"),
|
|
("pdf", "PDF"),
|
|
("image", "Ảnh"),
|
|
("file_type_other", "khác"),
|
|
],
|
|
)
|
|
ngon_ngu_file = fields.Char(string="Ngôn ngữ file")
|
|
|
|
|
|
class CenhomesChuongTrinhThamGia(models.Model):
|
|
_name = "cenhomes.chuong_trinh_tham_gia"
|
|
_description = "Chương trình tham gia"
|
|
|
|
hoc_vien_id = fields.Many2one(comodel_name="cenhomes.hoc_vien", string="Học viên")
|
|
ten_chuong_trinh = fields.Char(string="Tên chương trình")
|
|
ky = fields.Char(string="Kỳ")
|
|
doi_tac = fields.Char(string="Đối tác")
|
|
ngay_dang_ky_tham_gia = fields.Date(string="Ngày đăng ký tham gia")
|
|
tinh_trang_ho_so = fields.Char(string="Tình trạng hồ sơ")
|
|
|
|
|
|
class CenhomesHoSoVisa(models.Model):
|
|
_name = "cenhomes.ho_so_visa"
|
|
_description = "Hồ sơ visa"
|
|
|
|
hoc_vien_id = fields.Many2one(comodel_name="cenhomes.hoc_vien", string="Học viên")
|
|
ngay_nop_visa = fields.Date(string="Ngày nộp visa")
|
|
tinh_trang_visa = fields.Char(string="Tình trạng visa")
|
|
ho_so_tai_lieu_check_list_xin_visa = fields.Char(
|
|
string="Hồ sơ tài liệu check list của 1 bộ Xin Visa"
|
|
)
|
|
ngay_duoc_duyet = fields.Date(string="Ngày được duyệt visa")
|
|
nguoi_thuc_hien = fields.Char(string="Người thực hiện")
|
|
ghi_chu_visa = fields.Char(string="Ghi chú")
|
|
|
|
|
|
class CenhomesThuDongLuc(models.Model):
|
|
_name = "cenhomes.thu_dong_luc"
|
|
_description = "Thư động lực"
|
|
_base_path_url = "cenhomes/du_hoc_kep/hoc_vien"
|
|
|
|
hoc_vien_id = fields.Many2one(comodel_name="cenhomes.hoc_vien", string="Học viên")
|
|
thu_dong_luc_ten = fields.Char(string="Tên thư động lực")
|
|
vi_tri_ung_tuyen = fields.Char(string="Vị trí ứng tuyển")
|
|
thu_dong_luc_phan_dau = fields.Text(
|
|
string="Lời chào và mở đầu",
|
|
help="""- Thông tin cá nhân cơ bản, những điều quan trọng nhất và nổi bật nhất mà ứng viên muốn viết về bản thân mình, ví dụ như kinh nghiệm làm việc, sơ qua công ty đã làm.
|
|
- Thông qua đâu biết tới tin phỏng vấn, chương trình chuyển đổi văn bằng và đã tìm hiểu công ty đó như thế nào (phần tìm hiểu công ty chỉ cần viết chung chung theo mẫu hướng dẫn, vì ứng viên có thể được phỏng vấn với nhiều doanh nghiệp cùng lúc. Như vậy ứng viên có thể sử dụng một bản thư động lực cho nhiều công ty)
|
|
- Chốt lại khẳng định thực sự muốn trở thành nhân viên của công ty đó.""",
|
|
)
|
|
|
|
thu_dong_luc_phan_chinh = fields.Text(
|
|
string="Phần chính",
|
|
help="""a) Quá trình học tập và làm việc
|
|
- Giới thiệu ngắn gọn về quá trình học tập và kinh nghiệm làm việc đã tích lũy
|
|
- Những thành tích đã có được trong quá trình làm việc
|
|
|
|
b) Tại sao lại là nước Đức để làm việc?
|
|
- Kể từ khi nào bạn có động lực, mục tiêu và ước mong muốn đến Đức?
|
|
- Tại sao bạn lại chọn Đức mà không phải một đất nước nào khác? Ví dụ: thích điều gì đó tại Đức, các điều bạn biết về nước Đức, gia đình, bạn bè, người thân, phúc lợi xã hội tốt, bảo hiểm …. như thế nào?
|
|
- Tại sao bạn lại lựa chọn đi theo diện công nhận văn bằng, mục tiêu của bạn khi tới Đức và trở thành một công nhân lành nghề?
|
|
|
|
c) Sở thích và các đáp ứng được cho yêu cầu từ nhà tuyển dụng
|
|
- Hãy nói về con người bản thân, ví dụ những kỹ năng bạn đã tích luỹ, sở thích thực sự liên quan tới ngành nghề mà bạn ứng tuyển.
|
|
- Các hoạt động thường ngày liên quan tới công việc.""",
|
|
)
|
|
|
|
thu_dong_luc_phan_cuoi = fields.Text(
|
|
string="Phần cuối",
|
|
help="""- Ước muốn được tham gia phỏng vấn
|
|
- Cảm ơn vì sự chú ý.""",
|
|
)
|
|
|
|
thu_dong_luc_ket_thu = fields.Text(string="Phần kết thư", help="""- Chữ ký.""")
|
|
|
|
def action_view_thu_dong_luc(self):
|
|
record_url = (
|
|
f"{self._base_path_url}/thu_dong_luc/{self.hoc_vien_id.id}/{self.id}"
|
|
)
|
|
client_action = {
|
|
"type": "ir.actions.act_url",
|
|
"name": "Thư động lực",
|
|
"target": "new",
|
|
"url": record_url,
|
|
}
|
|
return client_action
|
|
|
|
|
|
class CenhomesNhomNganh(models.Model):
|
|
_name = "cenhomes.nhom_nganh"
|
|
_description = "Nhóm ngành"
|
|
|
|
ten_nhom_nganh = fields.Char(string="Tên nhóm ngành", required=True, translate=True)
|
|
menu = fields.Selection(
|
|
string="menu",
|
|
selection=[
|
|
("1", "Danh mục học viên có nguyện vọng ngành 1"),
|
|
("2", "Danh mục học viên có nguyện vọng ngành 2"),
|
|
("3", "Danh mục học viên có nguyện vọng ngành 3"),
|
|
("4", "Danh mục học viên có nguyện vọng ngành 4"),
|
|
("5", "Danh mục học viên có nguyện vọng ngành 5"),
|
|
("6", "Danh mục học viên có nguyện vọng ngành 6"),
|
|
("7", "Danh mục học viên có nguyện vọng ngành 7"),
|
|
],
|
|
)
|
|
|
|
def name_get(self):
|
|
return [(record.id, record.ten_nhom_nganh) for record in self]
|
|
|
|
def write(self, vals):
|
|
if "menu" in vals:
|
|
self.search(
|
|
[("id", "!=", self.id), ("menu", "=", vals.get("menu"))]
|
|
).sudo().update({"menu": False})
|
|
return super().write(vals)
|
|
|
|
|
|
class CenhomesNganh(models.Model):
|
|
_name = "cenhomes.chuyen_nganh"
|
|
_description = "Nguyện vọng ngành"
|
|
|
|
is_favorite = fields.Char(string="", default=False)
|
|
ten_chuyen_nganh = fields.Char(string="Tên nguyện vọng ngành", required=True)
|
|
nhom_nganh = fields.Many2one(
|
|
comodel_name="cenhomes.nhom_nganh", string="Nhóm ngành", required=True
|
|
)
|
|
|
|
def name_get(self):
|
|
return [(record.id, record.ten_chuyen_nganh) for record in self]
|
|
|
|
|
|
class CenhomesDuhockepDoiTac(models.Model):
|
|
_name = "cenhomes.du_hoc_kep_doi_tac"
|
|
_description = "Đối tác"
|
|
|
|
ten = fields.Char(string="Tên đối tác")
|
|
ma_don_vi = fields.Char(string="Mã đối tác")
|
|
bang = fields.Char(string="Bang")
|
|
thanh_pho = fields.Char(string="Thành phố")
|
|
nguoi_dai_dien = fields.Char(string="Người đại diện")
|
|
chuc_vu = fields.Char(string="Chức vụ")
|
|
email = fields.Char(string="Email")
|
|
phone = fields.Char(string="Số điện thoại")
|
|
ngay_ket_noi = fields.Date(string="Ngày kết nối")
|
|
|
|
def name_get(self):
|
|
return [(record.id, record.ten) for record in self]
|
|
|
|
|
|
class CenhomesHocvienDoiTac(models.Model):
|
|
_name = "cenhomes.quan_he_hoc_vien_doi_tac"
|
|
_description = "Quan hệ học viên đối tác"
|
|
_base_path_url = "cenhomes/du_hoc_kep/hoc_vien"
|
|
|
|
hoc_vien_id = fields.Many2one(comodel_name="cenhomes.hoc_vien", string="Học viên")
|
|
doi_tac = fields.Many2one(
|
|
comodel_name="cenhomes.du_hoc_kep_doi_tac", string="Đối tác"
|
|
)
|
|
doi_tac_ma_don_vi = fields.Char(
|
|
string="Mã đối tác", related="doi_tac.ma_don_vi", store=False
|
|
)
|
|
doi_tac_bang = fields.Char(string="Bang", related="doi_tac.bang", store=False)
|
|
doi_tac_thanh_pho = fields.Char(
|
|
string="Thành phố", related="doi_tac.thanh_pho", store=False
|
|
)
|
|
doi_tac_nguoi_dai_dien = fields.Char(
|
|
string="Người đại diện", related="doi_tac.nguoi_dai_dien", store=False
|
|
)
|
|
doi_tac_chuc_vu = fields.Char(
|
|
string="Chức vụ", related="doi_tac.chuc_vu", store=False
|
|
)
|
|
|
|
ngay_so_tuyen = fields.Date(string="Ngày sơ tuyển")
|
|
dia_diem_so_tuyen = fields.Char(string="Địa điểm sơ tuyển")
|
|
ket_qua_so_tuyen = fields.Char(string="Kết quả sơ tuyển")
|
|
|
|
pv1_thoi_gian = fields.Datetime(
|
|
string="Thời gian", default=lambda self: fields.datetime.now()
|
|
)
|
|
pv1_hinh_thuc = fields.Char(string="Hình thức")
|
|
pv1_dia_diem = fields.Char(string="Địa điểm")
|
|
pv1_nhom_nganh = fields.Many2one(
|
|
comodel_name="cenhomes.nhom_nganh", string="Nhóm ngành"
|
|
)
|
|
pv1_nghe_nghiep = fields.Char(string="Nghề nghiệp")
|
|
pv1_ket_qua = fields.Selection(
|
|
string="Kết quả lần 1",
|
|
selection=[("passed", "Đạt điều kiện"), ("failed", "Chưa đủ điều kiện")],
|
|
)
|
|
pv1_feedback_dung_gio = fields.Selection(
|
|
string="Đúng giờ", selection=Common._priority_list
|
|
)
|
|
pv1_feedback_phong_thai = fields.Selection(
|
|
string="Phong thái", selection=Common._priority_list
|
|
)
|
|
pv1_feedback_thai_do_nghiem_tuc = fields.Selection(
|
|
string="Thái độ nghiêm túc", selection=Common._priority_list
|
|
)
|
|
pv1_feedback_than_thien = fields.Selection(
|
|
string="Thân thiện", selection=Common._priority_list
|
|
)
|
|
pv1_feedback_kha_nang_nghe = fields.Selection(
|
|
string="Khả năng nghe", selection=Common._priority_list
|
|
)
|
|
pv1_feedback_kha_nang_noi = fields.Selection(
|
|
string="Khả năng nói", selection=Common._priority_list
|
|
)
|
|
pv1_feedback_kien_thuc_nghe = fields.Selection(
|
|
string="Kiến thức nghề", selection=Common._priority_list
|
|
)
|
|
pv1_feedback_dong_luc = fields.Selection(
|
|
string="Động lực", selection=Common._priority_list
|
|
)
|
|
pv1_feedback_muc_do_phu_hop = fields.Selection(
|
|
string="Mức độ phù hợp", selection=Common._priority_list
|
|
)
|
|
pv1_nhan_xet = fields.Text(string="Nhận xét")
|
|
|
|
pv2_thoi_gian = fields.Datetime(
|
|
string="Thời gian", default=lambda self: fields.datetime.now()
|
|
)
|
|
pv2_hinh_thuc = fields.Char(string="Hình thức")
|
|
pv2_dia_diem = fields.Char(string="Địa điểm")
|
|
pv2_nhom_nganh = fields.Many2one(
|
|
comodel_name="cenhomes.nhom_nganh", string="Nhóm ngành"
|
|
)
|
|
pv2_nghe_nghiep = fields.Char(string="Nghề nghiệp")
|
|
pv2_ket_qua = fields.Selection(
|
|
string="Kết quả lần 2",
|
|
selection=[("passed", "Đạt điều kiện"), ("failed", "Chưa đủ điều kiện")],
|
|
)
|
|
pv2_feedback_dung_gio = fields.Selection(
|
|
string="Đúng giờ", selection=Common._priority_list
|
|
)
|
|
pv2_feedback_phong_thai = fields.Selection(
|
|
string="Phong thái", selection=Common._priority_list
|
|
)
|
|
pv2_feedback_thai_do_nghiem_tuc = fields.Selection(
|
|
string="Thái độ nghiêm túc", selection=Common._priority_list
|
|
)
|
|
pv2_feedback_than_thien = fields.Selection(
|
|
string="Thân thiện", selection=Common._priority_list
|
|
)
|
|
pv2_feedback_kha_nang_nghe = fields.Selection(
|
|
string="Khả năng nghe", selection=Common._priority_list
|
|
)
|
|
pv2_feedback_kha_nang_noi = fields.Selection(
|
|
string="Khả năng nói", selection=Common._priority_list
|
|
)
|
|
pv2_feedback_kien_thuc_nghe = fields.Selection(
|
|
string="Kiến thức nghề", selection=Common._priority_list
|
|
)
|
|
pv2_feedback_dong_luc = fields.Selection(
|
|
string="Động lực", selection=Common._priority_list
|
|
)
|
|
pv2_feedback_muc_do_phu_hop = fields.Selection(
|
|
string="Mức độ phù hợp", selection=Common._priority_list
|
|
)
|
|
pv2_nhan_xet = fields.Text(string="Nhận xét")
|
|
|
|
pv3_thoi_gian = fields.Datetime(
|
|
string="Thời gian", default=lambda self: fields.datetime.now()
|
|
)
|
|
pv3_hinh_thuc = fields.Char(string="Hình thức")
|
|
pv3_dia_diem = fields.Char(string="Địa điểm")
|
|
pv3_nhom_nganh = fields.Many2one(
|
|
comodel_name="cenhomes.nhom_nganh", string="Nhóm ngành"
|
|
)
|
|
pv3_nghe_nghiep = fields.Char(string="Nghề nghiệp")
|
|
pv3_ket_qua = fields.Selection(
|
|
string="Kết quả lần 3",
|
|
selection=[("passed", "Đạt điều kiện"), ("failed", "Chưa đủ điều kiện")],
|
|
)
|
|
pv3_feedback_dung_gio = fields.Selection(
|
|
string="Đúng giờ", selection=Common._priority_list
|
|
)
|
|
pv3_feedback_phong_thai = fields.Selection(
|
|
string="Phong thái", selection=Common._priority_list
|
|
)
|
|
pv3_feedback_thai_do_nghiem_tuc = fields.Selection(
|
|
string="Thái độ nghiêm túc", selection=Common._priority_list
|
|
)
|
|
pv3_feedback_than_thien = fields.Selection(
|
|
string="Thân thiện", selection=Common._priority_list
|
|
)
|
|
pv3_feedback_kha_nang_nghe = fields.Selection(
|
|
string="Khả năng nghe", selection=Common._priority_list
|
|
)
|
|
pv3_feedback_kha_nang_noi = fields.Selection(
|
|
string="Khả năng nói", selection=Common._priority_list
|
|
)
|
|
pv3_feedback_kien_thuc_nghe = fields.Selection(
|
|
string="Kiến thức nghề", selection=Common._priority_list
|
|
)
|
|
pv3_feedback_dong_luc = fields.Selection(
|
|
string="Động lực", selection=Common._priority_list
|
|
)
|
|
pv3_feedback_muc_do_phu_hop = fields.Selection(
|
|
string="Mức độ phù hợp", selection=Common._priority_list
|
|
)
|
|
pv3_nhan_xet = fields.Text(string="Nhận xét")
|
|
|
|
ket_qua_chung = fields.Selection(
|
|
string="Mức độ phù hợp",
|
|
selection=[("passed", "Được tiếp nhận"), ("failed", "Không tiếp nhận")],
|
|
)
|
|
|
|
def action_view_thong_bao_lich_pv(self):
|
|
url = "cenhomes/404"
|
|
kwargs = http.request.params.get("kwargs")
|
|
if http.request.params.get("kwargs"):
|
|
context = kwargs.get("context").get("vong_phong_van")
|
|
if context:
|
|
url = f"{self._base_path_url}/lich_phong_van/{self.hoc_vien_id.id}/{self.id}?vong_phong_van={context}"
|
|
return {
|
|
"type": "ir.actions.act_url",
|
|
"name": "Lịch phỏng vấn",
|
|
"target": "new",
|
|
"url": url,
|
|
}
|
|
|
|
def action_view_thong_bao_ket_qua_pv(self):
|
|
url = "cenhomes/404"
|
|
kwargs = http.request.params.get("kwargs")
|
|
if http.request.params.get("kwargs"):
|
|
context = kwargs.get("context").get("vong_phong_van")
|
|
if context:
|
|
url = f"{self._base_path_url}/ket_qua_phong_van/{self.hoc_vien_id.id}/{self.id}?vong_phong_van={context}"
|
|
return {
|
|
"type": "ir.actions.act_url",
|
|
"name": "Kết quả phỏng vấn",
|
|
"target": "new",
|
|
"url": url,
|
|
}
|
|
|
|
|
|
class CenhomesBaoLuu(models.Model):
|
|
_name = "cenhomes.bao_luu"
|
|
_description = "Bảo lưu học viên"
|
|
|
|
hoc_vien_id = fields.Many2one(
|
|
"cenhomes.hoc_vien",
|
|
string="Học Viên",
|
|
required=True,
|
|
help="Học viên đăng ký bảo lưu",
|
|
)
|
|
mshv = fields.Char(
|
|
string="Mã Số Học Viên",
|
|
related="hoc_vien_id.mshv",
|
|
store=True,
|
|
readonly=True,
|
|
)
|
|
trinh_do = fields.Selection(
|
|
selection=BaoLuu._trinh_do_bao_luu_list,
|
|
string="Trình Độ Bảo Lưu",
|
|
default="a1",
|
|
)
|
|
ngay_nop_don = fields.Date(string="Ngày Nộp Đơn")
|
|
ngay_bat_dau = fields.Date(string="Ngày Bắt Đầu Bảo Lưu")
|
|
ngay_ket_thuc = fields.Date(string="Ngày Kết Thúc Bảo Lưu")
|
|
ly_do = fields.Text(string="Lý Do Bảo Lưu")
|
|
trang_thai = fields.Selection(
|
|
selection=BaoLuu._trang_thai_bao_luu_list,
|
|
string="Trạng Thái Đơn",
|
|
default="draft",
|
|
)
|
|
|
|
|
|
class CenhomesBanGiaoHocVien(models.Model):
|
|
_name = "cenhomes.ban_giao_hoc_vien"
|
|
_description = "Bàn giao học viên"
|
|
|
|
hoc_vien_id = fields.Many2one(
|
|
comodel_name="cenhomes.hoc_vien",
|
|
string="Học viên",
|
|
required=True,
|
|
ondelete="cascade",
|
|
)
|
|
mshv = fields.Char(
|
|
string="Mã Số Học Viên",
|
|
related="hoc_vien_id.mshv",
|
|
store=True,
|
|
readonly=True,
|
|
)
|
|
nhan_su_thu_tuc_id = fields.Char(
|
|
string="Nhân sự tủ tục",
|
|
)
|
|
giao_vu_id = fields.Char(
|
|
string="Giáo vụ",
|
|
)
|
|
size_dong_phuc = fields.Char(string="Size đồng phục")
|
|
ngay_nhan_dong_phuc = fields.Date(string="Ngày nhận đồng phục")
|
|
ngay_nhan_the = fields.Date(string="Ngày nhận thẻ")
|
|
ngay_nhan_giao_trinh_a1 = fields.Date(string="Ngày nhận giáo trình A1")
|
|
ngay_nhan_giao_trinh_a2 = fields.Date(string="Ngày nhận giáo trình A2")
|
|
ngay_nhan_giao_trinh_b1 = fields.Date(string="Ngày nhận giáo trình B1")
|
|
so_lan_cap_lai = fields.Integer(string="Số lần cấp lại thẻ/áo/sách", default=0)
|
|
|
|
def write(self, vals):
|
|
return super().write(vals)
|
|
|
|
|
|
# không dùng menu trong settings nữa
|
|
# class ResConfigSettings(models.TransientModel):
|
|
# _inherit = 'res.config.settings'
|
|
#
|
|
# display_nguyen_vong_nganh = fields.Many2one(comodel_name='cenhomes.nhom_nganh', string='Nguyện vọng ngành')
|
|
#
|
|
# def set_values(self):
|
|
# """employee setting field values"""
|
|
# res = super(ResConfigSettings, self).set_values()
|
|
# self.env['ir.config_parameter'].set_param('cenhomes.du_hoc_kep.display_chuyen_nganh',
|
|
# self.display_nguyen_vong_nganh.id)
|
|
# name_action = "Danh mục học viên có nguyện vọng ngành"
|
|
# if get_lang(self.env).code == 'de_DE':
|
|
# name_action = "Die Liste der Berufswünsche"
|
|
# action = self.env['ir.actions.actions'].search([
|
|
# ('name', 'ilike', name_action)
|
|
# ])
|
|
# action[0].sudo().update({
|
|
# 'name': f'{name_action} {self.display_nguyen_vong_nganh.ten_nhom_nganh}'
|
|
# })
|
|
# nhom_nganh = self.env['cenhomes.nhom_nganh'].search([
|
|
# ('id', '=', self.display_nguyen_vong_nganh.id)
|
|
# ])
|
|
# if nhom_nganh:
|
|
# nhom_nganh[0].sudo().update({
|
|
# 'is_favorite': True
|
|
# })
|
|
# self.env['cenhomes.nhom_nganh'].search([
|
|
# ('id', '!=', self.display_nguyen_vong_nganh.id)
|
|
# ]).sudo().update({
|
|
# 'is_favorite': False
|
|
# })
|
|
#
|
|
# return res
|
|
#
|
|
# def get_values(self):
|
|
# """employee limit getting field values"""
|
|
# res = super(ResConfigSettings, self).get_values()
|
|
# value = self.env['ir.config_parameter'].sudo().get_param('cenhomes.du_hoc_kep.display_chuyen_nganh')
|
|
# if value:
|
|
# res.update(
|
|
# display_nguyen_vong_nganh=int(value)
|
|
# )
|
|
# return res
|