Update membership_cancel_request.py
This commit is contained in:
parent
c210253f06
commit
ef0fd246fb
|
|
@ -21,9 +21,9 @@ class MembershipCancellationRequest(models.Model):
|
||||||
def action_approve(self):
|
def action_approve(self):
|
||||||
for rec in self:
|
for rec in self:
|
||||||
# Check if the request date is before the membership end date
|
# Check if the request date is before the membership end date
|
||||||
if rec.request_date < rec.membership_id.membership_end_date:
|
if rec.request_date < rec.membership_id.to_date:
|
||||||
# Update the membership end date to the request date
|
# Update the membership end date to the request date
|
||||||
rec.membership_id.membership_end_date = rec.request_date
|
rec.membership_id.to_date = rec.request_date
|
||||||
rec.state = 'approved'
|
rec.state = 'approved'
|
||||||
rec.membership_id.state = 'cancel'
|
rec.membership_id.state = 'cancel'
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue