@@ -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'
|
||||
|
||||
],
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<!-- 租户退租表流水号序列 -->
|
||||
<record id="property_tenant_checkout_code_sequence" model="ir.sequence">
|
||||
<field name="name">租户退租表编号</field>
|
||||
<field name="code">property_tenant_checkout_code</field>
|
||||
<field name="prefix">TC%(y)s%(month)s%(day)s</field>
|
||||
<field name="padding">3</field>
|
||||
<field name="company_id" eval="False"/>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data>
|
||||
<!-- 纸张:A4 窄上边距 -->
|
||||
<record id="paperformat_property_tenant_checkout_small" model="report.paperformat">
|
||||
<field name="name">Property Tenant Checkout Small Top Margin</field>
|
||||
<field name="format">A4</field>
|
||||
<field name="margin_top">5</field>
|
||||
<field name="orientation">Portrait</field>
|
||||
</record>
|
||||
|
||||
<!-- 报表动作 -->
|
||||
<record id="action_property_tenant_checkout_report" model="ir.actions.report">
|
||||
<field name="name">租户退租表</field>
|
||||
<field name="paperformat_id" ref="yuthon_property_approval.paperformat_property_tenant_checkout_small"/>
|
||||
<field name="model">property.tenant.checkout</field>
|
||||
<field name="report_type">qweb-pdf</field>
|
||||
<field name="report_name">yuthon_property_approval.property_tenant_checkout_template</field>
|
||||
<field name="report_file">yuthon_property_approval.property_tenant_checkout_template</field>
|
||||
<field name="binding_model_id" ref="model_property_tenant_checkout"/>
|
||||
<field name="binding_type">report</field>
|
||||
<field name="print_report_name">'租户退租表_%s_%s' % (object.name or '', object.code or '')</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
@@ -0,0 +1,175 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="property_tenant_checkout_template">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="doc">
|
||||
<t t-call="web.external_layout">
|
||||
<style type="text/css">
|
||||
table { border-collapse: collapse; width: 100%; max-width: 800px; margin: 0 auto; table-layout: fixed; }
|
||||
td { border: 1px solid #000; padding: 6px; text-align: center; vertical-align: middle; }
|
||||
.title {
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
padding: 8px 0;
|
||||
}
|
||||
.company { text-align: center; font-size: 12px; color: #555; margin-bottom: 4px; }
|
||||
.header-cell { font-weight: bold; background-color: #d4e6f1; }
|
||||
.section-header { background-color: #d4e6f1; text-align: center; }
|
||||
.text-left { text-align: left; }
|
||||
.no-right-border { border-right: none !important; }
|
||||
.no-left-border { border-left: none !important; }
|
||||
</style>
|
||||
|
||||
<!-- 公司抬头 -->
|
||||
<div class="company">广州市天河智慧城市服务有限公司</div>
|
||||
|
||||
<!-- 流水号 -->
|
||||
<div style="margin-bottom:8px; text-align:left; color:#999999;">
|
||||
流水号:<span t-esc="doc.code or ''"/>
|
||||
</div>
|
||||
|
||||
<!-- 标题 -->
|
||||
<div class="title">租 户 退 租 表</div>
|
||||
|
||||
<table>
|
||||
<colgroup>
|
||||
<col style="width:15%"/>
|
||||
<col style="width:35%"/>
|
||||
<col style="width:15%"/>
|
||||
<col style="width:35%"/>
|
||||
</colgroup>
|
||||
|
||||
<!-- 基本信息 -->
|
||||
<tr>
|
||||
<td class="header-cell"><strong>租户单元</strong></td>
|
||||
<td class="text-left"><span t-esc="doc.tenant_unit or ''"/></td>
|
||||
<td class="header-cell"><strong>公司名称</strong></td>
|
||||
<td class="text-left"><span t-esc="doc.company_name or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>退租截止日期</strong></td>
|
||||
<td class="text-left"><span t-esc="doc.checkout_deadline and doc.checkout_deadline.strftime('%Y-%m-%d') or ''"/></td>
|
||||
<td class="header-cell"><strong>经办人</strong></td>
|
||||
<td class="text-left"><span t-esc="doc.handler or ''"/></td>
|
||||
</tr>
|
||||
|
||||
<!-- 客户服务中心 -->
|
||||
<tr>
|
||||
<td colspan="4" class="section-header"><strong>客户服务中心</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>合同办理</strong></td>
|
||||
<td class="text-left"><span t-esc="doc.contract_handling or ''"/></td>
|
||||
<td class="header-cell"><strong>合同到期</strong></td>
|
||||
<td class="text-left"><span t-esc="doc.contract_expiry and doc.contract_expiry.strftime('%Y-%m-%d') or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>其它说明</strong></td>
|
||||
<td colspan="3" class="text-left"><span t-esc="doc.other_note or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>空调机</strong></td>
|
||||
<td class="text-left"><span t-esc="doc.air_conditioner or ''"/></td>
|
||||
<td class="header-cell"><strong>光管</strong></td>
|
||||
<td class="text-left"><span t-esc="doc.light_tube or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>室内装修</strong></td>
|
||||
<td class="text-left"><span t-esc="doc.interior_decor or ''"/></td>
|
||||
<td class="header-cell"><strong>其它设备</strong></td>
|
||||
<td class="text-left"><span t-esc="doc.other_equipment or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>收回钥匙</strong></td>
|
||||
<td class="text-left"><span t-esc="doc.retrieve_keys or ''"/></td>
|
||||
<td class="header-cell"><strong>电表</strong></td>
|
||||
<td class="text-left"><span t-esc="doc.electric_meter or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>工程组</strong></td>
|
||||
<td class="text-left"><span t-esc="doc.engineering_group or ''"/></td>
|
||||
<td class="header-cell"><strong>负责人</strong></td>
|
||||
<td class="text-left"><span t-esc="doc.center_person_in_charge or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>验收日期</strong></td>
|
||||
<td colspan="3" class="text-left"><span t-esc="doc.inspection_date and doc.inspection_date.strftime('%Y-%m-%d') or ''"/></td>
|
||||
</tr>
|
||||
|
||||
<!-- 租户签字确认 -->
|
||||
<tr>
|
||||
<td colspan="4" class="section-header"><strong>租户签字确认</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>租户签字日期</strong></td>
|
||||
<td colspan="3" class="text-left"><span t-esc="doc.tenant_sign_date and doc.tenant_sign_date.strftime('%Y-%m-%d') or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>租户电子签名</strong></td>
|
||||
<td colspan="3" class="text-left">
|
||||
<!-- 有签名时显示签名图,二进制字段为 base64 字符串,需拼 data URI -->
|
||||
<img t-if="doc.tenant_signature" t-att-src="'data:image/png;base64,' + doc.tenant_signature" style="max-height:80px;"/>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- 财务部 -->
|
||||
<tr>
|
||||
<td colspan="4" class="section-header"><strong>财务部</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>房租</strong></td>
|
||||
<td class="text-left"><span t-esc="doc.rent_fee or ''"/></td>
|
||||
<td class="header-cell"><strong>管理费</strong></td>
|
||||
<td class="text-left"><span t-esc="doc.management_fee or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>电话费</strong></td>
|
||||
<td class="text-left"><span t-esc="doc.phone_fee or ''"/></td>
|
||||
<td class="header-cell"><strong>水、电费</strong></td>
|
||||
<td class="text-left"><span t-esc="doc.utility_fee or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>其它费用</strong></td>
|
||||
<td class="text-left"><span t-esc="doc.other_fee or ''"/></td>
|
||||
<td class="header-cell"><strong>结算</strong></td>
|
||||
<td class="text-left"><span t-esc="doc.settlement or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>经办人</strong></td>
|
||||
<td class="text-left"><span t-esc="doc.finance_handler or ''"/></td>
|
||||
<td class="header-cell"><strong>复核人</strong></td>
|
||||
<td class="text-left"><span t-esc="doc.finance_reviewer or ''"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="header-cell"><strong>负责人</strong></td>
|
||||
<td class="text-left"><span t-esc="doc.finance_person_in_charge or ''"/></td>
|
||||
<td class="header-cell"><strong>日期</strong></td>
|
||||
<td class="text-left"><span t-esc="doc.finance_date and doc.finance_date.strftime('%Y-%m-%d') or ''"/></td>
|
||||
</tr>
|
||||
|
||||
<!-- 审批详情 -->
|
||||
<tr>
|
||||
<td colspan="4" class="section-header"><strong>审批详情</strong></td>
|
||||
</tr>
|
||||
<t t-if="doc.log_ids">
|
||||
<t t-set="logs_ordered" t-value="doc.get_logs_for_print()"/>
|
||||
<t t-foreach="logs_ordered" t-as="log">
|
||||
<tr>
|
||||
<td colspan="1"><span t-esc="log.name or '节点'"/></td>
|
||||
<td class="no-right-border" colspan="2"><span t-esc="log.comment or ''"/></td>
|
||||
<td class="no-left-border" colspan="1">
|
||||
<t t-if="log.done_by">
|
||||
<span t-esc="log.done_by.name"/>
|
||||
<span t-esc="log.lase_click_date and log.lase_click_date.strftime('%Y-%m-%d') or ''"/>
|
||||
</t>
|
||||
</td>
|
||||
</tr>
|
||||
</t>
|
||||
</t>
|
||||
</table>
|
||||
</t>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
</odoo>
|
||||
@@ -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
|
||||
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
|
||||
|
@@ -0,0 +1,138 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<odoo>
|
||||
<!-- 列表视图 -->
|
||||
<record id="view_property_tenant_checkout_tree" model="ir.ui.view">
|
||||
<field name="name">property.tenant.checkout.tree</field>
|
||||
<field name="model">property.tenant.checkout</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="租户退租表">
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="tenant_unit"/>
|
||||
<field name="company_name"/>
|
||||
<field name="checkout_deadline"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- 表单视图 -->
|
||||
<record id="view_property_tenant_checkout_form" model="ir.ui.view">
|
||||
<field name="name">property.tenant.checkout.form</field>
|
||||
<field name="model">property.tenant.checkout</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="租户退租表" create="0">
|
||||
<header>
|
||||
<!-- 打印按钮:流程结束后才允许打印 -->
|
||||
<button name="action_print_tenant_checkout" string="打印" type="object" class="btn-primary"
|
||||
invisible="not work_end"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<!-- 流水号 / 紧急度 / 标题 -->
|
||||
<group col="3">
|
||||
<group>
|
||||
<field name="code" string="流水号" readonly="1"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="urgency_level" readonly="1"/>
|
||||
</group>
|
||||
<group/>
|
||||
</group>
|
||||
<div class="col-12 text-center">
|
||||
<h1>
|
||||
<field name="name_title" readonly="1"/>
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<!-- 审批事项 -->
|
||||
<group string="审批事项">
|
||||
<group>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="work_end" invisible="1"/>
|
||||
<field name="name" required="1"/>
|
||||
<field name="company_id" invisible="1"/>
|
||||
<field name="department_id" invisible="1"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<!-- 表头信息 -->
|
||||
<group string="表头信息" col="3">
|
||||
<group>
|
||||
<field name="tenant_unit"/>
|
||||
<field name="company_name"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="checkout_deadline"/>
|
||||
<field name="handler"/>
|
||||
</group>
|
||||
<group/>
|
||||
</group>
|
||||
|
||||
<!-- 客户服务中心 -->
|
||||
<group string="客户服务中心" col="3">
|
||||
<group>
|
||||
<field name="contract_handling"/>
|
||||
<field name="contract_expiry"/>
|
||||
<field name="other_note" widget="text"/>
|
||||
<field name="air_conditioner"/>
|
||||
<field name="light_tube"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="interior_decor"/>
|
||||
<field name="other_equipment"/>
|
||||
<field name="retrieve_keys"/>
|
||||
<field name="electric_meter"/>
|
||||
<field name="engineering_group"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="center_person_in_charge"/>
|
||||
<field name="inspection_date"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<!-- 租户签字 -->
|
||||
<group string="租户签字确认" col="2">
|
||||
<group>
|
||||
<field name="tenant_sign_date"/>
|
||||
</group>
|
||||
<group>
|
||||
<!-- 电子签名控件:手绘/打字/上传三合一;full_name 自动带出公司名称作为打字签名默认值 -->
|
||||
<field name="tenant_signature" widget="signature" options="{'full_name': 'company_name'}"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<!-- 财务部 -->
|
||||
<group string="财务部" col="3">
|
||||
<group>
|
||||
<field name="rent_fee"/>
|
||||
<field name="management_fee"/>
|
||||
<field name="phone_fee"/>
|
||||
<field name="utility_fee"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="other_fee"/>
|
||||
<field name="settlement"/>
|
||||
<field name="finance_handler"/>
|
||||
<field name="finance_reviewer"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="finance_person_in_charge"/>
|
||||
<field name="finance_date"/>
|
||||
</group>
|
||||
</group>
|
||||
|
||||
<!-- 附件 -->
|
||||
<group>
|
||||
<field name="document_ids" widget="preview_many2many"/>
|
||||
</group>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- 动作 -->
|
||||
<record id="property_tenant_checkout_action" model="ir.actions.act_window">
|
||||
<field name="name">租户退租表</field>
|
||||
<field name="res_model">property.tenant.checkout</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
</odoo>
|
||||
@@ -1058,6 +1058,11 @@
|
||||
name="借支申请表"
|
||||
parent="yuthon_property_process"
|
||||
action="yuthon_property_approval.view_property_borrowing_approval_action"/>
|
||||
<menuitem id="yuthon_property_tenant_checkout_menu"
|
||||
sequence="22"
|
||||
name="租户退租表"
|
||||
parent="yuthon_property_process"
|
||||
action="yuthon_property_approval.property_tenant_checkout_action"/>
|
||||
<menuitem id="yuthon_property_process_setting"
|
||||
sequence="99"
|
||||
name="配置"
|
||||
|
||||
Reference in New Issue
Block a user