diff --git a/yuthon_property/models/property_bank_statements.py b/yuthon_property/models/property_bank_statements.py index 973553a95..ac5f34639 100644 --- a/yuthon_property/models/property_bank_statements.py +++ b/yuthon_property/models/property_bank_statements.py @@ -156,6 +156,7 @@ class PropertyBankStatements(models.Model): contract_ids.append(record.contract_id.id) contract_ids = list(set(contract_ids)) + write_vals = { 'contract_ids': [(6, 0, contract_ids)] if contract_ids else [(5,)] } diff --git a/yuthon_property_approval/models/inherit_yuthon_property.py b/yuthon_property_approval/models/inherit_yuthon_property.py index ae628d0aa..125f8db37 100644 --- a/yuthon_property_approval/models/inherit_yuthon_property.py +++ b/yuthon_property_approval/models/inherit_yuthon_property.py @@ -925,7 +925,7 @@ class PropertyAccountsReceivable(models.Model): for statement in statements: statement.write({'bank_state': 'not_reconciled'}) - # 批量退回 + # 批量退回 def action_refuse_all(self): model_type_data = { '水费': 'meter.water.line', @@ -955,13 +955,10 @@ class PropertyAccountsReceivable(models.Model): ('meter_date', '<=', last_day) ]) else: - year = rec.due_date.year - month = rec.due_date.month - first_day = date(year, month, 1) - last_day = first_day - timedelta(days=1) + last_day = rec.due_date + relativedelta(months=1) - timedelta(days=1) model_id = self.env[model_type].search([ ('contract_id', '=', rec.contract_id.id), - ('due_date', '>=', first_day), + ('due_date', '>=', rec.due_date), ('due_date', '<=', last_day) ])