memebership nomination report

This commit is contained in:
Esraa-Exp 2025-04-07 13:43:00 +02:00
parent 25d7fe227a
commit 77da368c0a
7 changed files with 266 additions and 0 deletions

View File

@ -80,6 +80,8 @@ odoo app manage Membership subscription plans, odoo membership memeber, odoo mem
'views/board_membership_nomination.xml',
'report/print_membership_template.xml',
'report/print_membership_menu.xml',
'report/membership_nomaination_header_footer.xml',
'report/membership_nomaination_template.xml',
'data/mail_template.xml',
#
],

View File

@ -50,6 +50,7 @@ class BoardMembershipNomination(models.Model):
'subscription_years': total_duration,
'status': 'nominated',
'nomination_id': record.id,
'membership_number': memberships[0].name,
})
# for m in memberships:
#
@ -119,6 +120,7 @@ class BoardNominee(models.Model):
vote_count = fields.Integer('Votes')
notes = fields.Text('Notes')
nomination_id = fields.Many2one('board.membership.nomination', string="Nomination")
membership_number = fields.Char('Membership Number', readonly=True)
def action_accept(self):
for line in self:

View File

@ -0,0 +1,167 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="membership_external_layout">
<t t-if="not o" t-set="o" t-value="doc"/>
<t t-if="not company">
<!-- Multicompany -->
<t t-if="company_id">
<t t-set="company" t-value="company_id"/>
</t>
<t t-elif="o and 'company_id' in o and o.company_id.sudo()">
<t t-set="company" t-value="o.company_id.sudo()"/>
</t>
<t t-else="else">
<t t-set="company" t-value="res_company"/>
</t>
</t>
<t t-call="dev_membership.membership_external_layout_standard">
<t t-raw="0"/>
</t>
</template>
<template id="membership_external_layout_standard">
<div class="header" style="width: 100%; padding: 10px 0;color: #2F5423;">
<div class="row" style="display: flex; align-items: center; justify-content: space-between;">
<!-- Right Side: Company Name in H1 -->
<div style="width: 40%; text-align: right;color: #2F5423;">
<br></br>
<p t-esc="company.name" style="font-size: 18px; font-weight: bold; color: #2F5423"/>
<p style="margin: 0; font-size: 16px; font-weight: bold;text-align: center">بمنطقة الرياض</p>
<br></br>
<p style="margin: 0; font-size: 12px; font-weight: bold;">مسجلة بوزارة الموارد البشرية و التنمية
الإجتماعية برقم 166
</p>
</div>
<!-- Center: Company Logo -->
<div style="width: 20%; text-align: center;">
<img style="border-radius: 8px; width: 100%;height:190px"
src="/dev_membership/static/description/company-logo.png"/>
</div>
<!-- Left Side: Three-line text -->
<div style="width: 40%; text-align: right; padding-right: 20px;font-size: 14px; font-weight: bold;;color: #2F5423;">
<br></br>
<p>الرقم: ...........................................</p>
<br></br>
<p>التاريخ:... ......................................</p>
<br></br>
<p>المشفوعات: .................................</p>
</div>
</div>
</div>
<div t-attf-class="article o_report_layout_standard o_company_#{company.id}_layout"
t-att-data-oe-model="o and o._name" t-att-data-oe-id="o and o.id"
t-att-data-oe-lang="o and o.env.context.get('lang')">
<div class="pt-5">
<!-- This div ensures that the address is not cropped by the header. -->
<t t-call="web.address_layout"/>
</div>
<t t-raw="0"/>
</div>
<div t-attf-class="footer o_standard_footer o_company_#{company.id}_layout"
style="padding-top: 10px; text-align: center;">
<div class="text-center"
style="background-color: #2F5423; color: white; padding: 5px; font-size: 12px; border-radius:10px;">
<ul class="list-inline mb4">
<!-- using the list-inline-item class from bootstrap causes weird behaviours in pdf report
adding d-inline class fixes the problem-->
<li t-if="company.country_id" class="list-inline-item d-inline">
<span t-field="company.country_id.name"/>
<span>-</span>
</li>
<li t-if="company.city" class="list-inline-item d-inline">
<span t-field="company.city"/>
</li>
<li t-if="company.po_no" class="list-inline-item d-inline">
<span>ص ب</span>
<span t-field="company.po_no"/>
<span t-field="company.city"/>
<span t-field="company.zip"/>
</li>
<!-- <li t-if="company.website" class="list-inline-item d-inline">-->
<!-- <span t-field="company.website"/>-->
<!-- </li>-->
<li t-if="company.phone" class="list-inline-item d-inline">
<span class="o_force_ltr" t-field="company.phone"/>
</li>
<li t-if="company.vat" class="list-inline-item d-inline"><t
t-esc="company.country_id.vat_label or 'Tax ID'"/>:
<span t-field="company.vat"/>
</li>
</ul>
</div>
<!-- Social Media Icons -->
<div style="display: inline-block; padding: 10px; width: auto; color:#2F5423; vertical-align: middle;">
<a href="/website/social/facebook" class="s_social_media_facebook" target="_blank">
<i class="fa fa-facebook" style="color:#2F5423"/>
</a>
<a href="https://x.com/ensanorg" class="s_social_media_twitter" target="_blank">
<i class="fa fa-twitter" style="color:#2F5423"/>
</a>
<a href="/website/social/linkedin" class="s_social_media_linkedin" target="_blank">
<i class="fa fa-linkedin" style="color:#2F5423"/>
</a>
<a href="/website/social/instagram" class="s_social_media_instagram" target="_blank">
<i class="fa fa-instagram" style="color:#2F5423"/>
</a>
<a href="/website/social/youtube" class="s_social_media_youtube" target="_blank">
<i class="fa fa-youtube" style="color:#2F5423"/>
</a>
</div>
<div style="display: inline-block; background-color: #2F5423; color: white; padding: 5px 10px; border-radius: 5px; font-size: 14px; vertical-align: middle;">
الرقم الموحد 800 124 1777
</div>
<!-- QR Code for Website -->
<!-- <div style="margin-top: 5px;">-->
<!-- <t t-if="company.website">-->
<!-- <t t-call="web.8">-->
<!-- <t t-set="barcode_type">QR</t>-->
<!-- <t t-set="barcode_value" t-value="company.website"/>-->
<!-- </t>-->
<!-- </t>-->
<!-- </div>-->
<div style="font-size: 12px; color: #2F5423; margin-top: 5px;">
<a t-att-href="company.website" style="color: #2F5423; text-decoration: none;">
<t t-esc="company.website"/>
</a>
</div>
</div>
</template>
</data>
</odoo>

View File

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<odoo>
<template id="main_membership_nomination">
<t t-call="dev_membership.membership_external_layout">
<div class="page">
<br></br>
<!-- Report Title -->
<div style="font-size: 18px; font-weight: bold; margin-top: 10px;color: #2F5423;text-align: center">
قائمة المرشحين لعضوية مجلس الإدارة
</div>
<br></br>
<!-- Date -->
<div style="font-size: 14px; margin-top: 5px;color: #2F5423;text-align: center">
<strong>التاريخ:</strong>
<t t-esc="time.strftime('%Y-%m-%d')"/>
</div>
<!-- Table -->
<table class="table table-bordered"
style="border-color:#2F5423;width: 100%; text-align: center; border-collapse: collapse; margin-top: 10px; border: 1px solid #2F5423;">
<thead>
<tr style="color: #2F5423;">
<th style="padding: 5px;">م</th>
<th style="padding: 5px;">رقم العضوية</th>
<th style="padding: 5px;">اللقب</th>
<th style="padding: 5px;">الاسم</th>
<th style="padding: 5px;">تاريخ الانضمام</th>
<th style="padding: 5px;">عدد سنوات الاشتراك</th>
<th style="padding: 5px;">ملاحظات</th>
</tr>
</thead>
<tbody>
<t t-set="sequence" t-value="0"/>
<t t-foreach="o.board_nominee_ids" t-as="line">
<t t-set="sequence" t-value="sequence +1"/>
<tr>
<td>
<t t-esc="sequence"/>
</td>
<td>
<t t-esc="line.membership_number"/>
</td>
<td>
<t t-esc="line.name.title.name"/>
</td>
<td>
<t t-esc="line.name.name"/>
</td>
<td>
<t t-esc="line.join_date"/>
</td>
<td>
<t t-esc="line.subscription_years"/>
</td>
<td>
<t t-esc="line.notes or ''"/>
</td>
</tr>
</t>
</tbody>
</table>
</div>
</t>
</template>
<template id="membership_nomination_template">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="dev_membership.main_membership_nomination"/>
</t>
</t>
</template>
</odoo>
</odoo>

View File

@ -34,4 +34,16 @@ For Module Support : devintelle@gmail.com or Skype : devintelle
<field name="binding_type">report</field>
<field name="paperformat_id" ref="dev_membership.paperformat_membership_card"/>
</record>
<record id="menu_print_membership_nomination" model="ir.actions.report">
<field name="name">Print Membership Nomination</field>
<field name="model">board.membership.nomination</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">dev_membership.membership_nomination_template</field>
<field name="report_file">dev_membership.membership_nomination_template</field>
<field name="binding_model_id" ref="dev_membership.model_board_membership_nomination"/>
<field name="binding_type">report</field>
<!-- <field name="paperformat_id" ref="dev_membership.paperformat_membership_card"/>-->
</record>
</odoo>

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

View File

@ -54,6 +54,7 @@
<field name="status" readonly="1"/>
<field name="vote_count"/>
<field name="notes"/>
<field name="membership_number" invisible="1"/>
<button name="action_accept" string="Accept" type="object" class="btn-primary" attrs="{'invisible': [('status', 'not in', ['nominated', 'rejected'])]}"/>
<button name="action_reject" string="Reject" type="object" class="btn-danger" attrs="{'invisible': [('status', '!=', 'nominated')]}"/>
<button name="action_board_member" string="Board Member" type="object" class="btn-primary" attrs="{'invisible': [('status', '!=', 'accepted')]}"/>