添加功能

This commit is contained in:
李鹏宇
2026-09-20 20:25:00 +08:00
parent d3ed3e49bc
commit 63e93b39d6
16 changed files with 468 additions and 430 deletions
@@ -505,6 +505,55 @@
<field name="context">{'search_default_group_company_id': True, 'group_by': ['company_id', 'due_date:year', 'due_date:month'], 'orderedBy': [{'name': 'due_date', 'asc': False}]}</field>
<field name="search_view_id" ref="view_property_accounts_receivable_search"/>
<field name="view_id" ref="yuthon_property.view_property_accounts_receivable_tree"/>
</record>
<!-- 账单详情跳转专用:独立 tree + action,避免客户在「应收账单」菜单保存的默认分组影响 -->
<record id="view_property_accounts_receivable_tree_contract" model="ir.ui.view">
<field name="name">property.accounts.receivable.tree.contract</field>
<field name="model">property.accounts.receivable</field>
<field name="inherit_id" ref="yuthon_property.view_property_accounts_receivable_tree"/>
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<attribute name="default_order">due_date desc</attribute>
</xpath>
<xpath expr="//tree" position="inside">
<header>
<button name="all_red" string="红冲" type="object" class="btn btn-primary"/>
<button name="update_lessee_id" string="更新" type="object" class="btn btn-primary"/>
<button name="action_fix" string="修复关联" type="object" class="btn btn-primary"/>
</header>
</xpath>
<xpath expr="//button[@name='receivable_log_wizard']" position="before">
<field name="penalty_ratio_value" string="违约金比例" readonly="1" optional="show"/>
<button name="penalty_wizard" string="收款明细" type="object" class="btn btn-blue" invisible="is_penalty"/>
<button name="button_accounts_wizard" string="操作" type="object" class="btn btn-blue"/>
</xpath>
<xpath expr="//field[@name='remark']" position="after">
<field name="charging_range"/>
<field name="is_penalty" column_invisible="1"/>
<field name="property_name" width="350px"/>
<field name="property_ids" options="{'no_create': True}" widget="many2many_tags" column_invisible="1"/>
<field name="lessee_id" options="{'no_create': True}" readonly="1"/>
<field name="title_deed" readonly="1"/>
<field name="company_id" column_invisible="1"/>
<field name="last_month_table" column_invisible="1"/>
<field name="this_month_table" column_invisible="1"/>
<field name="ratio" column_invisible="1"/>
<field name="billable_quantity" column_invisible="1"/>
<field name="contract_id" string="合同编号" context="{'form_view_ref': 'yuthon_property_approval.view_property_lease_contract_form1'}"/>
</xpath>
<xpath expr="//field[@name='receivable_log']" position="after">
<field name="penalty"/>
<field name="penalty_date"/>
</xpath>
</field>
</record>
<record id="property_accounts_receivable_contract_action" model="ir.actions.act_window">
<field name="name">账单详情</field>
<field name="res_model">property.accounts.receivable</field>
<field name="view_mode">tree</field>
<field name="context">{'search_default_group_by_management_type_id': 1, 'group_by': 'management_type_id', 'orderedBy': [{'name': 'due_date', 'asc': False}]}</field>
<field name="search_view_id" ref="view_property_accounts_receivable_search"/>
<field name="view_id" ref="view_property_accounts_receivable_tree_contract"/>
</record>
<record id="property_accounts_penalty_action" model="ir.actions.act_window">
<field name="name">违约金列表</field>
@@ -432,7 +432,6 @@
string="生成租金" class="btn-primary"/>
<button name="button_lease_supplement" type="object" class="btn-primary" string="补充协议"/>
<button name="button_lease_change" type="object" class="btn-primary" string="变更"/>
<button name="refund_deposit" type="object" class="btn-primary" string="退押金"/>
<button name="action_copy_record1" type="object" string="拆分" class="btn-primary"/>
<button name="print_payment_notice" type="object" class="btn-primary" string="催缴单打印"/>
<button name="unlink" string="删除" type="object" icon="fa-trash" groups="base.group_system"
@@ -457,9 +456,7 @@
decoration-warning="deposit_status == 'no_paid'"/>
<field name="not_tax_amount"/>
<field name="rent"/>
<field name="not_received" decoration-muted="comparison == 'equal'"
decoration-danger="comparison == 'outweigh'"
decoration-success="comparison == 'less'"/>
<field name="not_received" decoration-danger="not_received > 0"/>
<field name="comparison" column_invisible="1"/>
<field name="percentage_damages"/>
<field name="total_receivable"/>
@@ -1143,7 +1140,7 @@
<field name="res_model">property.lease.contract</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('admin_id', '=', uid)]</field>
<field name="context">{'search_default_group_by_admin_id': True}</field>
<field name="context">{}</field>
<field name="view_ids" eval="[(5, 0, 0),
(0, 0, {'view_mode': 'tree', 'view_id': ref('yuthon_property_approval.view_property_lease_contract_tree1')}),
(0, 0, {'view_mode': 'form', 'view_id': ref('yuthon_property_approval.view_property_lease_contract_form1')})]"/>
@@ -73,7 +73,6 @@
</group>
<group string="变更信息" col="3">
<group>
<field name="early_quitting_date" invisible="renewal_type != 'early_checkout'"/>
<field name="new_lessee_id" invisible="renewal_type != 'lease'"/>
<field name="fee" invisible="renewal_type != 'lease'"/>
<field name="actual_end_date" invisible="renewal_type != 'extend'"/>
@@ -91,56 +90,12 @@
<group>
<!--<field name="reason"/>-->
<field name="effective_date" invisible="renewal_type != 'lease'"/>
<field name="early_reason" invisible="renewal_type != 'early_checkout'"/>
<field name="deposit_treatment" invisible="renewal_type != 'early_checkout'"/>
<field name="deposit" invisible="renewal_type != 'early_checkout'"/>
</group>
</group>
<group col="4">
<group>
<field name="refund_amount" invisible="deposit_treatment != 'part_refund'"/>
</group>
<group/>
<group/>
</group>
<group col="4">
<group>
<field name="total_receivables" invisible="deposit_treatment != 'part_refund'"/>
</group>
<group/>
<group/>
</group>
<group col="4">
<group>
<field name="forfeit" invisible="deposit_treatment != 'part_refund'"/>
</group>
<group/>
<group/>
</group>
<group>
<group>
<field name="early_explain" invisible="renewal_type != 'early_checkout'"/>
</group>
</group>
<group>
<field name="document_ids" widget="preview_many2many"/>
</group>
<notebook>
<page string="应收明细" invisible="renewal_type != 'early_checkout'">
<field name="receivables_ids" string=" ">
<tree editable="bottom">
<field name="renewal_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>
<page string="租金明细" invisible="renewal_type != 'extend' or ((state in ['分管领导', '总经理']) and (not work_end))">
<field name="breakdown_ids" string=" ">
<tree editable="bottom">
@@ -62,7 +62,7 @@
<field name="open_rent_id" column_invisible="1"/>
<field name="address_id"/>
<field name="admin_line_id" options="{'no_open': True}"/>
<field name="property_area"/>
<field name="property_area" digits="[16, 4]"/>
<field name="evaluate_unit_price"/>
<field name="message_standard_id"/>
<button name="open_record" string="详情" type="object" class="btn-primary"/>
@@ -11,7 +11,7 @@
<field name="contract_id"/>
<field name="tenant_unit"/>
<field name="state"/>
<field name="checkout_deadline"/>
<field name="early_quitting_date"/>
</tree>
</field>
</record>
@@ -53,43 +53,61 @@
</group>
</group>
<!-- 已关联合同 · 关键信息自动带出(各节点均可见,只读参考) -->
<group string="已关联合同 · 关键信息自动带出" col="3">
<!-- 已关联合同 · 关键信息自动带出(仅关联合同后显示,直接展开,全部只读) -->
<group string="已关联合同 · 关键信息自动带出" col="3" invisible="not contract_id">
<group>
<field name="lessee_id"/>
<field name="tenant_unit"/>
<field name="rent_address"/>
<field name="lessee_id" readonly="1"/>
<field name="tenant_unit" readonly="1"/>
<field name="rent_address" readonly="1"/>
</group>
<group>
<field name="lessor_id"/>
<field name="contract_code"/>
<field name="contract_term_start"/>
<field name="lessor_id" readonly="1"/>
<field name="contract_term_start" readonly="1"/>
</group>
<group>
<field name="contract_term_end"/>
<field name="deposit_amount"/>
<field name="contract_term_end" readonly="1"/>
<field name="deposit_amount" readonly="1"/>
</group>
</group>
<!-- ===== 节点一:申请人(state 为空或走到「申请人」节点时显示)===== -->
<group string="发起退租申请" invisible="state and state != '申请人'" col="2">
<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="checkout_deadline" required="1"/>
</group>
<group>
<field name="contract_handle_type" required="1"/>
</group>
<group>
<field name="checkout_reason" widget="text"/>
</group>
<group>
<!-- 退租原因(兼合同办理方式):驱动终止逻辑与表单显隐 -->
<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>
@@ -140,6 +158,11 @@
</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>