Merge pull request #753 from expsa/membership_task

Membership task
This commit is contained in:
zainab2097 2024-08-15 09:49:24 +03:00 committed by GitHub
commit 982194a82e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -23,9 +23,9 @@ class MembershipCancellationRequest(models.Model):
# Convert request_date to a date if it's a datetime
request_date = rec.request_date.date() if isinstance(rec.request_date, datetime) else rec.request_date
# Check if the request date is before the membership end date
if request_date < rec.membership_id.to_date:
if request_date < rec.membership_id.partner_id.membership_end_date:
# Update the membership end date to the request date
rec.membership_id.to_date = request_date
rec.membership_id.partner_id.membership_end_date = request_date
rec.state = 'approved'
rec.membership_id.state = 'cancel'

View File

@ -47,7 +47,7 @@
<img t-if="image" style="width: 120px; border-radius: 5px;"
t-attf-src="data:image/*;base64,{{image}}"/>
</div>
<div style="font-family: 'Roboto', sans-serif;position:relative;left:80px;margin-top:5px;float:left" class="col-8">
<div style="font-family: 'Roboto', sans-serif;position:relative;left:200px;margin-top:5px;float:left" class="col-8">
<p dir="rtl" t-if="name"><strong>الاسم:</strong> <t t-esc="name"/></p>
<p dir="rtl" t-if="membrship_no"><strong>رقم العضوية:</strong> <t t-esc="membrship_no"/></p>
<p dir="rtl" t-if="product_id"><strong> نوع العضوية:</strong> <t t-esc="product_id"/></p>