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'], 'depends': ['membership'],
'data': [ 'data': [
'report/membership_card_reports.xml', 'report/membership_card_reports.xml',
'views/res_partner_views.xml', 'data/ir_actions_server_data.xml',
], ],
'images': ['static/description/banner.png'], 'images': ['static/description/banner.png'],
'license': 'AGPL-3', '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 #### 21.12.2023
#### Version 15.0.1.0.0 #### Version 15.0.1.0.0
#### ADD #### ADD
- Initial Commit for Membership Card - 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' return self.env.ref('membership_card_odoo.action_membership'
'_card').report_action(None, data=data) '_card').report_action(None, data=data)
else: raise ValidationError(
raise ValidationError( 'Need to buy membership inorder to print membership card')
'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 to print Pdf. -->
<template id="print_member_ship_card"> <template id="print_member_ship_card">
<t t-call="web.html_container"> <t t-call="web.html_container">
<div style="border: 2px solid black; padding: 15px; margin-bottom: 40px; height: 90%;"> <t t-call="web.internal_layout">
<tr t-if="free_member==True"> <div style="border: 2px solid black; padding: 15px; margin-bottom: 40px; height: 90%;">
<div style="border-bottom: 2px solid black; margin-bottom: 15px;"> <tr t-if="free_member==True">
<h2 style=" text-align: center;">Free Member</h2> <div style="border-bottom: 2px solid black; margin-bottom: 15px; font-size: 15px !important;">
</div> <h2 style=" text-align: center;">Free Member</h2>
</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>
</div> </div>
</tr> </tr>
</tr> <tr t-else="free_member==False">
<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; "> <tr>
<div> <div style="border-bottom: 2px solid black; margin-bottom: 15px;">
<img style="width: 120px; border-radius: 5px;" <h2 style="text-align:center;">
t-attf-src="data:image/*;base64,{{image}}"/> <t t-esc="membership_product[0]"/>
</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"/>
</h2> </h2>
</tr> </div>
<tr>
<h2 t-if="function" style="text-align:left;">
Job:
<span t-esc="function"/>
</h2>
</tr>
<br/>
<br/>
</tr> </tr>
<tr t-else="free_member==False"> </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; ">
<h2 style="text-align:center;line-height: .1;"> <div>
</h2> <img style="width: 120px; border-radius: 5px;"
</tr> t-attf-src="data:image/*;base64,{{image}}"/>
<tr> </div>
<h2 t-if="name" <div class="session_1"
style="text-align:left; margin-top: 0px; "> style="margin-left: 15px; margin-top: 0px; padding-top: 0px; ">
Name: <tr t-if="free_member==True">
<span t-esc="name"/> <tr>
</h2> <h2 style="text-align:center;line-height: .1;">
</tr> </h2>
<tr> </tr>
<h2 t-if="phone" style="text-align:left;">Phone <tr>
No: <h2 t-if="name"
<span t-esc="phone"/> style="text-align:left; margin-top: 0px;">
</h2> Name:
</tr> <span t-esc="name"/>
<tr> </h2>
<h2 style="text-align:left;">Start Date: </tr>
<span t-esc="start_date"/> <tr>
</h2> <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>
<tr> <tr t-else="free_member==False">
<h2 style="text-align:left;">End Date: <tr>
<span t-esc="end_date"/> <h2 style="text-align:center;line-height: .1;">
</h2> </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>
</tr> </div>
</div> </div>
</div> </div>
</div> <div style="border: 2px solid black; padding: 15px; height: 90%;">
<div style="border: 2px solid black; padding: 15px; height: 90%;"> <div class="session_2" style="width: 500px; ">
<div class="session_2" style="width: 500px; "> <tr>
<tr> <h2 style="text-align:left;">
<h2 style="text-align:left;"> <span t-esc="company_name"/>
<span t-esc="company_name"/> </h2>
</h2> <h2 style="text-align:left;">
<h2 style="text-align:left;"> <span t-esc="company_address"/>,
<span t-esc="company_address"/>, <br/>
<br/> <span t-esc="city"/>,
<span t-esc="city"/>, <span t-esc="state"/>,
<span t-esc="state"/>, <span t-esc="country"/>
<span t-esc="country"/> </h2>
</h2> <h2 style="text-align:left;">
<h2 style="text-align:left;"> Email:
Email: <span t-esc="company_email"/>
<span t-esc="company_email"/> </h2>
</h2> <h2 style="text-align:left;">
<h2 style="text-align:left;"> Contact:
Contact: <span t-esc="company_phone"/>
<span t-esc="company_phone"/> </h2>
</h2> <h2 style="text-align:left;">
<h2 style="text-align:left;"> <span t-esc="website"/>
<span t-esc="website"/> </h2>
</h2> </tr>
</tr> </div>
</div> </div>
</div> </t>
</t> </t>
</template> </template>
</odoo> </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