diff --git a/soong_workflow/models/soong_user_role.py b/soong_workflow/models/soong_user_role.py index 9b3afb05e..aeb2eacbe 100644 --- a/soong_workflow/models/soong_user_role.py +++ b/soong_workflow/models/soong_user_role.py @@ -15,13 +15,12 @@ class YuthonUserRole(models.Model): create_time = fields.Datetime(string="创建时间", default=fields.Datetime.now) end_time = fields.Datetime(string="结束时间") yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'), - ('thlc', '天河粮储'), ('tctj', '天投城建'), - ('thtjbb', '天河投资本部')], string="所属公司", compute='compute_company') + ('thlc', '天河粮储'), ('thtjbb', '天河投资本部')], string="所属公司", compute='compute_company') @api.depends('department_id') def compute_company(self): company_mapping = {'天河投资集团': 'thtz', '天河物管': 'thwg', - '天河粮储': 'thlc', '天投城建': 'tctj', + '天河粮储': 'thlc', '天河投资本部': 'thtjbb'} for record in self: visited_departments = set() diff --git a/soong_workflow/models/soong_workflow.py b/soong_workflow/models/soong_workflow.py index 0833a28dd..36b7bbc6f 100644 --- a/soong_workflow/models/soong_workflow.py +++ b/soong_workflow/models/soong_workflow.py @@ -104,7 +104,7 @@ class SoongWorkflow(models.Model): @api.depends('start_date', 'end_date') def compute_is_enable(self): for rec in self: - if rec.start_date and rec.end_date: + if rec.start_date and rec.end_date and self.name: if rec.start_date <= fields.Date.today() < rec.end_date: is_enable_ids = self.search([('model_id', '=', self.model_id.id), ('is_enable', '=', True)]) if len(is_enable_ids) <= 1: diff --git a/soong_workflow/models/soong_workflow_node.py b/soong_workflow/models/soong_workflow_node.py index 34f8bc645..193f50e13 100644 --- a/soong_workflow/models/soong_workflow_node.py +++ b/soong_workflow/models/soong_workflow_node.py @@ -130,23 +130,23 @@ class SoongWorkflowNode(models.Model): "action_type": "code", "code": "obj.action_withdraw()", },), - (0, 0, { - "name": _("加签"), - "workflow_id": val['workflow_id'], - "sequence": 3, - "action_type": "code", - "has_comment": True, - },), - (0, 0, { - "name": _("转交"), - "workflow_id": val['workflow_id'], - "sequence": 3, - "action_type": "code", - "btn_hide": True, - "review_type": 'expression', - # "reviewer_expression": "obj.action_withdraw()", # todo domain - "has_comment": True, - },), + # (0, 0, { + # "name": _("加签"), + # "workflow_id": val['workflow_id'], + # "sequence": 3, + # "action_type": "code", + # "has_comment": True, + # },), + # (0, 0, { + # "name": _("转交"), + # "workflow_id": val['workflow_id'], + # "sequence": 3, + # "action_type": "code", + # "btn_hide": True, + # "review_type": 'expression', + # # "reviewer_expression": "obj.action_withdraw()", # todo domain + # "has_comment": True, + # },), (0, 0, { "name": _("退回"), "workflow_id": val['workflow_id'], @@ -300,7 +300,7 @@ class SoongWorkflowNodeButton(models.Model): required=True, ondelete="cascade", ) - is_automatic = fields.Boolean('是否自动匹配', default=True) + is_automatic = fields.Boolean('是否自动匹配', default=True, help='该节点默认拟办人员的部门相应人员。必须是系统全局角色') @api.onchange("node_id") def change_workflow(self): diff --git a/soong_workflow/views/soong_workflow_node_views.xml b/soong_workflow/views/soong_workflow_node_views.xml index 974506c46..65902487a 100644 --- a/soong_workflow/views/soong_workflow_node_views.xml +++ b/soong_workflow/views/soong_workflow_node_views.xml @@ -161,7 +161,7 @@ name="reviewer_group_id" invisible="review_type != 'group'" /> - + + - + @@ -54,6 +57,7 @@ + @@ -64,11 +68,23 @@ + + yuthon.index.management.search + yuthon.index.management + + + + + + + + 组织绩效 yuthon.index.management - tree,form + tree,form,search + {'search_default_group_development_goals': 1} \ No newline at end of file diff --git a/yuthon_property/models/yuthon_property.py b/yuthon_property/models/yuthon_property.py index e9bcb6e64..11c74d9ab 100644 --- a/yuthon_property/models/yuthon_property.py +++ b/yuthon_property/models/yuthon_property.py @@ -43,7 +43,7 @@ class YuthonProperty(models.Model): ('signed', '已备案'), ('leased', '已出租'), ('idle', '闲置')], string='状态', default='to') is_meter = fields.Boolean(string="是否有水表") is_electricity_meter = fields.Boolean(string="是否有电表") - yuthon_company = fields.Selection([('tz', '天河投资'), ('wg', '天河物管'), ('lc', '天河粮储'), ('tj', '天河投建')], + yuthon_company = fields.Selection([('tz', '天河投资'), ('wg', '天河物管'), ('lc', '天河粮储'),], string="所属公司") admin_id = fields.Many2one('res.users', string="管理员") purpose_id = fields.Many2one('yuthon.resource.purpose', string="资产用途") @@ -305,7 +305,7 @@ class ManageInformationLine(models.Model): purpose_id = fields.Many2one('yuthon.resource.purpose', string="资产用途") precinct = fields.Char(string="片区") admin_id = fields.Many2one('res.users', string="管理员") - yuthon_company = fields.Selection([('tz', '天河投资'), ('wg', '天河物管'), ('lc', '天河粮储'), ('tj', '天河投建')], + yuthon_company = fields.Selection([('tz', '天河投资'), ('wg', '天河物管'), ('lc', '天河粮储'),], string="所属公司") start_time = fields.Date(string="生效日期") end_date = fields.Date(string="失效日期") diff --git a/yuthon_property_approval/models/property_eligibility.py b/yuthon_property_approval/models/property_eligibility.py index c73c50170..bd8ac2b1f 100644 --- a/yuthon_property_approval/models/property_eligibility.py +++ b/yuthon_property_approval/models/property_eligibility.py @@ -17,8 +17,7 @@ class PropertyEligibility(models.Model): eligibility_ids = fields.One2many('property.eligibility.line', 'eligibility_id', string="意向客户明细") sincerity_gold = fields.Float(string="诚意金") users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id) - yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'), ('thlc', '天河粮储'), - ('tctj', '天投城建')], string='公司') + yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'), ('thlc', '天河粮储')], string='公司') department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门") is_issues = fields.Boolean(string='是否上会') related_issues_id = fields.Many2one('issue.library', string="关联议题") diff --git a/yuthon_property_approval/models/property_intention_approval.py b/yuthon_property_approval/models/property_intention_approval.py index 7618e227c..348b0d447 100644 --- a/yuthon_property_approval/models/property_intention_approval.py +++ b/yuthon_property_approval/models/property_intention_approval.py @@ -12,8 +12,7 @@ class PropertyIntentionApproval(models.Model): name = fields.Char(string="标题") code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('property_intention_code')) users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id) - yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'), ('thlc', '天河粮储'), - ('tctj', '天投城建')], string='公司') + yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'), ('thlc', '天河粮储')], string='公司') department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门") is_issues = fields.Boolean(string='是否上会') related_issues_id = fields.Many2one('issue.library', string="关联议题") diff --git a/yuthon_property_approval/models/property_transfer_approval.py b/yuthon_property_approval/models/property_transfer_approval.py index b098c21b9..ed72eb538 100644 --- a/yuthon_property_approval/models/property_transfer_approval.py +++ b/yuthon_property_approval/models/property_transfer_approval.py @@ -13,8 +13,7 @@ class PropertyTransferApproval(models.Model): code = fields.Char(string="编号", default=lambda self: self.env['ir.sequence'].next_by_code('property_transfer_code')) users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id) - yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'), ('thlc', '天河粮储'), - ('tctj', '天投城建')], string='公司') + yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'), ('thlc', '天河粮储')], string='公司') department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门") is_issues = fields.Boolean(string='是否上会') related_issues_id = fields.Many2one('issue.library', string="关联议题") diff --git a/yuthon_salary/models/inherit_hr_payroll_structure.py b/yuthon_salary/models/inherit_hr_payroll_structure.py index 8fe23ede0..6ceb0a7ec 100644 --- a/yuthon_salary/models/inherit_hr_payroll_structure.py +++ b/yuthon_salary/models/inherit_hr_payroll_structure.py @@ -8,8 +8,7 @@ class HrPayrollStructure(models.Model): lv = fields.Char(string="级别") name = fields.Char(string="职级名称") sequence = fields.Char(string='级别序号', store=True) - yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'), ('thlc', '天河粮储'), - ('tctj', '天投城建')], string='所属公司') + yuthon_company = fields.Selection([('thtz', '天河投资集团'), ('thwg', '天河物管'), ('thlc', '天河粮储')], string='所属公司') create_time = fields.Datetime(string="生效日期", default=fields.Datetime.now) end_time = fields.Datetime(string="失效日期") type_id = fields.Many2one('hr.payroll.structure.type', string="岗位类别",required=False) diff --git a/yuthon_will_task/models/yuthon_will_task.py b/yuthon_will_task/models/yuthon_will_task.py index 13a8b44f1..1b33fb470 100644 --- a/yuthon_will_task/models/yuthon_will_task.py +++ b/yuthon_will_task/models/yuthon_will_task.py @@ -1,6 +1,6 @@ from odoo import api, fields, models, modules import datetime -from datetime import datetime, timedelta +from datetime import datetime, timedelta, time class YuthonWillTask(models.Model): @@ -17,8 +17,8 @@ class YuthonWillTask(models.Model): employee_ids = fields.Many2many('hr.employee', string='人员', default=lambda self: self.env.user.employee_id) remind = fields.Selection([('fifteen', '提醒-15分钟'), ('thirty', '提醒-30分钟'), ('one_hour', '提醒-1小时'), ('two_hour', '提醒-2小时'), ('one_day', '提醒-1天')], string='提醒') - start_time = fields.Datetime(string='开始时间') - end_time = fields.Datetime(string='结束时间') + start_time = fields.Datetime(string='开始时间', default=fields.Date.today()) + end_time = fields.Datetime(string='结束时间', default=lambda self: datetime.combine(datetime.now().date(), time(11, 0, 0))) remind_mapping = { 'fifteen': timedelta(minutes=15), @@ -40,7 +40,20 @@ class YuthonWillTask(models.Model): if not self.wecom_userid: raise ("请同步{}的企业微信".format(self.name)) for employee_id in self.employee_ids: - url = "https://oa.thtzjt.com/mail/view?model={}&res_id={}".format(self.yuthon_will_task,employee_id.id) - self.sudo().env["wecom.apps"].sync_send_message_textcard(category='attendance', user_id=self.wecom_userid, + url = "https://oa.thtzjt.com/mail/view?model={}&res_id={}".format(self._name, self.id) + self.sudo().env["wecom.apps"].sync_send_message_textcard(category='task', user_id=employee_id.wecom_userid, title="待办事项", description="测试消息请忽略", - url=url, btntxt="详细信息") \ No newline at end of file + url=url, btntxt="详细信息") + + def button_add_comment(self): + self.ensure_one() + self.add_comment() + return { + 'type': 'ir.actions.client', + 'tag': 'display_notification', + 'params': { + 'type': 'success', + 'message': '已发送提醒消息', + 'sticky': False, + } + } \ No newline at end of file diff --git a/yuthon_will_task/views/yuthon_will_task_views.xml b/yuthon_will_task/views/yuthon_will_task_views.xml index efa2c9641..2bf161655 100644 --- a/yuthon_will_task/views/yuthon_will_task_views.xml +++ b/yuthon_will_task/views/yuthon_will_task_views.xml @@ -17,6 +17,7 @@ +