Update rental_contract.py

This commit is contained in:
zainab2097 2024-10-03 15:19:56 +03:00 committed by GitHub
parent 7b32ef8e5c
commit fd7f96152e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -363,7 +363,7 @@ class RentalContract(models.Model):
def action_review(self):
full = True
if self.property_id.state in ['reserve', 'rent']:
if self.property_id.state in ['reserve', 'rent'] and self.property_id.contract_counts>1:
raise exceptions.ValidationError(_("Property is already reserved or rented"))
#
for units in self.property_id.unit_ids: