diff --git a/yuthon_property_approval/__manifest__.py b/yuthon_property_approval/__manifest__.py index d1b631c8d..f44ff9408 100644 --- a/yuthon_property_approval/__manifest__.py +++ b/yuthon_property_approval/__manifest__.py @@ -121,7 +121,11 @@ 'report/property_open_rent_print_report.xml', 'report/property_open_rent_print_templates.xml', 'report/property_project_works_print_report.xml', - 'report/property_project_works_print_templates.xml' + 'report/property_project_works_print_templates.xml', + 'report/property_tenant_checkout_report.xml', + 'report/property_tenant_checkout_template.xml', + 'views/property_tenant_checkout_views.xml', + 'data/property_tenant_checkout_data.xml' ], diff --git a/yuthon_property_approval/data/property_tenant_checkout_data.xml b/yuthon_property_approval/data/property_tenant_checkout_data.xml new file mode 100644 index 000000000..b29cc14b8 --- /dev/null +++ b/yuthon_property_approval/data/property_tenant_checkout_data.xml @@ -0,0 +1,11 @@ + + + + + 租户退租表编号 + property_tenant_checkout_code + TC%(y)s%(month)s%(day)s + 3 + + + diff --git a/yuthon_property_approval/models/__init__.py b/yuthon_property_approval/models/__init__.py index 51944a381..7e1238066 100644 --- a/yuthon_property_approval/models/__init__.py +++ b/yuthon_property_approval/models/__init__.py @@ -65,3 +65,4 @@ from . import property_fee_spending from . import property_fee_form from . import receivable_modify_line from . import yuthon_property_task +from . import property_tenant_checkout diff --git a/yuthon_property_approval/models/property_tenant_checkout.py b/yuthon_property_approval/models/property_tenant_checkout.py new file mode 100644 index 000000000..81c0bc4c2 --- /dev/null +++ b/yuthon_property_approval/models/property_tenant_checkout.py @@ -0,0 +1,81 @@ +# -*- coding: utf-8 -*- +# Part of Odoo. See LICENSE file for full copyright and licensing details. + +from odoo import models, fields, api, exceptions, _ +from odoo.exceptions import UserError + + +class PropertyTenantCheckout(models.Model): + """租户退租表:物业客户服务中心与财务部联合验收结算的审批单(纯自由录入,不关联合同/承租方)""" + _name = 'property.tenant.checkout' + _description = '租户退租表' + _inherit = ['mail.thread.main.attachment', 'mail.activity.mixin', 'soong.workflow.mixin'] + _rec_name = 'name' + + # ===== 基础审批字段(沿用租赁变更审批的写法)===== + name = fields.Char(string='标题') # 审批单标题 + user_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user) # 当前登录用户为申请人 + department_id = fields.Many2one(related='user_id.department_id', string="部门") # 申请人所属部门 + company_id = fields.Many2one(related='user_id.company_id', string="公司") # 申请人所属公司 + code = fields.Char(string="编号", + default=lambda self: self.env['ir.sequence'].next_by_code('property_tenant_checkout_code')) # 流水号 + urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度', + default='normal') # 紧急程度 + name_title = fields.Char(default=lambda self: self._description or self._name) # 表单标题展示(取模型描述) + self_users_ids = fields.Many2many('res.users', string="当前经办人", default=lambda self: [(6, 0, [self.env.user.id])]) # 当前经办人 + + active = fields.Boolean('Active', default=True, tracking=True) # 归档标记 + work_end = fields.Boolean(string="结束") # 流程是否结束 + + document_ids = fields.Many2many('ir.attachment', string="附件") # 附件 + + # ===== 表头信息(纯自由录入)===== + tenant_unit = fields.Char(string='租户单元') # 如:4F东边01单元 + company_name = fields.Char(string='公司名称') # 承租方公司名称 + checkout_deadline = fields.Date(string='退租截止日期') # 退租截止日期 + handler = fields.Char(string='经办人') # 经办人 + + # ===== 客户服务中心 ===== + contract_handling = fields.Char(string='合同办理') # 合同办理说明 + contract_expiry = fields.Date(string='合同到期') # 合同到期日 + other_note = fields.Text(string='其它说明') # 其它说明(如保证金退回说明) + air_conditioner = fields.Char(string='空调机') # 空调机验收备注 + light_tube = fields.Char(string='光管') # 光管验收备注 + interior_decor = fields.Char(string='室内装修') # 室内装修验收备注 + other_equipment = fields.Char(string='其它设备') # 其它设备验收备注 + retrieve_keys = fields.Char(string='收回钥匙') # 收回钥匙验收备注 + electric_meter = fields.Char(string='电表') # 电表验收备注 + engineering_group = fields.Char(string='工程组') # 工程组 + center_person_in_charge = fields.Char(string='负责人') # 客户服务中心负责人 + inspection_date = fields.Date(string='验收日期') # 客户服务中心验收日期 + + # ===== 租户签字 ===== + tenant_sign_date = fields.Date(string='租户签字日期') # 租户签字确认日期 + tenant_signature = fields.Binary(string='租户电子签名') # 租户电子签名(PNG 图片,存手绘/打字/上传的签名) + + # ===== 财务部 ===== + rent_fee = fields.Char(string='房租') # 房租 + management_fee = fields.Char(string='管理费') # 管理费 + phone_fee = fields.Char(string='电话费') # 电话费 + utility_fee = fields.Char(string='水、电费') # 水、电费 + other_fee = fields.Char(string='其它费用') # 其它费用 + settlement = fields.Char(string='结算') # 结算 + finance_handler = fields.Char(string='财务部经办人') # 财务部经办人 + finance_reviewer = fields.Char(string='复核人') # 复核人 + finance_person_in_charge = fields.Char(string='财务部负责人') # 财务部负责人 + finance_date = fields.Date(string='财务日期') # 财务部日期 + + @api.onchange('tenant_signature') + def _onchange_tenant_signature(self): + """签名后自动填写签字日期;清除签名则清空日期(仅记录、不强制)""" + if self.tenant_signature: + self.tenant_sign_date = fields.Date.today() # 有签名则写入当天日期 + else: + self.tenant_sign_date = False # 无签名则清空日期 + + def action_print_tenant_checkout(self): + """打印租户退租表""" + self.ensure_one() + # 调用报表动作生成 PDF + report = self.env.ref('yuthon_property_approval.action_property_tenant_checkout_report') + return report.report_action(self) diff --git a/yuthon_property_approval/report/property_tenant_checkout_report.xml b/yuthon_property_approval/report/property_tenant_checkout_report.xml new file mode 100644 index 000000000..8bafd4b6a --- /dev/null +++ b/yuthon_property_approval/report/property_tenant_checkout_report.xml @@ -0,0 +1,25 @@ + + + + + + Property Tenant Checkout Small Top Margin + A4 + 5 + Portrait + + + + + 租户退租表 + + property.tenant.checkout + qweb-pdf + yuthon_property_approval.property_tenant_checkout_template + yuthon_property_approval.property_tenant_checkout_template + + report + '租户退租表_%s_%s' % (object.name or '', object.code or '') + + + diff --git a/yuthon_property_approval/report/property_tenant_checkout_template.xml b/yuthon_property_approval/report/property_tenant_checkout_template.xml new file mode 100644 index 000000000..b6a84ae59 --- /dev/null +++ b/yuthon_property_approval/report/property_tenant_checkout_template.xml @@ -0,0 +1,175 @@ + + + + diff --git a/yuthon_property_approval/security/ir.model.access.csv b/yuthon_property_approval/security/ir.model.access.csv index 2b242369f..21c08b4bf 100644 --- a/yuthon_property_approval/security/ir.model.access.csv +++ b/yuthon_property_approval/security/ir.model.access.csv @@ -145,4 +145,5 @@ access_property_business_type,property_business_type,model_property_business_typ access_property_payment_type,property_payment_type,model_property_payment_type,base.group_user,1,1,1,1 access_property_contract_rental_wizard,property_contract_rental_wizard,model_property_contract_rental_wizard,base.group_user,1,1,1,1 access_yuthon_property_task,yuthon_property_task,model_yuthon_property_task,base.group_user,1,1,1,1 -access_yuthon_property_task_confirm,yuthon_property_task_confirm,model_yuthon_property_task_confirm,base.group_user,1,1,1,1 \ No newline at end of file +access_yuthon_property_task_confirm,yuthon_property_task_confirm,model_yuthon_property_task_confirm,base.group_user,1,1,1,1 +access_property_tenant_checkout,property_tenant_checkout,model_property_tenant_checkout,base.group_user,1,1,1,1 \ No newline at end of file diff --git a/yuthon_property_approval/views/property_tenant_checkout_views.xml b/yuthon_property_approval/views/property_tenant_checkout_views.xml new file mode 100644 index 000000000..d5c157a45 --- /dev/null +++ b/yuthon_property_approval/views/property_tenant_checkout_views.xml @@ -0,0 +1,138 @@ + + + + + property.tenant.checkout.tree + property.tenant.checkout + + + + + + + + + + + + + + property.tenant.checkout.form + property.tenant.checkout + +
+
+ +
+ + + + + + + + + + + +
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + + 租户退租表 + property.tenant.checkout + tree,form + +
diff --git a/yuthon_work_brand/views/hr_menus.xml b/yuthon_work_brand/views/hr_menus.xml index d14b67bca..f7abfba31 100644 --- a/yuthon_work_brand/views/hr_menus.xml +++ b/yuthon_work_brand/views/hr_menus.xml @@ -1058,6 +1058,11 @@ name="借支申请表" parent="yuthon_property_process" action="yuthon_property_approval.view_property_borrowing_approval_action"/> +