Files
gzth/yuthon_property_approval/views/property_tenant_checkout_views.xml
T
2026-09-20 20:25:00 +08:00

216 lines
11 KiB
XML

<?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="contract_id"/>
<field name="tenant_unit"/>
<field name="state"/>
<field name="early_quitting_date"/>
</tree>
</field>
</record>
<!-- 表单视图:按工作流 state 字段控制各节点可见区块 -->
<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"/>
</group>
</group>
<!-- 已关联合同 · 关键信息自动带出(仅关联合同后显示,直接展开,全部只读) -->
<group string="已关联合同 · 关键信息自动带出" col="3" invisible="not contract_id">
<group>
<field name="lessee_id" readonly="1"/>
<field name="tenant_unit" readonly="1"/>
<field name="rent_address" readonly="1"/>
</group>
<group>
<field name="lessor_id" readonly="1"/>
<field name="contract_term_start" readonly="1"/>
</group>
<group>
<field name="contract_term_end" readonly="1"/>
<field name="deposit_amount" readonly="1"/>
</group>
</group>
<!-- ===== 节点一:申请人(state 为空或走到「申请人」节点时显示)===== -->
<group string="发起退租申请" invisible="state and state != '申请人'" col="1">
<group>
<!-- 申请人:默认自动带出当前登录用户,可手选他人代提交;流程监控的「创建人」取系统 create_uid,与此字段无关 -->
<field name="user_id" string="申请人" required="1"/>
<field name="contract_id" options="{'no_create': True}" required="1"/>
<!-- 退租原因(兼合同办理方式):驱动终止逻辑与表单显隐 -->
<field name="early_reason" required="1" widget="radio"/>
<!-- 退租日期:退租截止日期与退租日期统一使用此字段,所有退租原因均显示 -->
<field name="early_quitting_date" required="1"/>
<!-- 退租说明:进入终止/押金处理逻辑 -->
<field name="early_explain" widget="text"/>
<!-- 其��(补充说明) -->
<field name="other_note" widget="text"/>
</group>
</group>
<!-- 应收明细(仅「协商一致」且已填退租日期时显示) -->
<div invisible="early_reason != 'agree' or not early_quitting_date">
<notebook>
<page string="应收明细">
<field name="receivables_ids" string=" ">
<tree editable="bottom">
<field name="checkout_id" column_invisible="1"/>
<field name="receivable_id" column_invisible="1"/>
<field name="management_type_id"/>
<field name="due_date"/>
<field name="original_amount"/>
<field name="reduction_amount"/>
<field name="refund_amount"/>
<field name="is_reconciliation"/>
<field name="void"/>
</tree>
</field>
</page>
</notebook>
</div>
<!-- ===== 节点二:工程组(工程组检查 + 租户签字,同一节点)===== -->
<group string="工程组检查与确认" invisible="state not in ['工程组']" col="1">
<group>
<field name="inspection_ids">
<tree editable="bottom">
<field name="sequence" widget="handle"/>
<field name="item"/>
<field name="status"/>
<field name="note"/>
<field name="repair_fee"/>
</tree>
</field>
</group>
<group col="2">
<group>
<field name="site_photo" widget="many2many_binary"/>
<field name="handler"/>
</group>
<group>
<field name="engineering_sign" widget="signature" options="{'full_name': 'tenant_unit'}"/>
</group>
</group>
</group>
<!-- ===== 节点二附加:租户签字确认(与「工程组」同一节点,故条件同为工程组)===== -->
<group string="租户签字确认" invisible="state not in ['工程组']" col="2">
<group>
<field name="result_summary" widget="text"/>
<field name="tenant_signature" widget="signature" options="{'full_name': 'tenant_unit'}"/>
</group>
<group>
<field name="signer_name"/>
<field name="tenant_sign_date" readonly="1"/>
</group>
</group>
<!-- ===== 节点三:片区管理员(费用结算与复核)===== -->
<group string="费用结算与复核" invisible="state not in ['片区管理员']" col="1">
<group>
<field name="fee_ids">
<tree editable="bottom">
<field name="sequence" widget="handle"/>
<field name="item"/>
<field name="amount"/>
<field name="period"/>
<field name="remark"/>
</tree>
</field>
<field name="total_fee" readonly="1"/>
<field name="deposit_treatment"/>
<field name="deposit" readonly="1"/>
<field name="refund_amount" invisible="deposit_treatment != 'part_refund'"/>
<field name="forfeit" readonly="1" invisible="deposit_treatment != 'part_refund'"/>
<field name="total_receivables" readonly="1" invisible="deposit_treatment != 'part_refund'"/>
<field name="early_explain" widget="text" readonly="1"/>
</group>
<group col="2">
<group>
<field name="settlement_sign" widget="signature" options="{'full_name': 'tenant_unit'}"/>
</group>
</group>
</group>
<!-- ===== 节点四:财务管理员 ===== -->
<group string="财务处理" invisible="state not in ['财务管理员']" col="1">
<group>
<field name="fee_ids" readonly="1">
<tree>
<field name="item"/>
<field name="amount"/>
<field name="period"/>
<field name="remark"/>
</tree>
</field>
<field name="total_fee" readonly="1"/>
<field name="deposit_treatment" readonly="1"/>
</group>
<group col="2">
<group>
<field name="finance_handler"/>
<field name="finance_reviewer"/>
</group>
<group>
<field name="finance_person_in_charge"/>
<field name="finance_date"/>
</group>
</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>