Browse Source

Feb 7 [UPDT] : Updated 'membership_card_odoo'

pull/254/merge
AjmalCybro 1 year ago
parent
commit
181e38413d
  1. 2
      membership_card_odoo/__manifest__.py
  2. 13
      membership_card_odoo/data/ir_actions_server_data.xml
  3. 6
      membership_card_odoo/doc/RELEASE_NOTES.md
  4. 5
      membership_card_odoo/models/res_partner.py
  5. 203
      membership_card_odoo/report/membership_card_reports.xml
  6. 11
      membership_card_odoo/views/res_partner_views.xml

2
membership_card_odoo/__manifest__.py

@ -36,7 +36,7 @@
'depends': ['membership'],
'data': [
'report/membership_card_reports.xml',
'views/res_partner_views.xml',
'data/ir_actions_server_data.xml',
],
'images': ['static/description/banner.png'],
'license': 'AGPL-3',

13
membership_card_odoo/data/ir_actions_server_data.xml

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- Used to bring a menu inside action menu -->
<record id="server_action_get_card" model="ir.actions.server">
<field name="name">Print Membership Card</field>
<field name="model_id" ref="base.model_res_partner"/>
<field name="binding_model_id" ref="base.model_res_partner"/>
<field name="state">code</field>
<field name="code">action = records.server_action_get_card()</field>
</record>
</data>
</odoo>

6
membership_card_odoo/doc/RELEASE_NOTES.md

@ -3,5 +3,9 @@
#### 21.12.2023
#### Version 15.0.1.0.0
#### ADD
- Initial Commit for Membership Card
#### 02.02.2024
#### Version 15.0.1.0.1
#### UPDATE
- Fixed the issue of not printing the arabic words in the report

5
membership_card_odoo/models/res_partner.py

@ -63,6 +63,5 @@ class ResPartner(models.Model):
}
return self.env.ref('membership_card_odoo.action_membership'
'_card').report_action(None, data=data)
else:
raise ValidationError(
'Need to buy membership inorder to print membership card')
raise ValidationError(
'Need to buy membership inorder to print membership card')

203
membership_card_odoo/report/membership_card_reports.xml

@ -29,114 +29,119 @@
<!-- Template to print Pdf. -->
<template id="print_member_ship_card">
<t t-call="web.html_container">
<div style="border: 2px solid black; padding: 15px; margin-bottom: 40px; height: 90%;">
<tr t-if="free_member==True">
<div style="border-bottom: 2px solid black; margin-bottom: 15px;">
<h2 style=" text-align: center;">Free Member</h2>
</div>
</tr>
<tr t-else="free_member==False">
<tr>
<div style="border-bottom: 2px solid black; margin-bottom: 15px;">
<h2 style="text-align:center;">
<t t-esc="membership_product[0]"/>
</h2>
<t t-call="web.internal_layout">
<div style="border: 2px solid black; padding: 15px; margin-bottom: 40px; height: 90%;">
<tr t-if="free_member==True">
<div style="border-bottom: 2px solid black; margin-bottom: 15px; font-size: 15px !important;">
<h2 style=" text-align: center;">Free Member</h2>
</div>
</tr>
</tr>
<div style="display: -webkit-box; display: flex; -webkit-box-pack: space-between; justify-content: space-between; -webkit-align-self: center align-self: center; align-items: center; ">
<div>
<img style="width: 120px; border-radius: 5px;"
t-attf-src="data:image/*;base64,{{image}}"/>
</div>
<div class="session_1"
style="margin-left: 15px; margin-top: 0px; padding-top: 0px;">
<tr t-if="free_member==True">
<tr>
<h2 style="text-align:center;line-height: .1;">
</h2>
</tr>
<tr>
<h2 t-if="name"
style="text-align:left; margin-top: 0px; ">
Name:
<span t-esc="name"/>
</h2>
</tr>
<tr>
<h2 t-if="phone" style="text-align:left;">Phone
No:
<span t-esc="phone"/>
<tr t-else="free_member==False">
<tr>
<div style="border-bottom: 2px solid black; margin-bottom: 15px;">
<h2 style="text-align:center;">
<t t-esc="membership_product[0]"/>
</h2>
</tr>
<tr>
<h2 t-if="function" style="text-align:left;">
Job:
<span t-esc="function"/>
</h2>
</tr>
<br/>
<br/>
</div>
</tr>
<tr t-else="free_member==False">
<tr>
<h2 style="text-align:center;line-height: .1;">
</h2>
</tr>
<tr>
<h2 t-if="name"
style="text-align:left; margin-top: 0px; ">
Name:
<span t-esc="name"/>
</h2>
</tr>
<tr>
<h2 t-if="phone" style="text-align:left;">Phone
No:
<span t-esc="phone"/>
</h2>
</tr>
<tr>
<h2 style="text-align:left;">Start Date:
<span t-esc="start_date"/>
</h2>
</tr>
<div style="display: -webkit-box; display: flex; -webkit-box-pack: space-between; justify-content: space-between; -webkit-align-self: center align-self: center; align-items: center; ">
<div>
<img style="width: 120px; border-radius: 5px;"
t-attf-src="data:image/*;base64,{{image}}"/>
</div>
<div class="session_1"
style="margin-left: 15px; margin-top: 0px; padding-top: 0px; ">
<tr t-if="free_member==True">
<tr>
<h2 style="text-align:center;line-height: .1;">
</h2>
</tr>
<tr>
<h2 t-if="name"
style="text-align:left; margin-top: 0px;">
Name:
<span t-esc="name"/>
</h2>
</tr>
<tr>
<h2 t-if="phone" style="text-align:left; ">
Phone
No:
<span t-esc="phone" style="font-size: 25px !important; "/>
</h2>
</tr>
<tr>
<h2 t-if="function"
style="text-align:left;">
Job:
<span t-esc="function"/>
</h2>
</tr>
<br/>
<br/>
</tr>
<tr>
<h2 style="text-align:left;">End Date:
<span t-esc="end_date"/>
</h2>
<tr t-else="free_member==False">
<tr>
<h2 style="text-align:center;line-height: .1;">
</h2>
</tr>
<tr>
<h2 t-if="name"
style="text-align:left; margin-top: 0px; ">
Name:
<span t-esc="name"/>
</h2>
</tr>
<tr>
<h2 t-if="phone" style="text-align:left;">
Phone
No:
<span t-esc="phone"/>
</h2>
</tr>
<tr>
<h2 style="text-align:left;">Start Date:
<span t-esc="start_date"/>
</h2>
</tr>
<tr>
<h2 style="text-align:left;">End Date:
<span t-esc="end_date"/>
</h2>
</tr>
</tr>
</tr>
</div>
</div>
</div>
</div>
<div style="border: 2px solid black; padding: 15px; height: 90%;">
<div class="session_2" style="width: 500px; ">
<tr>
<h2 style="text-align:left;">
<span t-esc="company_name"/>
</h2>
<h2 style="text-align:left;">
<span t-esc="company_address"/>,
<br/>
<span t-esc="city"/>,
<span t-esc="state"/>,
<span t-esc="country"/>
</h2>
<h2 style="text-align:left;">
Email:
<span t-esc="company_email"/>
</h2>
<h2 style="text-align:left;">
Contact:
<span t-esc="company_phone"/>
</h2>
<h2 style="text-align:left;">
<span t-esc="website"/>
</h2>
</tr>
<div style="border: 2px solid black; padding: 15px; height: 90%;">
<div class="session_2" style="width: 500px; ">
<tr>
<h2 style="text-align:left;">
<span t-esc="company_name"/>
</h2>
<h2 style="text-align:left;">
<span t-esc="company_address"/>,
<br/>
<span t-esc="city"/>,
<span t-esc="state"/>,
<span t-esc="country"/>
</h2>
<h2 style="text-align:left;">
Email:
<span t-esc="company_email"/>
</h2>
<h2 style="text-align:left;">
Contact:
<span t-esc="company_phone"/>
</h2>
<h2 style="text-align:left;">
<span t-esc="website"/>
</h2>
</tr>
</div>
</div>
</div>
</t>
</t>
</template>
</odoo>

11
membership_card_odoo/views/res_partner_views.xml

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Used to bring a menu inside action menu -->
<record id="server_action_get_card" model="ir.actions.server">
<field name="name">Print Membership Card</field>
<field name="model_id" ref="base.model_res_partner"/>
<field name="binding_model_id" ref="base.model_res_partner"/>
<field name="state">code</field>
<field name="code">action = records.server_action_get_card()</field>
</record>
</odoo>
Loading…
Cancel
Save