@@ -38,12 +38,17 @@ class PropertyAccountsReceivable(models.Model):
|
||||
@api.depends('is_reconciliation', 'payout_date', 'due_date_end')
|
||||
def _compute_is_overdue(self):
|
||||
for rec in self:
|
||||
has_penalty = self.env['property.accounts.receivable'].search([
|
||||
('contract_id', '=', rec.contract_id.id),
|
||||
('due_date', '=', rec.payout_date),
|
||||
('management_type_id.name', '=', '违约金'),
|
||||
], limit=1)
|
||||
rec.is_overdue = (
|
||||
rec.is_reconciliation
|
||||
and rec.payout_date
|
||||
and (rec.due_date_end or rec.due_date)
|
||||
and rec.payout_date > (rec.due_date_end or rec.due_date)
|
||||
)
|
||||
and not has_penalty)
|
||||
|
||||
difference_amount = fields.Float(string='差额')
|
||||
print_date = fields.Date(string='打印日期')
|
||||
|
||||
Reference in New Issue
Block a user