添加功能

This commit is contained in:
李鹏宇
2025-11-14 20:13:15 +08:00
parent 8f15ed5c08
commit 4a56930121
2 changed files with 28 additions and 3 deletions
@@ -70,7 +70,8 @@
<notebook>
<page string="审批详情">
<field name="log_ids" style="width:100%%; margin-top: 10px;" domain="[('node_btn_name', '!=', '1')]" mode="kanban,tree" context="{'kanban_view_ref':'soong_workflow.soong_workflow_log_kanban'}">
<tree create="false" edit="false" delete="false" editable="bottom" decoration-danger="node_btn_name == '1'">
<tree create="false" edit="false" delete="false" editable="bottom"
decoration-danger="node_btn_name == '1'">
<field name="sequence" string="" column_invisible="1"/>
<field name="name" string="" readonly="0"/>
<field name="comment" string=""/>
@@ -136,6 +136,30 @@ class BindingInformationWizard(models.Model):
'name': name,
})
bank_id._compute_property_employee_id()
else:
raise UserError('请先输入该户名银行账号,才能绑定')
current_bank_contracts = self.bank_id.contract_ids
new_contracts = self.contract_ids - current_bank_contracts
if new_contracts:
self.bank_id.write({
'contract_ids': [(4, cont.id) for cont in new_contracts] # 添加新增合同
})
removed_contracts = current_bank_contracts - self.available_contract_ids
if removed_contracts:
self.bank_id.write({
'contract_ids': [(3, cont.id) for cont in removed_contracts] # 删除移除的合同
})
else:
first_contract = self.contract_ids[0]
lessee_id = first_contract.lessee_id
bank_line = self.env['property.bank.line'].search(
[('tenant_id', '=', lessee_id.id)],
limit=1
)
name = bank_line.bank
if not bank_line or not bank_line.bank:
raise UserError(f"承租方【{lessee_id.name}】未填写银行账号,请补全信息后再操作!")
self.bank_id.write({
'contract_ids': [(6, 0, self.contract_ids.ids)],
'name': name,
})