IMP odex benefit
This commit is contained in:
parent
27f6c2fc2a
commit
85ca02f5e0
|
|
@ -1,6 +1,50 @@
|
|||
<odoo>
|
||||
<data noupdate="1">
|
||||
<!-- Attachment Expiration Email Template for family-->
|
||||
<data noupdate="1">
|
||||
<record id="visit_notification_template" model="mail.template">
|
||||
<field name="name">Visit Assignment Notification</field>
|
||||
<field name="model_id" ref="odex_benefit.model_visit_location"/>
|
||||
<field name="subject">${object.benefit_id.name or 'New Visit Assigned'}</field>
|
||||
<field name="lang">${object.create_uid.lang}</field>
|
||||
<field name="auto_delete" eval="True"/>
|
||||
<field name="body_html" type="html">
|
||||
<table border="0" cellpadding="0" cellspacing="0"
|
||||
style="padding-top: 16px; background-color: #F9F9F9; font-family: Verdana, Arial, sans-serif; color: #333; width: 100%; border-collapse: separate;">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="600"
|
||||
style="background-color: #fff; padding: 16px; border-collapse: separate;">
|
||||
<tr>
|
||||
<td style="font-size: 14px; line-height: 20px;">
|
||||
<p>Hello,</p>
|
||||
<p>A new visit has been assigned to you. Details are below:</p>
|
||||
<ul>
|
||||
<li>
|
||||
<strong>Benefit File:</strong>
|
||||
${object.benefit_id.name or 'N/A'}
|
||||
</li>
|
||||
<li>
|
||||
<strong>Visit Number:</strong>
|
||||
${object.name or object.id}
|
||||
</li>
|
||||
<li>
|
||||
<strong>Visit Date:</strong>
|
||||
${format_date(object.visit_date)}
|
||||
</li>
|
||||
</ul>
|
||||
<p>Please check your dashboard for more details.</p>
|
||||
<br/>
|
||||
<p style="font-size: 11px; color: grey;">This is an automated message. Do not
|
||||
reply.
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</field>
|
||||
</record>
|
||||
<!-- Attachment Expiration Email Template for family-->
|
||||
<record id="attachment_expiration_family_email_template" model="mail.template">
|
||||
<field name="name">Attachment Expiration</field>
|
||||
<field name="model_id" ref="odex_benefit.model_grant_benefit"/>
|
||||
|
|
@ -8,71 +52,107 @@
|
|||
<![CDATA[${user.company_id.name} <${(user.company_id.email or user.partner_id.email or 'noreply@localhost')|safe}>]]></field>
|
||||
<field name="email_to">${(object.get_researchers_email())|safe}</field>
|
||||
<field name="email_cc">${(object.email)|safe}</field>
|
||||
<field name="subject"> Attachment Expiration </field>
|
||||
<field name="subject">Attachment Expiration</field>
|
||||
<field name="body_html" type="html">
|
||||
<table border="0" cellpadding="0" cellspacing="0" style="padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"><tr><td align="center">
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="590" style="padding: 16px; background-color: white; color: #454748; border-collapse:separate;">
|
||||
<tbody>
|
||||
<!-- HEADER -->
|
||||
<tr>
|
||||
<td align="center" style="min-width: 590px;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;">
|
||||
<tr><td valign="middle">
|
||||
</td><td valign="middle" align="right">
|
||||
<img src="/logo.png?company=${object.create_uid.company_id.id}" style="padding: 0px; margin: 0px; height: auto; width: 80px;" alt="${object.create_uid.company_id.name}"/>
|
||||
</td></tr>
|
||||
<tr><td colspan="2" style="text-align:center;">
|
||||
<hr width="100%" style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 16px 0px;"/>
|
||||
</td></tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- CONTENT -->
|
||||
<tr>
|
||||
<td align="center" style="min-width: 590px;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;">
|
||||
<tr><td valign="top" style="font-size: 13px;">
|
||||
<div>
|
||||
<center>
|
||||
Family ${object.name},<br/><br/>
|
||||
Please Update your attachments because some of them has been expired!<br/>
|
||||
</center><br/>
|
||||
</div>
|
||||
</td></tr>
|
||||
<tr><td style="text-align:center;">
|
||||
<hr width="100%" style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 16px 0px;"/>
|
||||
</td></tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- FOOTER -->
|
||||
<tr>
|
||||
<td align="center" style="min-width: 590px;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; font-size: 11px; padding: 0px 8px 0px 8px; border-collapse:separate;">
|
||||
<tr><td valign="middle" align="left">
|
||||
${object.create_uid.company_id.name}
|
||||
</td></tr>
|
||||
<tr><td valign="middle" align="left" style="opacity: 0.7;">
|
||||
${object.create_uid.company_id.phone}
|
||||
% if object.create_uid.company_id.email
|
||||
| <a href="'mailto:%s' % ${object.create_uid.company_id.email}" style="text-decoration:none; color: #454748;">${object.create_uid.company_id.email}</a>
|
||||
% endif
|
||||
% if object.create_uid.company_id.website
|
||||
| <a href="'%s' % ${object.create_uid.company_id.website}" style="text-decoration:none; color: #454748;">
|
||||
${object.create_uid.company_id.website}
|
||||
</a>
|
||||
% endif
|
||||
</td></tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td></tr>
|
||||
<table border="0" cellpadding="0" cellspacing="0"
|
||||
style="padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="590"
|
||||
style="padding: 16px; background-color: white; color: #454748; border-collapse:separate;">
|
||||
<tbody>
|
||||
<!-- HEADER -->
|
||||
<tr>
|
||||
<td align="center" style="min-width: 590px;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="590"
|
||||
style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;">
|
||||
<tr>
|
||||
<td valign="middle">
|
||||
</td>
|
||||
<td valign="middle" align="right">
|
||||
<img src="/logo.png?company=${object.create_uid.company_id.id}"
|
||||
style="padding: 0px; margin: 0px; height: auto; width: 80px;"
|
||||
alt="${object.create_uid.company_id.name}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" style="text-align:center;">
|
||||
<hr width="100%"
|
||||
style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 16px 0px;"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- CONTENT -->
|
||||
<tr>
|
||||
<td align="center" style="min-width: 590px;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="590"
|
||||
style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;">
|
||||
<tr>
|
||||
<td valign="top" style="font-size: 13px;">
|
||||
<div>
|
||||
<center>
|
||||
Family ${object.name},
|
||||
<br/>
|
||||
<br/>
|
||||
Please Update your attachments because some of them has
|
||||
been expired!
|
||||
<br/>
|
||||
</center>
|
||||
<br/>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:center;">
|
||||
<hr width="100%"
|
||||
style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 16px 0px;"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- FOOTER -->
|
||||
<tr>
|
||||
<td align="center" style="min-width: 590px;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="590"
|
||||
style="min-width: 590px; background-color: white; font-size: 11px; padding: 0px 8px 0px 8px; border-collapse:separate;">
|
||||
<tr>
|
||||
<td valign="middle" align="left">
|
||||
${object.create_uid.company_id.name}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="middle" align="left" style="opacity: 0.7;">
|
||||
${object.create_uid.company_id.phone}
|
||||
% if object.create_uid.company_id.email
|
||||
|
|
||||
<a href="'mailto:%s' % ${object.create_uid.company_id.email}"
|
||||
style="text-decoration:none; color: #454748;">
|
||||
${object.create_uid.company_id.email}
|
||||
</a>
|
||||
% endif
|
||||
% if object.create_uid.company_id.website
|
||||
|
|
||||
<a href="'%s' % ${object.create_uid.company_id.website}"
|
||||
style="text-decoration:none; color: #454748;">
|
||||
${object.create_uid.company_id.website}
|
||||
</a>
|
||||
% endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</field>
|
||||
</record>
|
||||
<!-- Schedule a visit -->
|
||||
<!-- Schedule a visit -->
|
||||
<record id="schedule_a_visit_email_template" model="mail.template">
|
||||
<field name="name">Schedule a visit</field>
|
||||
<field name="model_id" ref="odex_benefit.model_visit_location"/>
|
||||
|
|
@ -80,145 +160,182 @@
|
|||
<![CDATA[${user.company_id.name} <${(user.company_id.email or user.partner_id.email or 'noreply@localhost')|safe}>]]></field>
|
||||
<field name="email_to">${(object.benefit_id.email)|safe}</field>
|
||||
<field name="email_cc">${(object.get_researchers_email())|safe}</field>
|
||||
<field name="subject"> Schedule a visit </field>
|
||||
<field name="subject">Schedule a visit</field>
|
||||
<field name="body_html" type="html">
|
||||
<table border="0" cellpadding="0" cellspacing="0" style="padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"><tr><td align="center">
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="590" style="padding: 16px; background-color: white; color: #454748; border-collapse:separate;">
|
||||
<tbody>
|
||||
<!-- HEADER -->
|
||||
<tr>
|
||||
<td align="center" style="min-width: 590px;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;">
|
||||
<tr><td valign="middle">
|
||||
</td><td valign="middle" align="right">
|
||||
<img src="/logo.png?company=${object.create_uid.company_id.id}" style="padding: 0px; margin: 0px; height: auto; width: 80px;" alt="${object.create_uid.company_id.name}"/>
|
||||
</td></tr>
|
||||
<tr><td colspan="2" style="text-align:center;">
|
||||
<hr width="100%" style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 16px 0px;"/>
|
||||
</td></tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- CONTENT -->
|
||||
<tr>
|
||||
<td align="center" style="min-width: 590px;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;">
|
||||
<tr><td valign="top" style="font-size: 13px;">
|
||||
<div>
|
||||
<center>
|
||||
We want to schedule visit date with Researcher ${(object.researcher_ids[1])}<br/><br/><br/>
|
||||
to family ${(object.benefit_id.name)}
|
||||
in this location
|
||||
<a href="${object.get_url_local()}" target="_blank" style="color: blue; text-decoration: underline;">
|
||||
${object.get_url_local()}
|
||||
</a>
|
||||
</center><br/>
|
||||
</div>
|
||||
</td></tr>
|
||||
<tr><td style="text-align:center;">
|
||||
<hr width="100%" style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 16px 0px;"/>
|
||||
</td></tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- FOOTER -->
|
||||
<tr>
|
||||
<td align="center" style="min-width: 590px;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; font-size: 11px; padding: 0px 8px 0px 8px; border-collapse:separate;">
|
||||
<tr><td valign="middle" align="left">
|
||||
${object.create_uid.company_id.name}
|
||||
</td></tr>
|
||||
<tr><td valign="middle" align="left" style="opacity: 0.7;">
|
||||
${object.create_uid.company_id.phone}
|
||||
% if object.create_uid.company_id.email
|
||||
| <a href="'mailto:%s' % ${object.create_uid.company_id.email}" style="text-decoration:none; color: #454748;">${object.create_uid.company_id.email}</a>
|
||||
% endif
|
||||
% if object.create_uid.company_id.website
|
||||
| <a href="'%s' % ${object.create_uid.company_id.website}" style="text-decoration:none; color: #454748;">
|
||||
${object.create_uid.company_id.website}
|
||||
</a>
|
||||
% endif
|
||||
</td></tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td></tr>
|
||||
<table border="0" cellpadding="0" cellspacing="0"
|
||||
style="padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="590"
|
||||
style="padding: 16px; background-color: white; color: #454748; border-collapse:separate;">
|
||||
<tbody>
|
||||
<!-- HEADER -->
|
||||
<tr>
|
||||
<td align="center" style="min-width: 590px;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="590"
|
||||
style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;">
|
||||
<tr>
|
||||
<td valign="middle">
|
||||
</td>
|
||||
<td valign="middle" align="right">
|
||||
<img src="/logo.png?company=${object.create_uid.company_id.id}"
|
||||
style="padding: 0px; margin: 0px; height: auto; width: 80px;"
|
||||
alt="${object.create_uid.company_id.name}"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" style="text-align:center;">
|
||||
<hr width="100%"
|
||||
style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 16px 0px;"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- CONTENT -->
|
||||
<tr>
|
||||
<td align="center" style="min-width: 590px;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="590"
|
||||
style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;">
|
||||
<tr>
|
||||
<td valign="top" style="font-size: 13px;">
|
||||
<div>
|
||||
<center>
|
||||
We want to schedule visit date with Researcher
|
||||
${(object.researcher_ids[1])}
|
||||
<br/>
|
||||
<br/>
|
||||
<br/>
|
||||
to family ${(object.benefit_id.name)}
|
||||
in this location
|
||||
<a href="${object.get_url_local()}" target="_blank"
|
||||
style="color: blue; text-decoration: underline;">
|
||||
${object.get_url_local()}
|
||||
</a>
|
||||
</center>
|
||||
<br/>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:center;">
|
||||
<hr width="100%"
|
||||
style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 16px 0px;"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- FOOTER -->
|
||||
<tr>
|
||||
<td align="center" style="min-width: 590px;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="590"
|
||||
style="min-width: 590px; background-color: white; font-size: 11px; padding: 0px 8px 0px 8px; border-collapse:separate;">
|
||||
<tr>
|
||||
<td valign="middle" align="left">
|
||||
${object.create_uid.company_id.name}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="middle" align="left" style="opacity: 0.7;">
|
||||
${object.create_uid.company_id.phone}
|
||||
% if object.create_uid.company_id.email
|
||||
|
|
||||
<a href="'mailto:%s' % ${object.create_uid.company_id.email}"
|
||||
style="text-decoration:none; color: #454748;">
|
||||
${object.create_uid.company_id.email}
|
||||
</a>
|
||||
% endif
|
||||
% if object.create_uid.company_id.website
|
||||
|
|
||||
<a href="'%s' % ${object.create_uid.company_id.website}"
|
||||
style="text-decoration:none; color: #454748;">
|
||||
${object.create_uid.company_id.website}
|
||||
</a>
|
||||
% endif
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</field>
|
||||
</record>
|
||||
<!-- Schedule a visit -->
|
||||
<!-- <record id="schedule_a_visit_email_template" model="mail.template">-->
|
||||
<!-- <field name="name">Schedule a visit</field>-->
|
||||
<!-- <field name="model_id" ref="odex_benefit.model_visit_location"/>-->
|
||||
<!-- <field name="email_from">-->
|
||||
<!-- <![CDATA[${user.company_id.name} <${(user.company_id.email or user.partner_id.email or 'noreply@localhost')|safe}>]]></field>-->
|
||||
<!-- <field name="email_to">${(object.benefit_id.email)|safe}</field>-->
|
||||
<!-- <field name="email_cc">${(object.get_researchers_email())|safe}</field>-->
|
||||
<!-- <field name="subject"> Schedule a visit </field>-->
|
||||
<!-- <field name="body_html" type="html">-->
|
||||
<!-- <table border="0" cellpadding="0" cellspacing="0" style="padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"><tr><td align="center">-->
|
||||
<!-- <table border="0" cellpadding="0" cellspacing="0" width="590" style="padding: 16px; background-color: white; color: #454748; border-collapse:separate;">-->
|
||||
<!-- <tbody>-->
|
||||
<!-- <!– HEADER –>-->
|
||||
<!-- <tr>-->
|
||||
<!-- <td align="center" style="min-width: 590px;">-->
|
||||
<!-- <table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;">-->
|
||||
<!-- <tr><td valign="middle">-->
|
||||
<!-- </td><td valign="middle" align="right">-->
|
||||
<!-- <img src="/logo.png?company=${object.create_uid.company_id.id}" style="padding: 0px; margin: 0px; height: auto; width: 80px;" alt="${object.create_uid.company_id.name}"/>-->
|
||||
<!-- </td></tr>-->
|
||||
<!-- <tr><td colspan="2" style="text-align:center;">-->
|
||||
<!-- <hr width="100%" style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 16px 0px;"/>-->
|
||||
<!-- </td></tr>-->
|
||||
<!-- </table>-->
|
||||
<!-- </td>-->
|
||||
<!-- </tr>-->
|
||||
<!-- <!– CONTENT –>-->
|
||||
<!-- <tr>-->
|
||||
<!-- <td align="center" style="min-width: 590px;">-->
|
||||
<!-- <table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;">-->
|
||||
<!-- <tr><td valign="top" style="font-size: 13px;">-->
|
||||
<!-- <div>-->
|
||||
<!-- <center>-->
|
||||
<!-- We want to schedule visit date<br/><br/><br/>-->
|
||||
<!-- </center><br/>-->
|
||||
<!-- </div>-->
|
||||
<!-- </td></tr>-->
|
||||
<!-- <tr><td style="text-align:center;">-->
|
||||
<!-- <hr width="100%" style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 16px 0px;"/>-->
|
||||
<!-- </td></tr>-->
|
||||
<!-- </table>-->
|
||||
<!-- </td>-->
|
||||
<!-- </tr>-->
|
||||
<!-- <!– FOOTER –>-->
|
||||
<!-- <tr>-->
|
||||
<!-- <td align="center" style="min-width: 590px;">-->
|
||||
<!-- <table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; font-size: 11px; padding: 0px 8px 0px 8px; border-collapse:separate;">-->
|
||||
<!-- <tr><td valign="middle" align="left">-->
|
||||
<!-- ${object.create_uid.company_id.name}-->
|
||||
<!-- </td></tr>-->
|
||||
<!-- <tr><td valign="middle" align="left" style="opacity: 0.7;">-->
|
||||
<!-- ${object.create_uid.company_id.phone}-->
|
||||
<!-- % if object.create_uid.company_id.email-->
|
||||
<!-- | <a href="'mailto:%s' % ${object.create_uid.company_id.email}" style="text-decoration:none; color: #454748;">${object.create_uid.company_id.email}</a>-->
|
||||
<!-- % endif-->
|
||||
<!-- % if object.create_uid.company_id.website-->
|
||||
<!-- | <a href="'%s' % ${object.create_uid.company_id.website}" style="text-decoration:none; color: #454748;">-->
|
||||
<!-- ${object.create_uid.company_id.website}-->
|
||||
<!-- </a>-->
|
||||
<!-- % endif-->
|
||||
<!-- </td></tr>-->
|
||||
<!-- </table>-->
|
||||
<!-- </td>-->
|
||||
<!-- </tr>-->
|
||||
<!-- </tbody>-->
|
||||
<!-- </table>-->
|
||||
<!-- </td></tr>-->
|
||||
<!-- </table>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
<!-- Schedule a visit -->
|
||||
<!-- <record id="schedule_a_visit_email_template" model="mail.template">-->
|
||||
<!-- <field name="name">Schedule a visit</field>-->
|
||||
<!-- <field name="model_id" ref="odex_benefit.model_visit_location"/>-->
|
||||
<!-- <field name="email_from">-->
|
||||
<!-- <![CDATA[${user.company_id.name} <${(user.company_id.email or user.partner_id.email or 'noreply@localhost')|safe}>]]></field>-->
|
||||
<!-- <field name="email_to">${(object.benefit_id.email)|safe}</field>-->
|
||||
<!-- <field name="email_cc">${(object.get_researchers_email())|safe}</field>-->
|
||||
<!-- <field name="subject"> Schedule a visit </field>-->
|
||||
<!-- <field name="body_html" type="html">-->
|
||||
<!-- <table border="0" cellpadding="0" cellspacing="0" style="padding-top: 16px; background-color: #F1F1F1; font-family:Verdana, Arial,sans-serif; color: #454748; width: 100%; border-collapse:separate;"><tr><td align="center">-->
|
||||
<!-- <table border="0" cellpadding="0" cellspacing="0" width="590" style="padding: 16px; background-color: white; color: #454748; border-collapse:separate;">-->
|
||||
<!-- <tbody>-->
|
||||
<!-- <!– HEADER –>-->
|
||||
<!-- <tr>-->
|
||||
<!-- <td align="center" style="min-width: 590px;">-->
|
||||
<!-- <table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;">-->
|
||||
<!-- <tr><td valign="middle">-->
|
||||
<!-- </td><td valign="middle" align="right">-->
|
||||
<!-- <img src="/logo.png?company=${object.create_uid.company_id.id}" style="padding: 0px; margin: 0px; height: auto; width: 80px;" alt="${object.create_uid.company_id.name}"/>-->
|
||||
<!-- </td></tr>-->
|
||||
<!-- <tr><td colspan="2" style="text-align:center;">-->
|
||||
<!-- <hr width="100%" style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 16px 0px;"/>-->
|
||||
<!-- </td></tr>-->
|
||||
<!-- </table>-->
|
||||
<!-- </td>-->
|
||||
<!-- </tr>-->
|
||||
<!-- <!– CONTENT –>-->
|
||||
<!-- <tr>-->
|
||||
<!-- <td align="center" style="min-width: 590px;">-->
|
||||
<!-- <table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; padding: 0px 8px 0px 8px; border-collapse:separate;">-->
|
||||
<!-- <tr><td valign="top" style="font-size: 13px;">-->
|
||||
<!-- <div>-->
|
||||
<!-- <center>-->
|
||||
<!-- We want to schedule visit date<br/><br/><br/>-->
|
||||
<!-- </center><br/>-->
|
||||
<!-- </div>-->
|
||||
<!-- </td></tr>-->
|
||||
<!-- <tr><td style="text-align:center;">-->
|
||||
<!-- <hr width="100%" style="background-color:rgb(204,204,204);border:medium none;clear:both;display:block;font-size:0px;min-height:1px;line-height:0; margin: 16px 0px 16px 0px;"/>-->
|
||||
<!-- </td></tr>-->
|
||||
<!-- </table>-->
|
||||
<!-- </td>-->
|
||||
<!-- </tr>-->
|
||||
<!-- <!– FOOTER –>-->
|
||||
<!-- <tr>-->
|
||||
<!-- <td align="center" style="min-width: 590px;">-->
|
||||
<!-- <table border="0" cellpadding="0" cellspacing="0" width="590" style="min-width: 590px; background-color: white; font-size: 11px; padding: 0px 8px 0px 8px; border-collapse:separate;">-->
|
||||
<!-- <tr><td valign="middle" align="left">-->
|
||||
<!-- ${object.create_uid.company_id.name}-->
|
||||
<!-- </td></tr>-->
|
||||
<!-- <tr><td valign="middle" align="left" style="opacity: 0.7;">-->
|
||||
<!-- ${object.create_uid.company_id.phone}-->
|
||||
<!-- % if object.create_uid.company_id.email-->
|
||||
<!-- | <a href="'mailto:%s' % ${object.create_uid.company_id.email}" style="text-decoration:none; color: #454748;">${object.create_uid.company_id.email}</a>-->
|
||||
<!-- % endif-->
|
||||
<!-- % if object.create_uid.company_id.website-->
|
||||
<!-- | <a href="'%s' % ${object.create_uid.company_id.website}" style="text-decoration:none; color: #454748;">-->
|
||||
<!-- ${object.create_uid.company_id.website}-->
|
||||
<!-- </a>-->
|
||||
<!-- % endif-->
|
||||
<!-- </td></tr>-->
|
||||
<!-- </table>-->
|
||||
<!-- </td>-->
|
||||
<!-- </tr>-->
|
||||
<!-- </tbody>-->
|
||||
<!-- </table>-->
|
||||
<!-- </td></tr>-->
|
||||
<!-- </table>-->
|
||||
<!-- </field>-->
|
||||
<!-- </record>-->
|
||||
|
||||
</data>
|
||||
</data>
|
||||
</odoo>
|
||||
|
|
|
|||
|
|
@ -35,12 +35,12 @@
|
|||
<record id="visit_location_sequence" model="ir.sequence">
|
||||
<field name="name">Visit Sequence</field>
|
||||
<field name="code">visit.location.sequence</field>
|
||||
<field name="prefix">V/</field>
|
||||
<field name="prefix">VT</field>
|
||||
<field eval="1" name="number_next"/>
|
||||
<field eval="1" name="number_increment"/>
|
||||
<field eval="True" name="use_date_range"/>
|
||||
<field eval="False" name="company_id"/>
|
||||
<field name="padding">4</field>
|
||||
<field name="padding">5</field>
|
||||
</record>
|
||||
<!-- Sequence for services requests -->
|
||||
<record id="service_request_sequence" model="ir.sequence">
|
||||
|
|
|
|||
|
|
@ -8,8 +8,9 @@
|
|||
<field name="binding_model_id" ref="odex_benefit.model_service_request"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">
|
||||
if record.project_create == False:
|
||||
action = records.action_open_exchange_order_wizard()</field>
|
||||
if record.project_create == False:
|
||||
action = records.action_open_exchange_order_wizard()
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="server_action_seasonal_service_exchange_orders" model="ir.actions.server">
|
||||
|
|
@ -18,7 +19,7 @@
|
|||
<field name="binding_model_id" ref="odex_benefit.model_seasonal_service"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">
|
||||
action = records.action_open_exchange_order_wizard()
|
||||
action = records.action_open_exchange_order_wizard()
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
|
@ -30,5 +31,16 @@
|
|||
<field name="state">code</field>
|
||||
<field name="code">action = records.create_vendor_bill()</field>
|
||||
</record>
|
||||
|
||||
<record id="action_assign_visit_sequence" model="ir.actions.server">
|
||||
<field name="name">Assign Visit Sequence</field>
|
||||
<field name="model_id" ref="odex_benefit.model_visit_location"/>
|
||||
<field name="binding_model_id" ref="odex_benefit.model_visit_location"/>
|
||||
<field name="state">code</field>
|
||||
<field name="code">
|
||||
action = records.assign_sequence_to_records()
|
||||
</field>
|
||||
<field name="binding_type">action</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
|
|
@ -4039,10 +4039,14 @@ msgstr ""
|
|||
#: model:ir.model.fields,field_description:odex_benefit.field_service_request__description
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_specialization_specialization__description
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_sport_type__description
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_visit_location__description
|
||||
msgid "Description"
|
||||
msgstr "الوصف"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_visit_location__description
|
||||
msgid "Description"
|
||||
msgstr "اسم الزيارة"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_attachments_settings__disabilities_id
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_family_member__disabilities_ids
|
||||
|
|
@ -7851,7 +7855,7 @@ msgstr ""
|
|||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_visit_location__message
|
||||
msgid "Message"
|
||||
msgstr "الرسالة"
|
||||
msgstr "الوصف"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_appliances_furniture__message_has_error
|
||||
|
|
@ -9424,10 +9428,14 @@ msgstr ""
|
|||
#: model:ir.model.fields,field_description:odex_benefit.field_external_benefits__ref
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_grant_benefit__ref
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_service_request__name
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_visit_location__name
|
||||
msgid "Reference"
|
||||
msgstr "رقم الإشارة"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_visit_location__name
|
||||
msgid "Reference"
|
||||
msgstr "كود الزيارة"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.external_request_form
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form
|
||||
|
|
@ -10585,13 +10593,22 @@ msgstr "الخدمة الفرعية"
|
|||
#: model_terms:ir.ui.view,arch_db:odex_benefit.benefit_club_form
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.view_exception_member_wizard_form
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.view_exception_wizard_form
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.view_resarcher_family_wizard_form
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.view_resarcher_member_wizard_form
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.view_suspend_member_reason_wizard_form
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.view_suspend_reason_wizard_form
|
||||
msgid "Submit"
|
||||
msgstr "إرسال"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.view_resarcher_family_wizard_form
|
||||
msgid "Return to Record"
|
||||
msgstr "العودة"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.view_resarcher_family_wizard_form
|
||||
msgid "Submit"
|
||||
msgstr "اسناد للأخصائي"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_benefit_club__subscription_amount
|
||||
msgid "Subscription Amount"
|
||||
|
|
@ -11649,7 +11666,7 @@ msgstr "عدم اكمال الزيارة"
|
|||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_visit_location__visit_date
|
||||
msgid "Visit Date"
|
||||
msgstr "تاريخ الزيارة"
|
||||
msgstr "تاريخ ووقت الزيارة"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_visit_location__visit_objective
|
||||
|
|
@ -11935,6 +11952,16 @@ msgstr "مع الزوج"
|
|||
msgid "Woman Manager"
|
||||
msgstr "مدير اللجنة النسائية"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__grant_benefit__state__new
|
||||
msgid "New"
|
||||
msgstr "جديد"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.actions.server,name:odex_benefit.action_assign_visit_sequence
|
||||
msgid "Assign Visit Sequence"
|
||||
msgstr "تعيين تسلسل الزيارات"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_benefits_representative__work
|
||||
#: model:ir.model.fields,field_description:odex_benefit.field_external_benefits__work
|
||||
|
|
@ -11946,6 +11973,14 @@ msgstr "العمل"
|
|||
msgid "Work History"
|
||||
msgstr ""
|
||||
|
||||
#. module: odex_benefit
|
||||
#: code:addons/odex_benefit/wizards/researcher_wizard.py:0
|
||||
#, python-format
|
||||
msgid ""
|
||||
"File has been assigned to specialist \"%s\" and initial visit created with "
|
||||
"number \"%s\""
|
||||
msgstr "تم إسناد الملف إلى الأخصائي \"%s\" وتم إنشاء زيارة أولية برقم \"%s\""
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:ir.model.fields.selection,name:odex_benefit.selection__family_member__member_location__work_inside_saudi_arabia
|
||||
msgid "Work Inside Saudi Arabia"
|
||||
|
|
@ -14152,3 +14187,150 @@ msgstr "يوجد بالفعل اوامر صرف مرتبطة بالطلب/ات"
|
|||
#, python-format
|
||||
msgid "Couldn't create same benefit category and count"
|
||||
msgstr "فئة الأسرة وعدد المستفيدين المدخلة موجودة من قبل."
|
||||
|
||||
#. module: odex_benefit
|
||||
#: code:addons/odex_benefit/models/benefit.py:0
|
||||
#, python-format
|
||||
msgid "Visit Location"
|
||||
msgstr "الزيارات"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model_terms:ir.ui.view,arch_db:odex_benefit.grant_benefit_form
|
||||
msgid "Visit location"
|
||||
msgstr "الزيارات"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: code:addons/odex_benefit/wizards/researcher_wizard.py:0
|
||||
#, python-format
|
||||
msgid "New File Assignment"
|
||||
msgstr "إسناد ملف جديد"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: code:addons/odex_benefit/wizards/researcher_wizard.py:0
|
||||
#, python-format
|
||||
msgid "Dear"
|
||||
msgstr "عزيزي"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: code:addons/odex_benefit/wizards/researcher_wizard.py:0
|
||||
#, python-format
|
||||
msgid "A new file has been assigned to you:"
|
||||
msgstr "تم إسناد ملف جديد إليك:"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: code:addons/odex_benefit/wizards/researcher_wizard.py:0
|
||||
#, python-format
|
||||
msgid "Benefit File:"
|
||||
msgstr "ملف المستفيد:"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: code:addons/odex_benefit/wizards/researcher_wizard.py:0
|
||||
#, python-format
|
||||
msgid "Visit Number:"
|
||||
msgstr "رقم الزيارة:"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: code:addons/odex_benefit/wizards/researcher_wizard.py:0
|
||||
#, python-format
|
||||
msgid "Visit Date:"
|
||||
msgstr "تاريخ الزيارة:"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: code:addons/odex_benefit/wizards/researcher_wizard.py:0
|
||||
#, python-format
|
||||
msgid "Please check your dashboard for more details."
|
||||
msgstr "يرجى التحقق من لوحة التحكم لمزيد من التفاصيل."
|
||||
|
||||
#. module: odex_benefit
|
||||
#: code:addons/odex_benefit/wizards/researcher_wizard.py:0
|
||||
#, python-format
|
||||
msgid "Best regards,"
|
||||
msgstr "مع أطيب التحيات،"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: code:addons/odex_benefit/wizards/researcher_wizard.py:0
|
||||
#, python-format
|
||||
msgid "System"
|
||||
msgstr "النظام"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: code:addons/odex_benefit/wizards/researcher_wizard.py:0
|
||||
#, python-format
|
||||
msgid "New file assignment for %s. Visit #%s created."
|
||||
msgstr "تم إسناد ملف جديد إلى %s. تم إنشاء زيارة رقم #%s."
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:mail.template,body_html:odex_benefit.visit_notification_template
|
||||
msgid ""
|
||||
"<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"padding-top: 16px; background-color: #F9F9F9; font-family: Verdana, Arial, sans-serif; color: #333; width: 100%; border-collapse: separate;\">\n"
|
||||
" <tr>\n"
|
||||
" <td align=\"center\">\n"
|
||||
" <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" style=\"background-color: #fff; padding: 16px; border-collapse: separate;\">\n"
|
||||
" <tr>\n"
|
||||
" <td style=\"font-size: 14px; line-height: 20px;\">\n"
|
||||
" <p>Hello,</p>\n"
|
||||
" <p>A new visit has been assigned to you. Details are below:</p>\n"
|
||||
" <ul>\n"
|
||||
" <li>\n"
|
||||
" <strong>Benefit File:</strong>\n"
|
||||
" ${object.benefit_id.name or 'N/A'}\n"
|
||||
" </li>\n"
|
||||
" <li>\n"
|
||||
" <strong>Visit Number:</strong>\n"
|
||||
" ${object.name or object.id}\n"
|
||||
" </li>\n"
|
||||
" <li>\n"
|
||||
" <strong>Visit Date:</strong>\n"
|
||||
" ${format_date(object.visit_date)}\n"
|
||||
" </li>\n"
|
||||
" </ul>\n"
|
||||
" <p>Please check your dashboard for more details.</p>\n"
|
||||
" <br/>\n"
|
||||
" <p style=\"font-size: 11px; color: grey;\">This is an automated message. Do not\n"
|
||||
" reply.\n"
|
||||
" </p>\n"
|
||||
" </td>\n"
|
||||
" </tr>\n"
|
||||
" </table>\n"
|
||||
" </td>\n"
|
||||
" </tr>\n"
|
||||
" </table>\n"
|
||||
" "
|
||||
msgstr ""
|
||||
"<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"padding-top: 16px; background-color: #F9F9F9; font-family: Verdana, Arial, sans-serif; color: #333; width: 100%; border-collapse: separate;\">\n"
|
||||
" <tr>\n"
|
||||
" <td align=\"center\">\n"
|
||||
" <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" style=\"background-color: #fff; padding: 16px; border-collapse: separate;\">\n"
|
||||
" <tr>\n"
|
||||
" <td style=\"font-size: 14px; line-height: 20px;\">\n"
|
||||
" <p>مرحبًا،</p>\n"
|
||||
" <p>تم تعيين زيارة جديدة لك. التفاصيل كالتالي:</p>\n"
|
||||
" <ul>\n"
|
||||
" <li>\n"
|
||||
" <strong>ملف المستفيد:</strong>\n"
|
||||
" ${object.benefit_id.name or 'غير متوفر'}\n"
|
||||
" </li>\n"
|
||||
" <li>\n"
|
||||
" <strong>رقم الزيارة:</strong>\n"
|
||||
" ${object.name or object.id}\n"
|
||||
" </li>\n"
|
||||
" <li>\n"
|
||||
" <strong>تاريخ الزيارة:</strong>\n"
|
||||
" ${format_date(object.visit_date)}\n"
|
||||
" </li>\n"
|
||||
" </ul>\n"
|
||||
" <p>يرجى التحقق من لوحة التحكم الخاصة بك لمزيد من التفاصيل.</p>\n"
|
||||
" <br/>\n"
|
||||
" <p style=\"font-size: 11px; color: grey;\">هذه رسالة آلية. لا تقم بالرد عليها.</p>\n"
|
||||
" </td>\n"
|
||||
" </tr>\n"
|
||||
" </table>\n"
|
||||
" </td>\n"
|
||||
" </tr>\n"
|
||||
"</table>\n"
|
||||
|
||||
#. module: odex_benefit
|
||||
#: model:mail.template,subject:odex_benefit.visit_notification_template
|
||||
msgid "${object.benefit_id.name or 'New Visit Assigned'}"
|
||||
msgstr "${object.benefit_id.name or 'تم تعيين زيارة جديدة'}"
|
||||
|
||||
|
|
|
|||
|
|
@ -384,6 +384,7 @@ class GrantBenefitProfile(models.Model):
|
|||
request_activity_id = fields.Many2one('mail.activity')
|
||||
state = fields.Selection([
|
||||
('draft', 'Draft'),
|
||||
('new', 'New'),
|
||||
('complete_info', 'Complete Information'),
|
||||
('waiting_approve', 'Waiting Approved'),
|
||||
('woman_manager', 'Woman Manager'),
|
||||
|
|
@ -490,8 +491,12 @@ class GrantBenefitProfile(models.Model):
|
|||
family_monthly_clotting = fields.Float(string="Family Monthly Clotting", compute='_get_family_monthly_values')
|
||||
total_family_expenses = fields.Float(string="Total Family Expenses", compute='_get_family_monthly_values')
|
||||
total_move_lines = fields.Integer(string="Total Move Lines", compute='_get_total_move_lines')
|
||||
<<<<<<< HEAD
|
||||
visit_location_count = fields.Integer(string="Visit Location Count", compute='_compute_visit_location_count')
|
||||
=======
|
||||
total_service_requests = fields.Integer(compute='_get_total_service_requests')
|
||||
total_seasonal_service_requests = fields.Integer(compute='_get_total_seasonal_service_requests')
|
||||
>>>>>>> 27f6c2fc2a76ef909d8386bb956fbc32190d4b21
|
||||
invoices_count = fields.Integer(string="Invoices Count", compute='_get_invoices_count')
|
||||
required_attach = fields.Selection(selection=[('true', 'True'), ('false', 'False')],compute='get_required_attach',store=True)
|
||||
income_required_attach = fields.Selection(selection=[('true', 'True'), ('false', 'False')],compute='get_income_required_attach',store=True)
|
||||
|
|
@ -680,7 +685,16 @@ class GrantBenefitProfile(models.Model):
|
|||
|
||||
def _get_total_move_lines(self):
|
||||
for rec in self:
|
||||
<<<<<<< HEAD
|
||||
rec.total_move_lines = self.env['account.move.line'].search_count([('benefit_family_id', '=', rec.id)
|
||||
|
||||
])
|
||||
def _compute_visit_location_count(self):
|
||||
for rec in self:
|
||||
rec.visit_location_count = self.env['visit.location'].search_count([('benefit_id', '=', rec.id)])
|
||||
=======
|
||||
rec.total_move_lines = self.env['account.move.line'].search_count([('benefit_family_id', '=', rec.id)])
|
||||
>>>>>>> 27f6c2fc2a76ef909d8386bb956fbc32190d4b21
|
||||
|
||||
def action_open_related_move_line_records(self):
|
||||
""" Opens a tree view with related records filtered by a dynamic domain """
|
||||
|
|
@ -698,6 +712,21 @@ class GrantBenefitProfile(models.Model):
|
|||
}
|
||||
return action
|
||||
|
||||
<<<<<<< HEAD
|
||||
def action_open_visit_location(self):
|
||||
""" Opens a tree view with related records filtered by a dynamic domain """
|
||||
visit_location = self.env['visit.location'].search([('benefit_id', '=', self.id)]).ids
|
||||
action = {
|
||||
'type': 'ir.actions.act_window',
|
||||
'name': _('Visit Location'),
|
||||
'res_model': 'visit.location',
|
||||
'view_mode': 'tree,form',
|
||||
'domain': [('id', 'in', visit_location)],
|
||||
'target': 'current',
|
||||
}
|
||||
return action
|
||||
|
||||
=======
|
||||
def _get_total_service_requests(self):
|
||||
for rec in self:
|
||||
rec.total_service_requests = self.env['service.request'].search_count([('benefit_type', '=', 'family'), ('family_id', '=', rec.id)])
|
||||
|
|
@ -736,6 +765,7 @@ class GrantBenefitProfile(models.Model):
|
|||
'target': 'current',
|
||||
}
|
||||
return action
|
||||
>>>>>>> 27f6c2fc2a76ef909d8386bb956fbc32190d4b21
|
||||
|
||||
def action_open_related_invoice_records(self):
|
||||
""" Opens a tree view with related records filtered by a dynamic domain """
|
||||
|
|
|
|||
|
|
@ -54,6 +54,14 @@ class Visit(models.Model):
|
|||
vals['name'] = self.env['ir.sequence'].next_by_code('visit.location.sequence') or _('New')
|
||||
return super(Visit, self).create(vals)
|
||||
|
||||
def assign_sequence_to_records(self):
|
||||
sequence = self.env['ir.sequence']
|
||||
sorted_records = self.sorted(lambda r: r.create_date)
|
||||
|
||||
for record in sorted_records:
|
||||
if not record.name or record.name == _('New'):
|
||||
record.name = sequence.next_by_code('visit.location.sequence')
|
||||
|
||||
def get_researchers_email(self):
|
||||
email_ids = ''
|
||||
for rec in self.researcher_ids:
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -19,21 +19,21 @@
|
|||
<group>
|
||||
<!-- <field name="benefit_type"/>-->
|
||||
<field name="name"/>
|
||||
<field name="description" attrs="{'readonly':[('state', 'in', ['close','cancel'])]}"/>
|
||||
<field name="visit_types" attrs="{'readonly':[('state', 'in', ['close','cancel'])]}"/>
|
||||
<field name="benefit_id" attrs="{'readonly':[('state', 'in', ['close','cancel'])]}"/>
|
||||
<!-- <field name="benefit_code"/>-->
|
||||
<!-- <field name="family_id" attrs="{'invisible':[('benefit_type','=','benefit')]}"/>-->
|
||||
<!-- <field name="selector"/>-->
|
||||
<!-- <field name="researcher_id" attrs="{'invisible':[('selector','=','researcher_team')]}"/>-->
|
||||
<field name="researcher_team" attrs="{'readonly':[('state', 'in', ['close','cancel'])]}"/>
|
||||
<field name="researcher_ids" widget="many2many_tags" attrs="{'readonly':[('state', 'in', ['close','cancel'])]}" force_save="1"/>
|
||||
<field name="description" attrs="{'readonly':[('state', 'in', ['close','cancel'])]}"/>
|
||||
<field name="researcher_ids" invisible="1" widget="many2many_tags" attrs="{'readonly':[('state', 'in', ['close','cancel'])]}" force_save="1"/>
|
||||
<field name="message" attrs="{'invisible':[('state', 'not in', ['draft', 'contact'])],'readonly':[('state', 'in', ['close','cancel'])]}"/>
|
||||
<field name="reason" attrs="{'invisible':[('state', 'not in', ['cancel'])],'readonly':[('state', 'in', ['close','cancel'])]}"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="visit_date" attrs="{'readonly':[('state', 'in', ['close','cancel'])]}"/>
|
||||
<field name="visit_objective" invisible="1" attrs="{'readonly':[('state', 'in', ['close','cancel'])]}"/>
|
||||
<field name="visit_types" attrs="{'readonly':[('state', 'in', ['close','cancel'])]}"/>
|
||||
<field name="contact_type" attrs="{'readonly':[('state', 'in', ['close','cancel'])]}"/>
|
||||
</group>
|
||||
</group>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
from odoo import models, fields,api,_
|
||||
from odoo import models, fields, api, _
|
||||
from datetime import date
|
||||
|
||||
|
||||
class ReasearcherMemberWizard(models.TransientModel):
|
||||
_name = 'researcher.member.wizard'
|
||||
|
||||
|
|
@ -15,7 +16,7 @@ class ReasearcherMemberWizard(models.TransientModel):
|
|||
# ], string='Selector' ,default="researcher")
|
||||
# researcher_id = fields.Many2one("hr.employee", string="Researcher")
|
||||
researcher_team = fields.Many2one("committees.line", string="Researcher Team")
|
||||
member_id = fields.Many2one("family.member", string="Member",default=_default_member)
|
||||
member_id = fields.Many2one("family.member", string="Member", default=_default_member)
|
||||
|
||||
def submit_member(self):
|
||||
for rec in self:
|
||||
|
|
@ -31,6 +32,8 @@ class ReasearcherMemberWizard(models.TransientModel):
|
|||
# 'researcher_team': rec.researcher_team.id,
|
||||
# 'state': 'draft'
|
||||
# })
|
||||
|
||||
|
||||
class ReasearcherFamilyWizard(models.TransientModel):
|
||||
_name = 'researcher.family.wizard'
|
||||
|
||||
|
|
@ -42,9 +45,11 @@ class ReasearcherFamilyWizard(models.TransientModel):
|
|||
# ('researcher_team', 'Researcher Team'),
|
||||
# ], string='Selector' ,default="researcher")
|
||||
# researcher_id = fields.Many2one("hr.employee", string="Researcher")
|
||||
researcher_team = fields.Many2one("committees.line", string="Researcher Team",domain="[('branch_custom_id', '=',branch_custom_id)]")
|
||||
benefit_id = fields.Many2one("grant.benefit", string="Benefit",default=_default_benefit)
|
||||
branch_custom_id = fields.Many2one("branch.settings", string="Department",related="benefit_id.branch_custom_id")
|
||||
researcher_team = fields.Many2one("committees.line", string="Researcher Team",
|
||||
domain="[('branch_custom_id', '=',branch_custom_id)]")
|
||||
benefit_id = fields.Many2one("grant.benefit", string="Benefit", default=_default_benefit)
|
||||
branch_custom_id = fields.Many2one("branch.settings", string="Department", related="benefit_id.branch_custom_id")
|
||||
is_submitted = fields.Boolean(string="Submitted", default=False)
|
||||
|
||||
def submit_family(self):
|
||||
for rec in self:
|
||||
|
|
@ -52,7 +57,7 @@ class ReasearcherFamilyWizard(models.TransientModel):
|
|||
'state': 'complete_info',
|
||||
'researcher_id': rec.researcher_team.id
|
||||
})
|
||||
self.env['visit.location'].create({
|
||||
visit_record = self.env['visit.location'].create({
|
||||
'benefit_id': rec.benefit_id.id,
|
||||
'visit_date': date.today(),
|
||||
'visit_types': 1,
|
||||
|
|
@ -60,11 +65,120 @@ class ReasearcherFamilyWizard(models.TransientModel):
|
|||
# 'selector': rec.selector,
|
||||
# 'researcher_id': rec.researcher_id.id,
|
||||
'researcher_team': rec.researcher_team.id,
|
||||
'state':'draft'
|
||||
'state': 'draft'
|
||||
})
|
||||
rec.is_submitted = True
|
||||
rec._send_assignment_notification(visit_record)
|
||||
specialist_name = rec.researcher_team.name or _('Not Specified')
|
||||
visit_number = visit_record.name or str(visit_record.id)
|
||||
message = _('File has been assigned to specialist "%s" and initial visit created with number "%s"') % (specialist_name, visit_number)
|
||||
|
||||
return {
|
||||
'type': 'ir.actions.client',
|
||||
'tag': 'display_notification',
|
||||
'params': {
|
||||
'title': _('Assignment Successful ✓'),
|
||||
'message': message,
|
||||
'type': 'success',
|
||||
'sticky': False,
|
||||
'next': {
|
||||
'type': 'ir.actions.act_window_close'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def action_return_to_benefit(self):
|
||||
self.ensure_one()
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
'res_model': 'grant.benefit',
|
||||
'view_mode': 'form',
|
||||
'res_id': self.benefit_id.id,
|
||||
'target': 'main'
|
||||
}
|
||||
|
||||
def send_visit_date_email(self):
|
||||
template = self.env.ref('odex_benefit.visit_date_email', False)
|
||||
if not template:
|
||||
return
|
||||
template.with_context(lang=self.env.user.lang).send_mail(self.id, force_send=True, raise_exception=False)
|
||||
|
||||
def _send_assignment_notification(self, visit_record):
|
||||
if not self.researcher_team or not self.researcher_team.employee_id:
|
||||
return
|
||||
for employee in self.researcher_team.employee_id:
|
||||
user = employee.user_id
|
||||
if not user or not user.active:
|
||||
continue
|
||||
|
||||
notification_type = getattr(user, 'notification_type', 'email')
|
||||
if notification_type == 'email':
|
||||
self._send_email_notification(user, visit_record)
|
||||
else:
|
||||
self._send_in_system_notification(user, visit_record)
|
||||
|
||||
def _send_email_notification(self, specialist_user, visit_record):
|
||||
try:
|
||||
template = self.env.ref('odex_benefit.visit_notification_template', False)
|
||||
if not template:
|
||||
return
|
||||
template.write({
|
||||
'email_to': specialist_user.work_email or specialist_user.email,
|
||||
'email_cc': self.env.user.company_id.hr_email or self.env.user.company_id.email,
|
||||
})
|
||||
template.with_context(lang=self.env.user.lang).send_mail(visit_record.id, force_send=True, raise_exception=False)
|
||||
|
||||
except Exception as e:
|
||||
self._send_in_system_notification(specialist_user, visit_record)
|
||||
|
||||
def _send_in_system_notification(self, specialist_user, visit_record):
|
||||
try:
|
||||
template = self.env.ref('odex_benefit.visit_notification_template', False)
|
||||
if template:
|
||||
body_html = template._render_field('body_html', [visit_record.id], compute_lang=True)[
|
||||
visit_record.id]
|
||||
else:
|
||||
body_html = """
|
||||
<div style="font-family: Arial, sans-serif; padding: 20px;">
|
||||
<h3>%s</h3>
|
||||
<p>%s %s,</p>
|
||||
<p>%s</p>
|
||||
<ul>
|
||||
<li><strong>%s</strong> %s</li>
|
||||
<li><strong>%s</strong> %s</li>
|
||||
<li><strong>%s</strong> %s</li>
|
||||
</ul>
|
||||
<p>%s</p>
|
||||
<p>%s<br/>%s</p>
|
||||
</div>
|
||||
""" % (
|
||||
_('New File Assignment'),
|
||||
_('Dear'), specialist_user.name,
|
||||
_('A new file has been assigned to you:'),
|
||||
_('Benefit File:'), self.benefit_id.name or _('N/A'),
|
||||
_('Visit Number:'), visit_record.name or visit_record.id,
|
||||
_('Visit Date:'), visit_record.visit_date,
|
||||
_('Please check your dashboard for more details.'),
|
||||
_('Best regards,'), _('System')
|
||||
)
|
||||
|
||||
partners = specialist_user.partner_id
|
||||
partners.message_post(
|
||||
body=body_html,
|
||||
partner_ids=partners.ids,
|
||||
subtype_id=self.env.ref('mail.mt_comment').id,
|
||||
content_subtype='html',
|
||||
email_layout_xmlid=False,
|
||||
notify_by_email=False,
|
||||
)
|
||||
|
||||
except Exception as e:
|
||||
visit_record.message_post(
|
||||
body=_("New file assignment for %s. Visit #%s created.") % (
|
||||
specialist_user.name,
|
||||
visit_record.name or visit_record.id
|
||||
),
|
||||
partner_ids=[specialist_user.partner_id.id],
|
||||
subtype_id=self.env.ref('mail.mt_note').id,
|
||||
notify_by_email=False,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -31,11 +31,13 @@
|
|||
<sheet>
|
||||
<group>
|
||||
<field name="benefit_id" invisible="1"/>
|
||||
<field name="is_submitted" invisible="1"/>
|
||||
<field name="branch_custom_id" invisible="1"/>
|
||||
<field name="researcher_team" required="1"/>
|
||||
</group>
|
||||
<footer>
|
||||
<button name="submit_family" type="object" string="Submit" class="oe_highlight" attrs="{'invisible':[('benefit_id','=',False)]}"/>
|
||||
<button name="submit_family" type="object" string="Submit" class="oe_highlight" attrs="{'invisible':['|',('benefit_id','=',False),('is_submitted','=',True)]}"/>
|
||||
<button name="action_return_to_benefit" type="object" string="Return to Record" class="btn-secondary"/>
|
||||
</footer>
|
||||
</sheet>
|
||||
</form>
|
||||
|
|
|
|||
Loading…
Reference in New Issue