@@ -55,6 +60,9 @@
+
+
+
diff --git a/website_form_room/__init__.py b/website_form_room/__init__.py
deleted file mode 100644
index e046e49fb..000000000
--- a/website_form_room/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from . import controllers
diff --git a/website_form_room/__manifest__.py b/website_form_room/__manifest__.py
deleted file mode 100644
index eef5e99ba..000000000
--- a/website_form_room/__manifest__.py
+++ /dev/null
@@ -1,11 +0,0 @@
-# -*- coding: utf-8 -*-
-# Part of Odoo. See LICENSE file for full copyright and licensing details.
-
-{
- 'name': '会议表单',
- 'version': '17.0',
- 'depends': ['web', 'room'],
- 'data': [
- 'views/webclient_templates.xml',
- ],
-}
diff --git a/website_form_room/controllers/__init__.py b/website_form_room/controllers/__init__.py
deleted file mode 100644
index 12a7e529b..000000000
--- a/website_form_room/controllers/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from . import main
diff --git a/website_form_room/static/description/icon.png b/website_form_room/static/description/icon.png
deleted file mode 100644
index b7aaac75c..000000000
Binary files a/website_form_room/static/description/icon.png and /dev/null differ
diff --git a/yuthon_notice/__manifest__.py b/yuthon_notice/__manifest__.py
index 15ebb3111..f4cb26607 100644
--- a/yuthon_notice/__manifest__.py
+++ b/yuthon_notice/__manifest__.py
@@ -15,11 +15,11 @@
'security/ir.model.access.csv',
# 'data/notice_code_data.xml',
'data/project_state_type_data.xml',
- 'views/inherit_project_task_views.xml',
+ 'data/notice_cron_data.xml',
+ # 'views/inherit_project_task_views.xml',
'views/yuthon_notice_views.xml',
'views/yuthon_notice_type_views.xml',
'views/yuthon_confirm_users_views.xml',
- 'report/notice_report.xml',
],
'installable': True,
'application': True,
diff --git a/yuthon_notice/data/notice_cron_data.xml b/yuthon_notice/data/notice_cron_data.xml
new file mode 100644
index 000000000..0faba9965
--- /dev/null
+++ b/yuthon_notice/data/notice_cron_data.xml
@@ -0,0 +1,18 @@
+
+
+
+
+
+ 公告未确认通知
+
+ code
+ model.sync_confirm_users_notices()
+
+
+ 1
+ days
+ -1
+
+
+
+
\ No newline at end of file
diff --git a/yuthon_notice/models/__init__.py b/yuthon_notice/models/__init__.py
index 39e2dbe02..5d48b2fea 100644
--- a/yuthon_notice/models/__init__.py
+++ b/yuthon_notice/models/__init__.py
@@ -3,5 +3,5 @@
from . import yuthon_notice
from . import yuthon_notice_type
from . import yuthon_confirm_users
-from . import inherit_project_task
+# from . import inherit_project_task
diff --git a/yuthon_notice/models/yuthon_confirm_users.py b/yuthon_notice/models/yuthon_confirm_users.py
index 9171c7cc4..01bd7c83c 100644
--- a/yuthon_notice/models/yuthon_confirm_users.py
+++ b/yuthon_notice/models/yuthon_confirm_users.py
@@ -1,12 +1,11 @@
# -*- coding: utf-8 -*-
from odoo import api, fields, models, tools
+from odoo.exceptions import UserError, ValidationError
class YuthonConfirmUsers(models.Model):
_name = "yuthon.confirm.users"
_description = "公告确认信息"
- # todo 定时任务给未确认的用户发送通知公告
- # todo 打印
employee_id = fields.Many2one('hr.employee', string='员工')
notice_id = fields.Many2one('yuthon.notice', string="公告名称")
@@ -14,22 +13,22 @@ class YuthonConfirmUsers(models.Model):
notice_name = fields.Char(string="公告名称")
state = fields.Selection([('no', '未确认'), ('yes', '已确认')], string="状态")
- # @api.model_create_multi
- # def create(self, vals_list):
- # notice_name = vals_list[0]['notice_name']
- # message_body = f"您有一条新的公告确认请求:{notice_name}。请登录系统查看详情。"
- # user_id_list = []
- # for val in vals_list:
- # if 'user_id' in val:
- # user_id_list.append(val['user_id'])
- # partner_ids = self.sudo().env['res.users'].search([('id', 'in', user_id_list)]).mapped('partner_id').ids
- # partner_ids = self.env['res.partner'].search([('user_id', 'in', user_id_list)]).ids
- # self.message_post(
- # body=message_body,
- # subject="公告确认提醒",
- # partner_ids=[partner_id.id], # 收件人的伙伴ID
- # message_type='notification',
- # )
- # self.sudo().with_context(lang=self.env.lang)._message_auto_subscribe_notify(partner_ids, 'yuthon_notice.message_yuthon_confirm_users_data')
- # return super().create(vals_list)
+ def sync_confirm_users_notices(self):
+ menu_id = self.env['ir.ui.menu'].search([('name', '=', '我的通知公告')])
+ for record in self.search([('state', '=', 'no')]):
+ str = 'https://www.thtzjt.com/web#id={}&cids=1&menu_id={}&action={}&model=yuthon.notice&view_type=form'.format(
+ record.notice_id.id, menu_id.id, menu_id.action.id)
+ data = "您有待确认的通知公告请确认\n" + "
{}".format(str, self.name)
+ record.sudo().env["wecom.apps"].sync_send_message(record.employee_id.wecom_userid, data)
+ def reminders_notice(self):
+ for rem in self:
+ if rem.state == 'yes':
+ raise UserError('已确认不可催办')
+ confirm_noice_ids = self.env["yuthon.confirm.users"].browse(self._context.get('active_ids', self._context.get('active_id')))
+ for rec in confirm_noice_ids:
+ menu_id = self.env['ir.ui.menu'].search([('name', '=', '我的通知公告')])
+ str = 'https://www.thtzjt.com/web#id={}&cids=1&menu_id={}&action={}&model=yuthon.notice&view_type=form'.format(
+ rec.notice_id.id, menu_id.id, menu_id.action.id)
+ data = "您有待确认的通知公告请尽快确认\n" + "
{}".format(str, rec.notice_id.name)
+ rec.sudo().env["wecom.apps"].sync_send_message(rec.employee_id.wecom_userid, data)
diff --git a/yuthon_notice/models/yuthon_notice.py b/yuthon_notice/models/yuthon_notice.py
index f890a7050..eb77fcac8 100644
--- a/yuthon_notice/models/yuthon_notice.py
+++ b/yuthon_notice/models/yuthon_notice.py
@@ -13,10 +13,11 @@ class YuthonNotice(models.Model):
name = fields.Char(string='通知公告标题')
code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('notice_code'))
user_id = fields.Many2one('res.users', string="创建人", default=lambda self: self.env.user)
- department_id = fields.Many2one(related='user_id.employee_id.department_id', string="创建人部门")
+ department_id = fields.Many2one(related='user_id.employee_id.department_id', string="部门")
department_ids = fields.Many2many('hr.department', string='部门范围')
employee_ids = fields.Many2many('hr.employee', string='人员范围')
users_role_ids = fields.Many2many('soong.user.role', string='角色范围')
+ company_page = fields.Selection([('tz', '天河投资'), ('wg', '天河物管'), ('lc', '粮储')], string="公司", compute='_compute_company_page', store=True)
notice_type_id = fields.Many2one('yuthon.notice.type', string="公告类型")
create_date = fields.Date(string="发布日期")
start_date = fields.Date(string="生效日期")
@@ -28,6 +29,9 @@ class YuthonNotice(models.Model):
is_notice_roger = fields.Selection([('yes', '已读'), ('no', '未读')], default='no', string="确认状态")
is_change_notice = fields.Boolean(string="是否发送通知", default=True)
notice_text = fields.Html(string="正文")
+ read_number = fields.Integer(string='阅读量')
+ approval_user_id = fields.Many2one('res.users', string="审核人")
+ approval_date = fields.Datetime(string="审核日期")
@api.onchange('is_notice_roger')
def onchange_is_notice_roger(self):
@@ -72,14 +76,12 @@ class YuthonNotice(models.Model):
data = "您有新的通知公告请及时确认\n" + "
{}".format(str, self.name)
we_id = self.env['hr.employee'].search([('id', '=', user)]).wecom_userid
self.sudo().env["wecom.apps"].sync_send_message(we_id, data)
- # 待办关联
- self.env['project.task'].create({
- 'name': '新的通知公告' + self.name + "请及时确认",
- 'user_ids': [(4, user)],
- 'notice_origin_id': self.id,
- })
-
-
+ # # 待办关联
+ # self.env['project.task'].create({
+ # 'name': '新的通知公告' + self.name + "请及时确认",
+ # 'user_ids': [(4, user)],
+ # 'notice_origin_id': self.id,
+ # })
# 普通用户权限是否打开,可能需要配置权限
# 关联待办和不关联待办
diff --git a/yuthon_notice/report/notice_report.xml b/yuthon_notice/report/notice_report.xml
deleted file mode 100644
index 0b3784d5b..000000000
--- a/yuthon_notice/report/notice_report.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
-
- 通知公告打印
- yuthon.notice
- qweb-pdf
- yuthon_notice.yuthon_notice_report_template
- yuthon_notice.yuthon_notice_report_template
- '%s' % (object.name).replace('/', '')
-
-
- report
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/yuthon_notice/views/yuthon_confirm_users_views.xml b/yuthon_notice/views/yuthon_confirm_users_views.xml
index e9690ca97..df09d78c2 100644
--- a/yuthon_notice/views/yuthon_confirm_users_views.xml
+++ b/yuthon_notice/views/yuthon_confirm_users_views.xml
@@ -4,7 +4,11 @@
yuthon.confirm.users.tree
yuthon.confirm.users
-
+
+
diff --git a/yuthon_notice/views/yuthon_notice_views.xml b/yuthon_notice/views/yuthon_notice_views.xml
index 974a63115..8993e57a4 100644
--- a/yuthon_notice/views/yuthon_notice_views.xml
+++ b/yuthon_notice/views/yuthon_notice_views.xml
@@ -7,13 +7,16 @@
+
+
-
+
@@ -26,8 +29,10 @@