diff --git a/yuthon_property/models/property_accounts_receivable.py b/yuthon_property/models/property_accounts_receivable.py index b4a95d796..1699b886e 100644 --- a/yuthon_property/models/property_accounts_receivable.py +++ b/yuthon_property/models/property_accounts_receivable.py @@ -43,6 +43,13 @@ class PropertyAccountsReceivable(models.Model): bank_id = fields.Many2one('property.bank.statements', string='流水记录') receivable_log = fields.Text(string='应收日志') + def update_is_reconciliation(self): + record_ids = self.env["property.accounts.receivable"].browse( + self._context.get("active_ids", self._context.get("active_id")) + ) + for record in record_ids: + record.is_reconciliation = True + @api.depends('original_amount', 'delivered1') def compute_submitted(self): for record in self: diff --git a/yuthon_property/views/property_accounts_receivable_views.xml b/yuthon_property/views/property_accounts_receivable_views.xml index b7d0b5bc3..6fd53398b 100644 --- a/yuthon_property/views/property_accounts_receivable_views.xml +++ b/yuthon_property/views/property_accounts_receivable_views.xml @@ -39,6 +39,13 @@ code action = model.initialize_wizard() + + 更新已对账 + + + code + action = model.update_is_reconciliation() + 发票基本信息模板下载 self diff --git a/yuthon_property_approval/wizard/property_reconciliation_wizard.py b/yuthon_property_approval/wizard/property_reconciliation_wizard.py index 1ddfacb5a..c23e8e0e0 100644 --- a/yuthon_property_approval/wizard/property_reconciliation_wizard.py +++ b/yuthon_property_approval/wizard/property_reconciliation_wizard.py @@ -30,8 +30,9 @@ class PropertyReconciliationWizard(models.Model): for rec in self: rec.amount_reconciled = rec.actual_total - rec.amount_been_reconciled - sum(line.amount for line in rec.reconciliation_line_ids) for line in rec.reconciliation_line_ids: - if line.rent_month == line.amount and line.collection_type == 'rent' and line.due_date.year != rec.actual_date.year or line.due_date.month != rec.actual_date.month: - line.remake = str(rec.actual_date) + '补' + str(line.due_date) + if line.amount: + if line.rent_month == line.amount and line.collection_type == 'rent' and (line.due_date.year != rec.actual_date.year or line.due_date.month != rec.actual_date.month): + line.remake = str(rec.actual_date) + '补' + str(line.due_date) @api.depends('reconciliation_line_ids') def _compute_receivable_total(self):