diff --git a/soong_workflow/wizard/soong_workflow_comment_wizard.py b/soong_workflow/wizard/soong_workflow_comment_wizard.py index ae59dd19d..9079201d0 100644 --- a/soong_workflow/wizard/soong_workflow_comment_wizard.py +++ b/soong_workflow/wizard/soong_workflow_comment_wizard.py @@ -39,7 +39,7 @@ class SoongWorkflowCommentWizard(models.TransientModel): return_link_id = fields.Many2one('trans.link', string='退回节点', ondelete='set null') invalid_link_ids = fields.Many2many( 'trans.link', - string='跳过相同人员', + string='跳过相同人员以及无审批人员', compute='_compute_invalid_link_ids', help='跳过相同人员的节点' ) diff --git a/yuthon_hr_attendance/models/yuthon_shift_planning.py b/yuthon_hr_attendance/models/yuthon_shift_planning.py index 52db6b490..2994ef74a 100644 --- a/yuthon_hr_attendance/models/yuthon_shift_planning.py +++ b/yuthon_hr_attendance/models/yuthon_shift_planning.py @@ -183,6 +183,47 @@ class YuthonShiftPlanning(models.Model): current_month = datetime.now().month return str(current_month) # 返回字符串类型的月份 + @api.onchange( + 'planning_a_ids', + 'planning_b_ids', + 'planning_c_ids', + 'planning_ever_white_ids', + 'planning_ever_noon_ids' + ) + def _onchange_sync_lianan_role_employees(self): + lianan_role = self.env['planning.role'].search([('name', '=', '联安粮库')], limit=1) + target_employees = self.env['hr.employee'] + # A组 + for line in self.planning_a_ids: + if line.employee_id: + target_employees |= line.employee_id + # B组 + for line in self.planning_b_ids: + if line.employee_id: + target_employees |= line.employee_id + # C组 + for line in self.planning_c_ids: + if line.employee_id: + target_employees |= line.employee_id + # 常白班 + for line in self.planning_ever_white_ids: + if line.employee_id: + target_employees |= line.employee_id + # 常中班 + for line in self.planning_ever_noon_ids: + if line.employee_id: + target_employees |= line.employee_id + + target_resources = self.env['resource.resource'] + if target_employees: + target_resources = self.env['resource.resource'].search([ + ('id', 'in', target_employees.mapped('resource_id').ids) + ]) + + lianan_role.write({ + 'resource_ids': [(5, 0, 0)] + [(4, res_id, 0) for res_id in target_resources.ids] + }) + class YuthonShiftPlanningALine(models.Model): _name = 'yuthon.shift.planning.a.line' _description = '排班安排A组' diff --git a/yuthon_property_approval/wizard/property_reconciliation_wizard.py b/yuthon_property_approval/wizard/property_reconciliation_wizard.py index f002c4efb..d7eaffbfc 100644 --- a/yuthon_property_approval/wizard/property_reconciliation_wizard.py +++ b/yuthon_property_approval/wizard/property_reconciliation_wizard.py @@ -394,7 +394,7 @@ class PropertyReconciliationWizard(models.Model): final_remark = line.remake if line.collection_type != 'penalty': receivable.delivered1 = receivable.delivered1 + line.amount - if receivable.original_amount == round(receivable.delivered1, 2) + line.amount + round(receivable.discount_amount, 2) : + if receivable.original_amount == round(receivable.delivered1, 2) + round(receivable.discount_amount, 2) : deposit_state = 'paid' else: deposit_state = 'no_paid'