Update dev_membership.py

This commit is contained in:
zainab2097 2024-09-29 17:40:06 +03:00 committed by GitHub
parent b2472360aa
commit 86a9fe3072
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 4 deletions

View File

@ -133,12 +133,12 @@ class DevMembership(models.Model):
if self.product_id.gender and self.partner_id.gender != self.product_id.gender:
raise ValidationError(_('Membership is only %s allowed') % self.product_id.gender)
if record.membership_fees < (record.product_id.list_price * record.duration):
if self.membership_fees < (self.product_id.list_price * self.duration):
raise ValidationError(
_("Membership fees cannot be less than %s .") % (record.product_id.list_price * record.duration,))
if record.duration < record.product_id.duration:
_("Membership fees cannot be less than %s .") % (self.product_id.list_price * self.duration,))
if self.duration < self.product_id.duration:
raise ValidationError(
_("Duration cannot be less than the default value in Setting of membrship type.%s'") % record.product_id.duration)
_("Duration cannot be less than the default value in Setting of membrship type.%s'") % self.product_id.duration)
self.state = 'confirm'
def action_active_membership(self):