diff --git a/soong_workflow/models/soong_workflow_log.py b/soong_workflow/models/soong_workflow_log.py index 1e96d2df2..a01265233 100644 --- a/soong_workflow/models/soong_workflow_log.py +++ b/soong_workflow/models/soong_workflow_log.py @@ -16,7 +16,7 @@ class SoongWorkflowLog(models.Model): "unique(model, res_id, node_btn_id)", _("Workflow log must be unique."),), ] - name = fields.Char(string="节点名称", compute="_compute_name") + name = fields.Char(string="节点名称", compute="_compute_name", store=True) model = fields.Char(string="Related Document Model", index=True, required=True) res_id = fields.Integer(string="Related Document ID", index=True, required=True) @@ -30,6 +30,11 @@ class SoongWorkflowLog(models.Model): done_by = fields.Many2one(comodel_name="res.users", string="审批人") lase_click_date = fields.Datetime(string="操作时间") + approval_state = fields.Selection([ + ('0', '未审批'), + ('1', '审批中'), + ('2', '审批通过'), + ], string='审批状态', default='0') comment = fields.Char(string="意见") @api.depends("workflow_id", "node_id", "node_btn_id") diff --git a/soong_workflow/models/soong_workflow_mixin.py b/soong_workflow/models/soong_workflow_mixin.py index e619b56c1..538a6f001 100644 --- a/soong_workflow/models/soong_workflow_mixin.py +++ b/soong_workflow/models/soong_workflow_mixin.py @@ -155,7 +155,7 @@ class SoongWorkflowMixin(models.AbstractModel): ("res_id", "=", self.id), ("node_id", "=", btn_rec.node_id.id), ("workflow_id", "=", btn_rec.workflow_id.id), - ("node_btn_id", "=", btn_rec.id), + # ("node_btn_id", "=", btn_rec.id), ] ) if not record_obj: @@ -165,12 +165,12 @@ class SoongWorkflowMixin(models.AbstractModel): "res_id": self.id, "node_id": btn_rec.node_id.id, "workflow_id": btn_rec.workflow_id.id, - "node_btn_id": btn_rec.id, + # "node_btn_id": btn_rec.id, "done_by": self.env.uid, "lase_click_date": fields.Datetime.now(), } ) - record_obj.update({"done_by": self.env.uid, "lase_click_date": fields.Datetime.now()}) + record_obj.update({"node_btn_id": btn_rec.id, "done_by": self.env.uid, "approval_state": "2", "lase_click_date": fields.Datetime.now()}) return record_obj def btn_exec_action(self): @@ -647,6 +647,7 @@ class SoongWorkflowMixin(models.AbstractModel): state_el = etree.Element("field") state_el.set("name", "state") state_el.set("widget", "statusbar") + state_el.set("invisible", "1") # Loop all nodes for node in wkf_rec.node_ids: # Read Visible States diff --git a/soong_workflow/templates/soong_workflow_templates.xml b/soong_workflow/templates/soong_workflow_templates.xml index fcaba63a2..ebedb1731 100644 --- a/soong_workflow/templates/soong_workflow_templates.xml +++ b/soong_workflow/templates/soong_workflow_templates.xml @@ -9,6 +9,7 @@ + diff --git a/soong_workflow/wizard/soong_workflow_comment_wizard.py b/soong_workflow/wizard/soong_workflow_comment_wizard.py index fb1c23f4b..c05f0ae2d 100644 --- a/soong_workflow/wizard/soong_workflow_comment_wizard.py +++ b/soong_workflow/wizard/soong_workflow_comment_wizard.py @@ -145,6 +145,31 @@ class SoongWorkflowCommentWizard(models.TransientModel): fields.Datetime.now() + timedelta( hours=8)), url=url, btntxt="查看详情") + # 转交创建记录 + log_obj = self.env["soong.workflow.log"] + next_node_id = record_id.workflow_id.node_ids.search( + [('name', '=', self.trans_link_id.name), ('workflow_id', '=', record_id.workflow_id.id)]) + record_obj = log_obj.search( + [ + ("model", "=", self.res_model), + ("res_id", "=", self.res_id), + ("node_id", "=", next_node_id.id), + ("workflow_id", "=", record_id.workflow_id.id), + # ("node_btn_id", "=", record_id.node_btn_id.id), + ] + ) + if not record_obj: + record_obj = log_obj.create( + { + "model": self.res_model, + "res_id": self.res_id, + "node_id": next_node_id.id, + "workflow_id": self.node_btn_id.workflow_id.id, + # "node_btn_id": self.node_btn_id.id, + # "lase_click_date": fields.Datetime.now(), + } + ) + record_obj.update({"approval_state": "1"}) # partner_ids = self.employee_ids.user_id.partner_id.ids # self.with_context(lang=self.env.lang)._message_auto_subscribe_notify(partner_ids, 'soong_workflow.message_soong_workflow_distribute') return self.node_btn_id.with_context(cx).run() diff --git a/soong_workflow/wizard/soong_workflow_comment_wizard_view.xml b/soong_workflow/wizard/soong_workflow_comment_wizard_view.xml index 410b78ddc..9d94d3ec4 100644 --- a/soong_workflow/wizard/soong_workflow_comment_wizard_view.xml +++ b/soong_workflow/wizard/soong_workflow_comment_wizard_view.xml @@ -9,7 +9,7 @@ - + @@ -22,7 +22,7 @@ - + diff --git a/yuthon_hr_attendance/controllers/portal.py b/yuthon_hr_attendance/controllers/portal.py index fde194f5c..b5fc13394 100644 --- a/yuthon_hr_attendance/controllers/portal.py +++ b/yuthon_hr_attendance/controllers/portal.py @@ -22,7 +22,7 @@ class CustomerPortal(portal.CustomerPortal): 'report_type': 'html', 'res_company': attendance_sudo.employee_id.user_id.company_id, } - return request.render('hr_attendance_ext.attendance_month_portal_template', values) + return request.render('yuthon_hr_attendance.attendance_month_portal_template', values) @http.route(['/my/attendance/month/detail//accept'], type='json', auth="public", website=True) def portal_attendance_month_detail_quote_accept(self, attendance_id, access_token=None, name=None, signature=None): diff --git a/yuthon_hr_attendance/models/hr_attendance_month.py b/yuthon_hr_attendance/models/hr_attendance_month.py index d8a6d295c..a18525282 100644 --- a/yuthon_hr_attendance/models/hr_attendance_month.py +++ b/yuthon_hr_attendance/models/hr_attendance_month.py @@ -91,18 +91,23 @@ class HrAttendanceMonthDetail(models.Model): ('11', '11月份'), ('12', '12月份') ], string="考勤月份") - # todo 需要什么字段往上加什么 required_attendance_days = fields.Float(string="应出勤天数") actual_attendance_days = fields.Float(string="实际出勤天数") compensatory_leave = fields.Float(string="调休(小时)") leave_of_absence = fields.Float(string="事假(小时)") leave_of_sick = fields.Float(string="病假(天)") - come_late = fields.Float(string="迟到(次)") - work_overtime = fields.Float(string="加班(小时)") statutory_leave = fields.Float(string="法定假(天)") + work_overtime = fields.Float(string="加班(小时)") + # todo 需要什么字段往上加什么 + # 打卡 + come_late = fields.Float(string="迟到(次)") + is_early_card = fields.Float(string="早退(次)") + is_no_card = fields.Float(string="缺卡(次)") + # 假期 + unpaid_leave = fields.Float(string="无薪假(小时)") + note = fields.Char(string='备注') - hr_attendance_month_id = fields.Many2one('hr.attendance.month', string="出勤月度汇总", ondelete="cascade", readonly=True) company_id = fields.Many2one(related="hr_attendance_month_id.company_id") signature = fields.Image(string="签名", copy=False, attachment=True, max_width=1024, max_height=1024) @@ -131,7 +136,8 @@ class HrAttendanceMonthDetail(models.Model): url = self.env['ir.config_parameter'].sudo().get_param('web.base.url') attendance_url = "{0}/my/attendance/month/detail/{1}".format(str(url), str(record.id)) message = '您的{0}年{1}月的考勤已生成 \n 点击查看 '.format(str(record.current_year), str(record.current_month), str(attendance_url)) - self.env['wx.work.api'].sudo().send_text_message(user_id, message) + # self.env['wx.work.api'].sudo().send_text_message(user_id, message) + self.sudo().env["wecom.apps"].sync_send_message(category='att', user_id=user_id, message=message) def _compute_access_url(self): super()._compute_access_url() @@ -220,19 +226,24 @@ class HrAttendanceMonthDetail(models.Model): """ self.ensure_one() days = calendar.monthrange(int(self.current_year), int(self.current_month))[1] - come_late = 0 + is_late_card = 0 + is_early_card = 0 + is_no_card = 0 for n in range(days): # 根据出勤时间判断是否打卡 current_date = datetime.date(int(self.current_year), int(self.current_month), n + 1) attendance_obj = self.env["hr.attendance"].sudo().search([('employee_id', '=', employee.id), ("current_data", '=', current_date)]) - is_come_late = False for obj in attendance_obj: - if obj.is_come_late(): - # 当天有打卡记录说明已经出勤 - is_come_late = True - if is_come_late is True: - come_late += 1 - return come_late + # 迟到 + if obj.is_late_card: + is_late_card += 1 + # 早退 + if obj.is_early_card: + is_early_card += 1 + # 缺卡 + if obj.is_no_card: + is_no_card += 1 + return is_late_card, is_early_card, is_no_card def _hr_attendance_month_detail_action(self): """ @@ -294,7 +305,7 @@ class HrAttendanceMonthDetail(models.Model): ('date_to', '>=', date_start) ] if type_list: - domain.append(('holiday_status_id.holiday_type', 'in', type_list)) + domain.append(('holiday_status_id.name', 'in', type_list)) hr_leaves = self.env['hr.leave'].sudo().search(domain) hours = 0.0 days = 0.0 @@ -316,41 +327,21 @@ class HrAttendanceMonthDetail(models.Model): # 排班的进行统计 if self.employee_id.default_planning_role_id: # todo 需要什么字段往上加什么 - # # 应出勤天数 - # required_attendance_days = self._get_planning_required_attendance_days(self.employee_id) - # self.required_attendance_days = required_attendance_days - # # 实际出勤天数 - # actual_attendance_days = self._get_actual_attendance_days(self.employee_id) - # self.actual_attendance_days = actual_attendance_days - # 迟到(次):上班时间 < 上班打卡时间 - come_late = self._get_come_late(self.employee_id) - self.come_late = come_late + # 迟到, 早退, 缺卡 + self.come_late, self.is_early_card, self.is_no_card = self._get_come_late(self.employee_id) + # 无薪假:hr.leave表 + days, hours = self._get_hr_leave_type(self.employee_id, ['无薪假']) + self.unpaid_leave = hours + # 行政的进行统计 if not self.employee_id.default_planning_role_id: # todo 需要什么字段往上加什么 - # # 应出勤天数 - # required_attendance_days = self._get_required_attendance_days(self.employee_id) - # self.required_attendance_days = required_attendance_days - # # 实际出勤天数 - # actual_attendance_days = self._get_actual_attendance_days(self.employee_id) - # self.actual_attendance_days = actual_attendance_days - # # 调休(小时):取员工表上字段 - # work_overtime, compensatory_leave = self._get_overtime_annual_summary(self.employee_id) - # self.compensatory_leave = compensatory_leave - # # 事假(小时):hr.leave表 - # days, hours = self._get_hr_leave_type(self.employee_id, ['personal']) - # self.leave_of_absence = hours + days * 8 - # # 病假(天):hr.leave表 - # days, hours = self._get_hr_leave_type(self.employee_id, ['sick']) - # self.leave_of_sick = hours // 8 + days - # 迟到(次):上班时间 < 上班打卡时间 - come_late = self._get_come_late(self.employee_id) - self.come_late = come_late - # # 加班(小时):取员工表上字段 - # self.work_overtime = work_overtime - # 法定假(天):hr.leave表 - # days, hours = self._get_hr_leave_type(self.employee_id, ['marriage', 'maternity', 'paternity', 'funeral', 'parental']) - # self.statutory_leave = hours // 8 + days + # 迟到, 早退, 缺卡 + self.come_late, self.is_early_card, self.is_no_card = self._get_come_late(self.employee_id) + # 无薪假:hr.leave表 + days, hours = self._get_hr_leave_type(self.employee_id, ['无薪假']) + self.unpaid_leave = hours + return True def update_attendance_month(self): diff --git a/yuthon_hr_attendance/views/hr_attendance_month_views.xml b/yuthon_hr_attendance/views/hr_attendance_month_views.xml index 128f17563..5f2124530 100644 --- a/yuthon_hr_attendance/views/hr_attendance_month_views.xml +++ b/yuthon_hr_attendance/views/hr_attendance_month_views.xml @@ -67,20 +67,17 @@ - - - - - - + + - - + + + + + - - diff --git a/yuthon_hr_attendance/views/hr_attendance_portal_templates.xml b/yuthon_hr_attendance/views/hr_attendance_portal_templates.xml index f62344880..d810ae870 100644 --- a/yuthon_hr_attendance/views/hr_attendance_portal_templates.xml +++ b/yuthon_hr_attendance/views/hr_attendance_portal_templates.xml @@ -15,29 +15,17 @@ - - 应出勤天数:天 - - - 实际出勤天数:天 - - - 调休(小时):小时 - - - 事假(小时):小时 - - - 病假(天):天 - 迟到(次):次 - 加班(小时):小时 + 早退(次):次 - 法定假(天):天 + 缺卡(次):次 + + + 无薪假(小时):小时 diff --git a/yuthon_property/models/property_tenant_information.py b/yuthon_property/models/property_tenant_information.py index 67d5442c6..226fc8938 100644 --- a/yuthon_property/models/property_tenant_information.py +++ b/yuthon_property/models/property_tenant_information.py @@ -13,7 +13,7 @@ class PropertyTenantInformation(models.Model): phone = fields.Char(string='联系电话') home_phone = fields.Char(string='座机') email = fields.Char(string='电子邮箱') - address = fields.Text(string='送达地址') + address = fields.Char(string='送达地址') scope_business = fields.Char(string='经营范围') invoicing_type = fields.Selection([('spot', '专票'), ('cape', '普票')], string="开票类型") rental_purposes = fields.Many2one('yuthon.rental.purpose', string="出租用途") diff --git a/yuthon_property_approval/models/property_lease_contract.py b/yuthon_property_approval/models/property_lease_contract.py index 2010fd47b..136037672 100644 --- a/yuthon_property_approval/models/property_lease_contract.py +++ b/yuthon_property_approval/models/property_lease_contract.py @@ -49,7 +49,7 @@ class PropertyLeaseContract(models.Model): invoicing_begins = fields.Char(related='lessee_id.invoicing_begins', string="开票抬头") tax_number = fields.Char(related='lessee_id.tax_number', string="税号") industry = fields.Char(related='lessee_id.industry', string="行业") - address_for_delivery = fields.Text(string="送达地址") + address_for_delivery = fields.Char(string="送达地址") lease_term = fields.Float(string="租期") lease_term_year = fields.Integer(string="租期(年)") @@ -86,7 +86,7 @@ class PropertyLeaseContract(models.Model): rent = fields.Float(string="租金", help='第一笔合同的应收') total_contract_receivables = fields.Float(string="合同总应收") tax_rate = fields.Many2one('yuthon.tariff.setting', string="税率") - use_address = fields.Char(string="使用地址") + use_address = fields.Char(string="财务专用地址") not_tax_amount = fields.Float(string="不含税价") tax = fields.Float(string="税金") is_water = fields.Boolean(string="是否有水费") diff --git a/yuthon_property_approval/views/property_lease_contract.xml b/yuthon_property_approval/views/property_lease_contract.xml index d60caeba0..607724486 100644 --- a/yuthon_property_approval/views/property_lease_contract.xml +++ b/yuthon_property_approval/views/property_lease_contract.xml @@ -28,6 +28,7 @@ string="生成租金费用"/> + @@ -42,28 +43,28 @@ - + - + - + - - + + - + - + @@ -75,7 +76,7 @@ - + @@ -98,6 +99,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -117,16 +148,15 @@ - - - - + + + + - - - - + + + @@ -140,32 +170,32 @@ - + 年 - + 月 - - - - - + + + + + - - + + - - + + - + 月 - + 日 @@ -187,6 +217,31 @@ + + + + + + 单价 + + + + + 违约金比例 + + + + + + + @@ -291,28 +346,29 @@ - + - + - + - - + + + - + - + @@ -324,7 +380,7 @@ - + @@ -347,118 +403,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 年 - - 月 - - - - - - - - - - - - - - - - - - - - - 月 - - 日 - - - - - - - - - - - - - - - - - - - - - - - - - - - - 年开始,每 - 年递增 - 递增数额 - - - - - - - - - - - - - - @@ -497,7 +441,180 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 年 + + 月 + + + + + + + + + + + + + + + + + + + + + 月 + + 日 + + + + 年开始,每 + 年递增 + + + + 递增数额 + + + + + + + + + + + + + + + + + 金额 + + + + + + + + + + + + 单价 + + + + + + + + 年开始,每 + 年递增 + 递增数额 + + + + + + + + + + + + 金额 + + + + + + + + + + 单价 + + + + + 违约金比例 + + + + + + + + + @@ -524,7 +641,7 @@ 合同审批 property.lease.contract tree,form,search - [('condition','=','new')] + [('condition','=','new')] @@ -612,7 +729,7 @@ code action = model.action_use_address() - + 调换