UPDATE exp_transation_letters & exp_transaction_documents

This commit is contained in:
manar 2024-12-31 12:20:18 +02:00
parent b3939fd43a
commit 192357acb1
4 changed files with 78 additions and 57 deletions

View File

@ -94,7 +94,13 @@ class AttachmentRule(models.Model):
def action_signature(self):
for rec in self:
x = self.env['letters.letters'].search([('internal_transaction_id','=',rec.internal_transaction_id.id)],limit=1)
if rec.internal_transaction_id:
x = self.env['letters.letters'].search([('internal_transaction_id','=',rec.internal_transaction_id.id)],limit=1)
elif rec.incoming_transaction_id:
x = self.env['letters.letters'].search([('incoming_transaction_id','=',rec.incoming_transaction_id.id)],limit=1)
elif rec.outgoing_transaction_id:
x = self.env['letters.letters'].search([('outgoing_transaction_id','=',rec.outgoing_transaction_id.id)],limit=1)
rec.signed_user_id = self.env.user.id
x.signed_user_id = self.env.user.id
return {

View File

@ -33,11 +33,10 @@ msgstr "<span style=\"font-weight:bold;\">المرجع:</span>"
#. module: exp_transation_letters
#: model_terms:ir.ui.view,arch_db:exp_transation_letters.custom_external_layout_standard
msgid ""
"<span style=\"font-weight:bold;font-stretch: expanded;\">\n"
" Date:</span>"
"<span style=\"font-weight:bold;font-stretch: expanded;\">Date:</span>"
msgstr ""
"<span style=\"font-weight:bold;font-stretch: expanded;\">\n"
" التاريخ:</span>"
"<span style=\"font-weight:bold;font-stretch: expanded;\">التاريخ:</span>"
#. module: exp_transation_letters
#: model_terms:ir.ui.view,arch_db:exp_transation_letters.view_transaction_letters_form

View File

@ -10,13 +10,13 @@
font-style: normal;
}
.droidkufi-font {
font-family: 'Al-Mohanad', sans-serif;
* {
font-family: 'Al-Mohanad', sans-serif !important;
}
</style>
<t t-if="o.incoming_transaction_id">
<div class="header droidkufi-font">
<div class="row">
<div class="header mohanad-font">
<div class="row" style="direction: ltr; margin-top: 0px; margin-left: -50px">
<br/>
<div class="col-6 text-right">
<table align="left"
@ -26,21 +26,21 @@
<t t-esc="o.incoming_transaction_id.name"/>
</td>
</tr>
<tr style="border:0px">
<td colspan="2" style="border:0px;padding-right:30px !important;">
<span style="font-weight:bold;font-stretch: expanded;">
Date:
</span>
<!-- <tr style="border:0px">-->
<!-- <td colspan="2" style="border:0px;padding-right:30px !important;">-->
<!-- <span style="font-weight:bold;font-stretch: expanded;">-->
<!-- Date:-->
<!-- </span>-->
<t t-set="date_hijri"
t-value="o.incoming_transaction_id.transaction_date_hijri"/>
<!-- <t t-set="date_hijri"-->
<!-- t-value="o.incoming_transaction_id.transaction_date_hijri"/>-->
<t t-set="date_hijri2" t-value="date_hijri.split('-')"/>
<!-- <t t-set="date_hijri2" t-value="date_hijri.split('-')"/>-->
<t t-esc="date_hijri2[0]"/>/<t t-esc="date_hijri2[1]"/>/
<t t-esc="date_hijri2[2]"/>
</td>
</tr>
<!-- <t t-esc="date_hijri2[0]"/>/<t t-esc="date_hijri2[1]"/>/-->
<!-- <t t-esc="date_hijri2[2]"/>-->
<!-- </td>-->
<!-- </tr>-->
<tr>
<td colspan="2" style="border:0px;padding-right:30px !important;">
<span style="font-weight:bold;">Reference:</span>
@ -58,8 +58,8 @@
</tr>
<tr style="border:0px">
<td colspan="2" style="border:0px">
<img t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%`s&amp;height=%s' % ('Code128', o.incoming_transaction_id.name, 600, 100)"
style="width:250px;height:40px;margin-top:5px;"/>
<img t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('Code128', o.incoming_transaction_id.name, 600, 100)"
style="width:250px;height:40px;margin-top:5px;margin-left:-40px;"/>
</td>
</tr>
</table>
@ -80,7 +80,7 @@
</t>
<t t-if="o.internal_transaction_id">
<div class="header droidkufi-font">
<div class="header mohanad-font">
<div class="row" style="direction: ltr; margin-top: 0px; margin-left: -50px">
<br/>
<div class="col-6 text-right" style="direction: rtl;">
@ -149,7 +149,7 @@
</t>
<t t-if="o.outgoing_transaction_id">
<div class="header droidkufi-font">
<div class="header mohanad-font">
<div class="row" style="direction: ltr; margin-top: 0px; margin-left: -50px">
<!--<br/>-->
<div class="col-6 text-right" style="direction: rtl;">
@ -218,7 +218,7 @@
</t>
<t t-if="o.outgoing_transaction_id =='' and o.internal_transaction_id=='' and o.incoming_transaction_id ==''">
<div class="header droidkufi-font">
<div class="header mohanad-font">
<div class="row">
<div class="col-6 text-right">
@ -236,7 +236,7 @@
</div>
</div>
</t>
<div class="article o_report_layout_standard droidkufi-font">
<div class="article o_report_layout_standard mohanad-font">
<t t-raw="0"/>
</div>
<!--<div class="footer">-->
@ -280,34 +280,34 @@
font-style: normal;
}
.droidkufi-font {
font-family: 'Al-Mohanad', sans-serif;
* {
font-family: 'Al-Mohanad', sans-serif !important;
}
</style>
<div class="page droidkufi-font">
<div class="page mohanad-font">
<!-- <h4 style="text-align:center;margin-top:20px;font-weight:bold;font-size:20pt">Letter <t t-esc="o.name"/>-->
<!-- </h4>-->
<!-- <strong style="margin: 10px;margin-left:30px"> Date </strong>: <span t-esc="o.date" />-->
<br/>
<br/>
<div style="margin-bottom: 0px">
<p class="droidkufi-font" style="line-height: 16 !important" t-raw="o.content">
<p class="mohanad-font" style="line-height: 16 !important" t-raw="o.content">
</p>
</div>
<br/>
<br/>
<div style="margin-top: 0px; page-break-inside: avoid;" dir="ltr">
<div style="margin-bottom: 10px; text-align: left;">
<strong>اﻹسم:</strong>
<div style="margin-bottom: 10px; text-align: left;margin-left:25px">
<strong t-if="o.signed_user_id">اﻹسم:</strong>
<span t-esc="o.signed_user_id.name"/>
</div>
<div style="margin-bottom: 10px; text-align: left;">
<div style="margin-bottom: 10px; text-align: left;margin-left:25px">
<span t-esc="o.signed_user_id.employee_id.job_id.name"/>
</div>
<div style="margin-top: 10px; text-align: left;">
<img t-if="o.new_signature" t-attf-src="data:image/*;base64,{{o.new_signature}}"
style="height:200px;width:250px; border: 0px;margin-left:25px"/>
style="height:200px;width:200px; border: 0px;margin-left:0px"/>
</div>
<!-- <img t-if="o.signature" t-attf-src="data:image/*;base64,{{o.signature}}"-->
<!-- style="margin-top:50px;height:100px;width:100px; border: 0px;margin-left:25px"/>-->

View File

@ -2,10 +2,21 @@
<odoo>
<data>
<template id="custom_external_layout_standard">
<style type="text/css">
@font-face {
font-family: 'Al-Mohanad';
src: url("/exp_transation_letters/static/src/fonts/Al-Mohanad.ttf") format("truetype");
font-weight: normal;
font-style: normal;
}
* {
font-family: 'Al-Mohanad', sans-serif !important;
}
</style>
<t t-if="o.incoming_transaction_id">
<div class="header">
<div class="row">
<br/>
<div class="row" style="direction: ltr; margin-top: 0px; margin-left: -50px">
<div class="col-6 text-right" style="rtl">
<table align="left"
style="border:1px solid white;width:50;margin-left:60px;margin-top:0px;margin-right:5px;margin-bottom:40px;text-align: justify;">
@ -14,21 +25,19 @@
<t t-esc="o.incoming_transaction_id.name"/>
</td>
</tr>
<tr style="border:0px">
<td colspan="2" style="border:0px;padding-right:30px !important;">
<span style="font-weight:bold;font-stretch: expanded;">
Date:
</span>
<!-- <tr style="border:0px">-->
<!-- <td colspan="2" style="border:0px;padding-right:30px !important;">-->
<!-- <span style="font-weight:bold;font-stretch: expanded;">Date:</span>-->
<t t-set="date_hijri"
t-value="o.incoming_transaction_id.transaction_date_hijri"/>
<!-- <t t-set="date_hijri"-->
<!-- t-value="o.incoming_transaction_id.transaction_date_hijri"/>-->
<t t-set="date_hijri2" t-value="date_hijri.split('-')"/>
<!-- <t t-set="date_hijri2" t-value="date_hijri.split('-')"/>-->
<t t-esc="date_hijri2[0]"/>/<t t-esc="date_hijri2[1]"/>/
<t t-esc="date_hijri2[2]"/>
</td>
</tr>
<!-- <t t-esc="date_hijri2[0]"/>/<t t-esc="date_hijri2[1]"/>/-->
<!-- <t t-esc="date_hijri2[2]"/>-->
<!-- </td>-->
<!-- </tr>-->
<tr>
<td colspan="2" style="border:0px;padding-right:30px !important;">
<span style="font-weight:bold;">Reference:</span>
@ -47,7 +56,7 @@
<tr style="border:0px">
<td colspan="2" style="border:0px">
<img t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('Code128', o.incoming_transaction_id.name, 600, 100)"
style="width:250px;height:40px;margin-top:5px;"/>
style="width:250px;height:40px;margin-top:5px;margin-left:-40px;"/>
</td>
</tr>
</table>
@ -279,11 +288,18 @@
font-style: normal;
}
.droidkufi-font {
font-family: 'Al-Mohanad', sans-serif;
@font-face {
font-family: 'Al-Mohanad';
src: url("/exp_transation_letters/static/src/fonts/Al-Mohanad.ttf") format("truetype");
font-weight: bold;
font-style: normal;
}
* {
font-family: 'Al-Mohanad', sans-serif !important;
}
</style>
<div class="page droidkufi-font">
<div class="page mohanad-font">
<!-- <h4 style="text-align:center;margin-top:20px;font-weight:bold;font-size:20pt">Letter <t t-esc="o.name"/>-->
<!-- </h4>-->
<!-- <strong style="margin: 10px;margin-left:30px"> Date </strong>: <span t-esc="o.date" />-->
@ -296,17 +312,17 @@
<br/>
<br/>
<div style="margin-top: 0px; page-break-inside: avoid;" dir="ltr">
<div style="margin-bottom: 10px; text-align: left;">
<strong>اﻹسم:</strong>
<div style="margin-bottom: 10px; text-align: left;margin-left:25px">
<strong t-if="o.signed_user_id">اﻹسم:</strong>
<span t-esc="o.signed_user_id.name"/>
</div>
<div style="margin-bottom: 10px; text-align: left;">
<div style="margin-bottom: 10px; text-align: left;margin-left:25px">
<span t-esc="o.signed_user_id.employee_id.job_id.name"/>
</div>
<div style="margin-top: 10px; text-align: left;">
<img t-if="o.new_signature" t-attf-src="data:image/*;base64,{{o.new_signature}}"
style="height:200px;width:250px; border: 0px;margin-left:25px"/>
style="height:200px;width:200px; border: 0px;margin-left:0px"/>
</div>
<!-- <div style="margin-top: 10px; text-align: left;">-->