mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[IMP] - can't upsell or downsell a resiliated contract
This commit is contained in:
@@ -50,6 +50,17 @@ class SaleOrderLine(models.Model):
|
||||
copy=False,
|
||||
)
|
||||
|
||||
@api.constrains('contract_id')
|
||||
def check_contact_is_not_resiliated(self):
|
||||
for rec in self:
|
||||
if (
|
||||
rec.order_id.state not in ('sale', 'done', 'cancel')
|
||||
and rec.contract_id.is_resiliated
|
||||
):
|
||||
raise ValidationError(
|
||||
_("You can't upsell or downsell a resiliated contract")
|
||||
)
|
||||
|
||||
@api.multi
|
||||
@api.depends('product_id')
|
||||
def _compute_contract_template_id(self):
|
||||
|
||||
Reference in New Issue
Block a user