Browse Source

account_partner_aged_statement_webkit: fetch the email's body from the Company's Overdue Message

pull/9/head
Marc Cassuto 11 years ago
committed by Maxime Chambreuil
parent
commit
8164107ae7
  1. 3
      account_partner_aged_statement_webkit/__openerp__.py
  2. 16
      account_partner_aged_statement_webkit/partner_aged_statement_data.xml
  3. 5
      account_partner_aged_statement_webkit/report/partner_aged_statement_report.py

3
account_partner_aged_statement_webkit/__openerp__.py

@ -48,6 +48,9 @@ informations :
* the list of invoices per period * the list of invoices per period
* the invoices are also shown with the foreign currency * the invoices are also shown with the foreign currency
Both messages, in the PDF and the email are taken from the Overdue Payments
Message defined on the Company's configuration.
Contributors Contributors
------------ ------------
* Marc Cassuto (marc.cassuto@savoirfairelinux.com) * Marc Cassuto (marc.cassuto@savoirfairelinux.com)

16
account_partner_aged_statement_webkit/partner_aged_statement_data.xml

@ -2,7 +2,7 @@
<openerp> <openerp>
<!-- Mail template is done in a NOUPDATE block <!-- Mail template is done in a NOUPDATE block
so users can freely customize/delete them --> so users can freely customize/delete them -->
<data noupdate="1">
<data noupdate="0">
<!--Email template --> <!--Email template -->
<record id="email_template_aged_statement" model="email.template"> <record id="email_template_aged_statement" model="email.template">
@ -19,23 +19,21 @@
<field name="body_html"><![CDATA[ <field name="body_html"><![CDATA[
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; "> <div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: #FFF; ">
<p>Dear Sir/Madam,</p>
<!--<p>${user.company_id.overdue_msg.replace('\n', '&lt;br/&gt;')} </p>-->
% for line in user.company_id.overdue_msg.split('\n'):
<p> ${line}<br/> </p>
% endfor
<p> Our records indicate that some payments on your account are still due.
<br/> <br/>
Please find in the attached document your aged balance
${user.name}
<br/>
<br/> <br/>
If the amount has already been paid, please disregard this notice.
Otherwise, please forward us the total amount stated below.
</p>
<p style="border-left: 1px solid #8e0000; margin-left: 30px;"> <p style="border-left: 1px solid #8e0000; margin-left: 30px;">
&nbsp;&nbsp;<strong>REFERENCES</strong><br /> &nbsp;&nbsp;<strong>REFERENCES</strong><br />
&nbsp;&nbsp;Total overdue amount: ${object.credit} ${user.company_id.currency_id.name}<br/> &nbsp;&nbsp;Total overdue amount: ${object.credit} ${user.company_id.currency_id.name}<br/>
</p> </p>
<p>If you have any question, do not hesitate to contact us.</p>
<p>Best Regards,</p>
<br/> <br/>
<br/> <br/>
<div style="width: 375px; margin: 0px; padding: 0px; background-color: #8E0000; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; background-repeat: repeat no-repeat;"> <div style="width: 375px; margin: 0px; padding: 0px; background-color: #8E0000; border-top-left-radius: 5px 5px; border-top-right-radius: 5px 5px; background-repeat: repeat no-repeat;">

5
account_partner_aged_statement_webkit/report/partner_aged_statement_report.py

@ -189,9 +189,8 @@ class PartnerAgedTrialReport(aged_trial_report):
def _get_lines(self, form, partner): def _get_lines(self, form, partner):
# self.query is used to get the lines in super()._get_lines # self.query is used to get the lines in super()._get_lines
self.query = "{0} AND l.partner_id = {1}".format( self.query = "{0} AND l.partner_id = {1}".format(
self.orig_query,
partner.id,
)
self.orig_query,
partner.id,)
res = super(PartnerAgedTrialReport, self)._get_lines(form) res = super(PartnerAgedTrialReport, self)._get_lines(form)
self.query = self.orig_query self.query = self.orig_query
return res return res

Loading…
Cancel
Save