Update rent_payment.py

This commit is contained in:
zainab2097 2024-08-07 14:31:56 +03:00 committed by GitHub
parent 18b89dd113
commit 4e66215abe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -276,8 +276,9 @@ class RentPayment(models.Model):
all(invoice.state == 'draft' for invoice in payment.invoice_id))
)]
if len(rent_payment):
raise exceptions.ValidationError(
_("You must validate the previous rent payment and complete the process"))
pass
# raise exceptions.ValidationError(
# _("You must validate the previous rent payment and complete the process"))
if record.code == '/' or not record.code:
code = self.env['ir.sequence'].next_by_code('rent.payment') or '/'
record.write({'code': code})