diff --git a/yuthon_property_approval/models/inherit_yuthon_property.py b/yuthon_property_approval/models/inherit_yuthon_property.py
index 450bbd85b..3ce4a4d73 100644
--- a/yuthon_property_approval/models/inherit_yuthon_property.py
+++ b/yuthon_property_approval/models/inherit_yuthon_property.py
@@ -222,6 +222,7 @@ class PropertyBankStatements(models.Model):
)
contract_ids = tenant_lines.mapped('lease_contract_id.id')
contracts = self.env['property.lease.contract'].browse(contract_ids)
+ contracts = contracts.filtered(lambda c: c.contact_state != 'settle')
contract_set |= contracts
record.contract_ids = contract_set
record.admin_id = record.contract_ids[0].admin_id if record.contract_ids else False
diff --git a/yuthon_property_approval/models/property_bills_list.py b/yuthon_property_approval/models/property_bills_list.py
index 598347026..dea63f2d9 100644
--- a/yuthon_property_approval/models/property_bills_list.py
+++ b/yuthon_property_approval/models/property_bills_list.py
@@ -13,6 +13,7 @@ class PropertyBillsList(models.Model):
contract_id = fields.Many2one('property.lease.contract', string="合同编号")
lessee_id = fields.Many2one(related="contract_id.lessee_id", string="承租方", store=True)
property_name = fields.Char(related='contract_id.property_name', string="物业信息")
+ is_written = fields.Boolean(string="已核销", default=False)
def action_pay(self):
return {
diff --git a/yuthon_property_approval/views/inherit_yuthon_property_views.xml b/yuthon_property_approval/views/inherit_yuthon_property_views.xml
index 696f2a772..48c802a89 100644
--- a/yuthon_property_approval/views/inherit_yuthon_property_views.xml
+++ b/yuthon_property_approval/views/inherit_yuthon_property_views.xml
@@ -682,11 +682,11 @@
action = model.batch_revocation()
- 一次性时差更新
+ 同步合同编号
code
- action = model.test_one()
+ action = model.update_property_employee_id()
关联绑定承租方和合同
diff --git a/yuthon_property_approval/views/property_bills_list_views.xml b/yuthon_property_approval/views/property_bills_list_views.xml
index 070f04e1e..ad58d3419 100644
--- a/yuthon_property_approval/views/property_bills_list_views.xml
+++ b/yuthon_property_approval/views/property_bills_list_views.xml
@@ -13,7 +13,8 @@
-
+
+
diff --git a/yuthon_property_approval/wizard/property_bills_wizard.py b/yuthon_property_approval/wizard/property_bills_wizard.py
index 81441d0a2..db4f69e92 100644
--- a/yuthon_property_approval/wizard/property_bills_wizard.py
+++ b/yuthon_property_approval/wizard/property_bills_wizard.py
@@ -6,16 +6,18 @@ class PropertyBillsWizard(models.TransientModel):
_description = '应收账单弹窗'
bills_list_id = fields.Many2one('property.bills.list', string="账单")
- actual_date = fields.Date(string='实付日期')
+ actual_date = fields.Date(string='实付日期', default=fields.Date.today)
def confirm(self):
- self.bills_list_id.actual_date = self.actual_date
- receivable = self.env['property.accounts.receivable'].search([('contract_id', '=', self.bills_list_id.contract_id.id),
- ('management_type_id.name', '=', '押金')
- ])
- if receivable:
- receivable.write({'has_date': self.actual_date})
+ if self.actual_date:
+ self.bills_list_id.actual_date = self.actual_date
+ receivable = self.env['property.accounts.receivable'].search([('contract_id', '=', self.bills_list_id.contract_id.id),
+ ('management_type_id.name', '=', '押金')
+ ])
+ if receivable:
+ receivable.write({'has_date': self.actual_date})
self.bills_list_id.contract_id.contact_state = 'settle'
+ self.bills_list_id.is_written = True
self.bills_list_id.contract_id.compute_is_has()