[IMP] sale: hide "Sign & Pay" button for expired draft quotations
Previously, draft quotations were never marked as expired. However, draft quotations can be viewed in the portal if you have the link. In order to prevent customers from paying for draft quotations, we now mark draft quotations as expired when applicable. task-3577657 closes odoo/odoo#144581 Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This commit is contained in:
committed by
Victor Feyens
parent
078903948f
commit
7e14f920da
@@ -593,7 +593,11 @@ class SaleOrder(models.Model):
|
||||
def _compute_is_expired(self):
|
||||
today = fields.Date.today()
|
||||
for order in self:
|
||||
order.is_expired = order.state == 'sent' and order.validity_date and order.validity_date < today
|
||||
order.is_expired = (
|
||||
order.state in ('draft', 'sent')
|
||||
and order.validity_date
|
||||
and order.validity_date < today
|
||||
)
|
||||
|
||||
@api.depends('company_id', 'fiscal_position_id')
|
||||
def _compute_tax_country_id(self):
|
||||
|
||||
Reference in New Issue
Block a user