diff --git a/yuthon_property/models/property_accounts_receivable.py b/yuthon_property/models/property_accounts_receivable.py index 8308e3f65..16a168f5e 100644 --- a/yuthon_property/models/property_accounts_receivable.py +++ b/yuthon_property/models/property_accounts_receivable.py @@ -33,6 +33,18 @@ class PropertyAccountsReceivable(models.Model): is_suspend = fields.Boolean(string='是否挂起') create_time = fields.Datetime(string='创建时间', default=fields.Datetime.now) is_reconciliation = fields.Boolean(string='对账') + is_overdue = fields.Boolean(string='是否逾期', compute='_compute_is_overdue', store=True) + + @api.depends('is_reconciliation', 'payout_date', 'due_date_end') + def _compute_is_overdue(self): + for rec in self: + 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) + ) + difference_amount = fields.Float(string='差额') print_date = fields.Date(string='打印日期') print_number = fields.Integer(string='打印次数')