diff --git a/room/__manifest__.py b/room/__manifest__.py index 677cd5534..7e607ded5 100644 --- a/room/__manifest__.py +++ b/room/__manifest__.py @@ -7,7 +7,7 @@ 'description': 'Experience the Ease of Booking Meeting Rooms with Real-Time Availability Display.', 'category': 'Services/Room', 'version': '1.0', - 'depends': ['mail'], + 'depends': ['mail', 'hr'], 'data': [ 'views/room_booking_views.xml', 'views/room_room_views.xml', diff --git a/room/models/room_booking.py b/room/models/room_booking.py index 3ec61e8ea..2d13b6614 100644 --- a/room/models/room_booking.py +++ b/room/models/room_booking.py @@ -19,6 +19,13 @@ class RoomBooking(models.Model): # Fields used to group bookings in gantt view office_id = fields.Many2one(related="room_id.office_id", string="Office", readonly=True, store=True) company_id = fields.Many2one(related="room_id.company_id", string="Company", readonly=True, store=True) + room_users_id = fields.Many2many('res.users', string="会议参加人员") + + def meet_notice(self): + pass + + def meet_change_notice(self): + pass @api.constrains("start_datetime", "stop_datetime") def _check_date_boundaries(self): diff --git a/room/models/room_room.py b/room/models/room_room.py index 962881d75..aae2db616 100644 --- a/room/models/room_room.py +++ b/room/models/room_room.py @@ -11,11 +11,14 @@ class Room(models.Model): _inherit = ["mail.thread"] _description = "Room" _order = "name, id" + _rec_name = 'name' # Configuration name = fields.Char(string="Room Name", required=True, tracking=2) description = fields.Html(string="Amenities", translate=html_translate) - office_id = fields.Many2one("room.office", string="Office", required=True, tracking=3) + office_id = fields.Many2one("room.office", string="Office", tracking=3) + office_address = fields.Char(string="会议室地址", required=True) + department_id = fields.Many2one("hr.department", string="部门", required=True) company_id = fields.Many2one(related="office_id.company_id", string="Company", store=True) room_booking_ids = fields.One2many("room.booking", "room_id", string="Bookings") short_code = fields.Char("Short Code", default=lambda self: str(uuid4())[:8], copy=False, required=True, tracking=1) diff --git a/room/views/room_booking_views.xml b/room/views/room_booking_views.xml index 7114172c0..aa7bf383a 100644 --- a/room/views/room_booking_views.xml +++ b/room/views/room_booking_views.xml @@ -123,6 +123,10 @@
+
+
- - - - + + + + + + - + @@ -129,8 +129,8 @@ - - + +
diff --git a/soong_workflow/__manifest__.py b/soong_workflow/__manifest__.py index 0f2db46f0..c1459031a 100644 --- a/soong_workflow/__manifest__.py +++ b/soong_workflow/__manifest__.py @@ -7,6 +7,7 @@ "version": "17.0.0.1.0", "depends": ["base", "crnd_web_diagram_plus", "hr"], "data": [ + "data/soong_workflow_note_data.xml", "security/soong_workflow_security.xml", "security/ir.model.access.csv", "views/menuitem.xml", diff --git a/soong_workflow/data/soong_workflow_note_data.xml b/soong_workflow/data/soong_workflow_note_data.xml new file mode 100644 index 000000000..5fe82369a --- /dev/null +++ b/soong_workflow/data/soong_workflow_note_data.xml @@ -0,0 +1,17 @@ + + + + + diff --git a/soong_workflow/i18n/soong_workflow.pot b/soong_workflow/i18n/soong_workflow.pot index 91099842d..25e7236e6 100644 --- a/soong_workflow/i18n/soong_workflow.pot +++ b/soong_workflow/i18n/soong_workflow.pot @@ -711,6 +711,11 @@ msgstr "" msgid "Trigger Link" msgstr "" +#. module: soong_workflow +#: model:ir.model.fields.selection,name:soong_workflow.selection__soong_workflow_node_button__action_type__link_start_statu +msgid "Trigger Link Start Statu" +msgstr "" + #. module: soong_workflow #: model:ir.model.fields.selection,name:soong_workflow.selection__soong_workflow_node_button__action_type__link_action msgid "Trigger Link Action" diff --git a/soong_workflow/i18n/zh_CN.po b/soong_workflow/i18n/zh_CN.po index 04e896cc1..381b2c45c 100644 --- a/soong_workflow/i18n/zh_CN.po +++ b/soong_workflow/i18n/zh_CN.po @@ -723,6 +723,11 @@ msgstr "链接" msgid "Trigger Link" msgstr "触发链接" +#. module: soong_workflow +#: model:ir.model.fields.selection,name:soong_workflow.selection__soong_workflow_node_button__action_type__link_start_statu +msgid "Trigger Link Start Statu" +msgstr "触发链接并开始状态" + #. module: soong_workflow #: model:ir.model.fields.selection,name:soong_workflow.selection__soong_workflow_node_button__action_type__link_action msgid "Trigger Link Action" diff --git a/soong_workflow/models/soong_workflow_node.py b/soong_workflow/models/soong_workflow_node.py index ee508ac9a..b642c521d 100644 --- a/soong_workflow/models/soong_workflow_node.py +++ b/soong_workflow/models/soong_workflow_node.py @@ -235,9 +235,11 @@ class SoongWorkflowNodeButton(models.Model): "The result of executing the expression must be a res.users " "recordset.", ) + # todo 找翻译文件改变状态 action_type = fields.Selection( [ ("link", "Trigger Link"), + ("link_start_statu", "Trigger Link Start Statu"), ("link_action", "Trigger Link Action"), ("link_action_approve", "Trigger Link Action Approve"), ("link_action_refuse", "Trigger Link Action Refuse"), @@ -356,7 +358,26 @@ class SoongWorkflowNodeButton(models.Model): if result: # Run Proper Action func = getattr(self, "_run_%s" % rec.action_type) - return func() + func_result = func() + # todo 触发下个流程消息发送 (写完未测试) + try: + user_ids = [] + button_ids = rec.link_id.node_to.button_ids + for button_id in button_ids: + # 根据每个按钮状态判断当前应该的查看人员 + if button_id.review_type == "individual": + user_ids.append(button_id.reviewer_id.id) + elif button_id.review_type == "group": + user_ids += button_id.reviewer_group_id.users.ids + elif button_id.review_type == "user_role": + user_role_id = self.env['res.users'].search([('employee_id.user_role_id', '=', button_id.users_role_id.id), ('employee_id.department_id', '=', button_id.users_role_id.department_id.id)]) + user_ids += user_role_id.ids + # 发送信息提醒 + partner_ids = self.sudo().env['res.users'].search([('id', 'in', user_ids)]).mapped('partner_id').ids + self.sudo().with_context(lang=self.env.lang)._message_auto_subscribe_notify(partner_ids, 'soong_workflow.message_yuthon_workflow_btn_approval_data') + except Exception as e: + pass + return func_result def _run_win_act(self): # Variables @@ -454,6 +475,56 @@ class SoongWorkflowNodeButton(models.Model): # Trigger link function return rec.link_id.trigger_link() + def _run_link_start_statu(self): + for rec in self: + # Check Condition Before Executing Action + result = False + cx = self.env.context.copy() or {} + locals_dict = { + "env": self.env, + "model": self.env[cx.get("active_model", False)], + "obj": self.env[cx.get("active_model", False)].browse( + cx.get("active_id", 0) + ), + "user": self.env.user, + "datetime": datetime, + "time": time, + "date": date, + "timedelta": timedelta, + "workflow": self.env["soong.workflow"], + "warning": self.warning, + "syslog": self.syslog, + } + try: + safe_eval( + rec.link_id.condition_code, + locals_dict=locals_dict, + mode="exec", + nocopy=True, + ) + result = "result" in locals_dict and locals_dict["result"] or False + except ValidationError as ex: + raise ex + except SyntaxError as ex: + raise UserError( + _( + "Wrong python code defined.\n\nError: %s\nLine: %s, Column: %s\n\n%s" + % (ex.args[0], ex.args[1][1], ex.args[1][2], ex.args[1][3]) + ) + ) + if result: + # todo 更改业务数据的状态,成品不建议这样玩 + try: + active_id = cx.get("active_id", 0) + active_model = cx.get("active_model", False) + obj = self.env[active_model].browse(active_id) + if obj.exists(): + obj.write({'statu': 'approval'}) + except Exception as e: + pass + # Trigger link function + return rec.link_id.trigger_link() + def _run_link_action(self): for rec in self: # Check Condition Before Executing Action diff --git a/soong_workflow/views/soong_workflow_node_views.xml b/soong_workflow/views/soong_workflow_node_views.xml index f26ff9922..1909673c3 100644 --- a/soong_workflow/views/soong_workflow_node_views.xml +++ b/soong_workflow/views/soong_workflow_node_views.xml @@ -168,7 +168,7 @@ - +
-
diff --git a/yuthon_performance/models/__init__.py b/yuthon_performance/models/__init__.py index 30f464c2e..c60cce89a 100644 --- a/yuthon_performance/models/__init__.py +++ b/yuthon_performance/models/__init__.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- from . import yuthon_performance -from . import yuthon_performance_line from . import yuthon_performance_manage diff --git a/yuthon_performance/models/yuthon_performance.py b/yuthon_performance/models/yuthon_performance.py index e3279b886..e1c38627f 100644 --- a/yuthon_performance/models/yuthon_performance.py +++ b/yuthon_performance/models/yuthon_performance.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. - from odoo import models, fields, api, exceptions, _ @@ -12,3 +11,36 @@ class YuthonPerformace(models.Model): performance_type = fields.Char(string="指标来源") performance_ids = fields.One2many('yuthon.performance.line', 'performance_id', string="绩效类型") + +class YuthonPerformaceLine(models.Model): + _name = 'yuthon.performance.line' + _description = "员工绩效明细" + + performance_id = fields.Many2one('yuthon.performance', string="绩效") + metric_type = fields.Char(string="指标类型") + metric_name = fields.Char(string="指标名称") + metric_define = fields.Char(string="指标定义") + work_task = fields.Char(string="工作任务") + weight = fields.Char(string="权重%") + compute_method = fields.Char(string="计算方法") + compute_uom = fields.Char(string="计算单位") + compute_act = fields.Char(string="计划安排及具体措施/行动") + # 上半年 + half_t1 = fields.Integer(string="底线值T1") + half_t2 = fields.Integer(string="基准值T2") + half_t3 = fields.Integer(string="努力值T3") + half_node = fields.Date(string="节点目标") + half_quality = fields.Char(string="质量目标") + # 下半年 + later_t1 = fields.Integer(string="底线值T1") + later_t2 = fields.Integer(string="基准值T2") + later_t3 = fields.Integer(string="努力值T3") + later_node = fields.Date(string="节点目标") + later_quality = fields.Char(string="质量目标") + # 年度 + annual_t1 = fields.Integer(string="底线值T1") + annual_t2 = fields.Integer(string="基准值T2") + annual_t3 = fields.Integer(string="努力值T3") + annual_node = fields.Date(string="节点目标") + annual_quality = fields.Char(string="质量目标") + diff --git a/yuthon_performance/models/yuthon_performance_line.py b/yuthon_performance/models/yuthon_performance_line.py deleted file mode 100644 index 2c1d530f5..000000000 --- a/yuthon_performance/models/yuthon_performance_line.py +++ /dev/null @@ -1,19 +0,0 @@ -# -*- coding: utf-8 -*- -# Part of Odoo. See LICENSE file for full copyright and licensing details. - -from odoo import models, fields, api, exceptions, _ - - -class YuthonPerformaceLine(models.Model): - _name = 'yuthon.performance.line' - _description = "员工绩效明细" - - performance_id = fields.Many2one('yuthon.performance', string="绩效") - development_goals = fields.Char(string="发展目标") - metric_name = fields.Char(string="指标名称") - metric_define = fields.Char(string="指标定义") - metric_type = fields.Char(string="指标类型") - metric_compute = fields.Char(string="指标计算公式") - compute_type = fields.Char(string="计算类型") - assessment_criteria = fields.Char(string="考核标准") - diff --git a/yuthon_performance/views/yuthon_performance_views.xml b/yuthon_performance/views/yuthon_performance_views.xml index d38fb6b5b..2e5532585 100644 --- a/yuthon_performance/views/yuthon_performance_views.xml +++ b/yuthon_performance/views/yuthon_performance_views.xml @@ -31,27 +31,52 @@ - + - - - - + + + + # 上半年 + half_t1 = fields.Integer(string="底线值T1") + half_t2 = fields.Integer(string="基准值T2") + half_t3 = fields.Integer(string="努力值T3") + half_node = fields.Date(string="节点目标") + half_quality = fields.Char(string="质量目标") + # 下半年 + later_t1 = fields.Integer(string="底线值T1") + later_t2 = fields.Integer(string="基准值T2") + later_t3 = fields.Integer(string="努力值T3") + later_node = fields.Date(string="节点目标") + later_quality = fields.Char(string="质量目标") + # 年度 + annual_t1 = fields.Integer(string="底线值T1") + annual_t2 = fields.Integer(string="基准值T2") + annual_t3 = fields.Integer(string="努力值T3") + annual_node = fields.Date(string="节点目标") + annual_quality = fields.Char(string="质量目标") + performance_id = fields.Many2one('yuthon.performance', string="绩效") + metric_type = fields.Char(string="指标类型") + metric_name = fields.Char(string="指标名称") + metric_define = fields.Char(string="指标定义") + work_task = fields.Char(string="工作任务") + weight = fields.Char(string="权重%") + compute_method = fields.Char(string="计算方法") + compute_uom = fields.Char(string="计算单位") + compute_act = fields.Char(string="计划安排及具体措施/行动") - + + - - - - + + diff --git a/yuthon_tianhe/__manifest__.py b/yuthon_tianhe/__manifest__.py index c48676562..22277e90d 100644 --- a/yuthon_tianhe/__manifest__.py +++ b/yuthon_tianhe/__manifest__.py @@ -14,9 +14,9 @@ 'license': 'LGPL-3', 'depends': ['base', 'base_setup', 'web', 'auth_signup', 'auth_oauth', - 'account_asset', 'sale_renting', 'project', 'hr', 'documents', + 'sale_renting', 'project', 'hr', 'documents', 'room', 'fleet', 'website_slides', 'website', 'approvals', - 'sale_renting', 'purchase', "account", 'spreadsheet_dashboard', + 'sale_renting', 'purchase', 'spreadsheet_dashboard', 'board', 'spreadsheet_dashboard', "hr_attendance", "hr_work_entry_contract_enterprise", "calendar", "project_todo"], diff --git a/yuthon_tianhe/i18n/zh_CN.po b/yuthon_tianhe/i18n/zh_CN.po index 54bb02ed8..9fca082a4 100644 --- a/yuthon_tianhe/i18n/zh_CN.po +++ b/yuthon_tianhe/i18n/zh_CN.po @@ -66,14 +66,6 @@ msgstr "会议管理" msgid "Purchase" msgstr "办公用品管理" -#. module: account_asset -#. odoo-javascript -#. odoo-python -#: model:ir.ui.menu,name:account_asset.menu_action_account_asset_form -#, python-format -msgid "Assets" -msgstr "固定资产管理" - #. module: fleet #. odoo-javascript #. odoo-python diff --git a/yuthon_tianhe/views/menuitem_sequence.xml b/yuthon_tianhe/views/menuitem_sequence.xml index 37dffd837..a1f880f96 100644 --- a/yuthon_tianhe/views/menuitem_sequence.xml +++ b/yuthon_tianhe/views/menuitem_sequence.xml @@ -42,17 +42,6 @@ 9 - - - 出勤 11 diff --git a/yuthon_wechat/controllers/main.py b/yuthon_wechat/controllers/main.py index 564820ad0..49b4da3a2 100644 --- a/yuthon_wechat/controllers/main.py +++ b/yuthon_wechat/controllers/main.py @@ -9,5 +9,4 @@ class Home(http.Controller): @http.route('/WW_verify_fC7AX158Ffby8Ed1.txt', type='http', auth="public") def WW_verify_UP42BAWNwtWK60RH(self): return 'fC7AX158Ffby8Ed1' - \ No newline at end of file