Merge pull request #111 from guewen/credit-control-better-report

Credit control: improve the reports
This commit is contained in:
Pedro M. Baeza
2015-03-02 22:39:57 +01:00
10 changed files with 1289 additions and 321 deletions

View File

@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-01-13 13:11+0000\n"
"PO-Revision-Date: 2015-01-13 13:11+0000\n"
"POT-Creation-Date: 2015-01-26 10:32+0000\n"
"PO-Revision-Date: 2015-01-26 10:32+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -68,7 +68,7 @@ msgid "A credit control line"
msgstr ""
#. module: account_credit_control
#: code:addons/account_credit_control/run.py:93
#: code:addons/account_credit_control/run.py:87
#, python-format
msgid "A credit control line more recent than %s exists at %s"
msgstr ""
@@ -79,13 +79,13 @@ msgid "A credit control policy level"
msgstr ""
#. module: account_credit_control
#: code:addons/account_credit_control/run.py:161
#: code:addons/account_credit_control/run.py:154
#, python-format
msgid "A credit control run is already running in background, please try later."
msgstr ""
#. module: account_credit_control
#: code:addons/account_credit_control/run.py:86
#: code:addons/account_credit_control/run.py:80
#, python-format
msgid "A run has already been executed more recently than %s"
msgstr ""
@@ -371,11 +371,6 @@ msgstr ""
msgid "Date due"
msgstr ""
#. module: account_credit_control
#: view:website:account_credit_control.report_credit_control_summary_document
msgid "Dear,"
msgstr ""
#. module: account_credit_control
#: model:ir.model,name:account_credit_control.model_credit_control_policy
msgid "Define a reminder policy"
@@ -890,7 +885,7 @@ msgid "Partner"
msgstr ""
#. module: account_credit_control
#: code:addons/account_credit_control/run.py:109
#: code:addons/account_credit_control/run.py:103
#, python-format
msgid "Please select a policy"
msgstr ""
@@ -1124,7 +1119,7 @@ msgid "Warning: you will maybe not be able to revert this operation."
msgstr ""
#. module: account_credit_control
#: code:addons/account_credit_control/line.py:226
#: code:addons/account_credit_control/line.py:223
#, python-format
msgid "You are not allowed to delete a credit control line that is not in draft state."
msgstr ""

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-01-13 13:11+0000\n"
"POT-Creation-Date: 2015-01-26 10:32+0000\n"
"PO-Revision-Date: 2014-10-30 14:59+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
@@ -96,7 +96,7 @@ msgid "A credit control line"
msgstr "Ligne de relance"
#. module: account_credit_control
#: code:addons/account_credit_control/run.py:93
#: code:addons/account_credit_control/run.py:87
#, python-format
msgid "A credit control line more recent than %s exists at %s"
msgstr "Une ligne plus récente que %s existe au %s"
@@ -107,7 +107,7 @@ msgid "A credit control policy level"
msgstr "Une politique de relance"
#. module: account_credit_control
#: code:addons/account_credit_control/run.py:161
#: code:addons/account_credit_control/run.py:154
#, python-format
msgid ""
"A credit control run is already running in background, please try later."
@@ -116,7 +116,7 @@ msgstr ""
"d'essayer à nouveau plus tard."
#. module: account_credit_control
#: code:addons/account_credit_control/run.py:86
#: code:addons/account_credit_control/run.py:80
#, python-format
msgid "A run has already been executed more recently than %s"
msgstr "Un contrôle a déjà été exécuté plus récemment que le %s "
@@ -401,11 +401,6 @@ msgstr "Message personnalisable"
msgid "Date due"
msgstr "Date d'échéance"
#. module: account_credit_control
#: view:website:account_credit_control.report_credit_control_summary_document
msgid "Dear,"
msgstr "Madame, Monsieur"
#. module: account_credit_control
#: model:ir.model,name:account_credit_control.model_credit_control_policy
msgid "Define a reminder policy"
@@ -1054,7 +1049,7 @@ msgid "Partner"
msgstr "Client"
#. module: account_credit_control
#: code:addons/account_credit_control/run.py:109
#: code:addons/account_credit_control/run.py:103
#, python-format
msgid "Please select a policy"
msgstr "Choisissez une politique"
@@ -1312,7 +1307,7 @@ msgid "Warning: you will maybe not be able to revert this operation."
msgstr "Attention: Cette opération ne peut pas être annulée"
#. module: account_credit_control
#: code:addons/account_credit_control/line.py:226
#: code:addons/account_credit_control/line.py:223
#, python-format
msgid ""
"You are not allowed to delete a credit control line that is not in draft "

View File

@@ -17,11 +17,10 @@
</div>
<h2 id="policy_level">
<span>Reminder</span> <span t-field="o.current_policy_level.name"/>
<span t-field="o.current_policy_level.name"/>
</h2>
<p>Dear,</p>
<p t-field="o.current_policy_level.custom_text"/>
<p class="mt32 mb32" t-field="o.current_policy_level.custom_text"/>
<h3>Summary</h3>

View File

@@ -1,13 +1,13 @@
# Translation of OpenERP Server.
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_credit_control_dunning_fees
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-05-07 11:44+0000\n"
"PO-Revision-Date: 2014-05-07 11:44+0000\n"
"POT-Creation-Date: 2014-12-22 11:00+0000\n"
"PO-Revision-Date: 2014-12-22 11:00+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -16,29 +16,34 @@ msgstr ""
"Plural-Forms: \n"
#. module: account_credit_control_dunning_fees
#: code:_description:0
#: model:ir.model,name:account_credit_control_dunning_fees.model_credit_control_line
#, python-format
msgid "A credit control line"
msgstr ""
#. module: account_credit_control_dunning_fees
#: code:_description:0
#: model:ir.model,name:account_credit_control_dunning_fees.model_credit_control_policy_level
#, python-format
msgid "A credit control policy level"
msgstr ""
#. module: account_credit_control_dunning_fees
#: code:_description:0
#: field:credit.control.dunning.fees.computer,create_uid:0
msgid "Created by"
msgstr ""
#. module: account_credit_control_dunning_fees
#: field:credit.control.dunning.fees.computer,create_date:0
msgid "Created on"
msgstr ""
#. module: account_credit_control_dunning_fees
#: model:ir.model,name:account_credit_control_dunning_fees.model_credit_control_run
#, python-format
msgid "Credit control line generator"
msgstr ""
#. module: account_credit_control_dunning_fees
#: field:credit.control.line,dunning_fees_amount:0
#: view:credit.control.policy:0
#: view:credit.control.policy:account_credit_control_dunning_fees.add_dunning_fees_on_policy
#: view:website:account_credit_control.report_credit_control_summary_document
msgid "Fees"
msgstr ""
@@ -63,19 +68,27 @@ msgid "Fixed"
msgstr ""
#. module: account_credit_control_dunning_fees
#: view:credit.control.policy:0
#: field:credit.control.dunning.fees.computer,id:0
msgid "ID"
msgstr ""
#. module: account_credit_control_dunning_fees
#: field:credit.control.dunning.fees.computer,write_uid:0
msgid "Last Updated by"
msgstr ""
#. module: account_credit_control_dunning_fees
#: field:credit.control.dunning.fees.computer,write_date:0
msgid "Last Updated on"
msgstr ""
#. module: account_credit_control_dunning_fees
#: view:credit.control.policy:account_credit_control_dunning_fees.add_dunning_fees_on_policy
msgid "Mail and reporting"
msgstr ""
#. module: account_credit_control_dunning_fees
#: code:_description:0
#: model:ir.model,name:account_credit_control_dunning_fees.model_credit_control_dunning_fees_computer
#, python-format
msgid "credit.control.dunning.fees.computer"
msgstr ""
#. module: account_credit_control_dunning_fees
#: field:credit.control.policy.level,dunning_fees_type:0
msgid "unknown"
msgid "Type"
msgstr ""

View File

@@ -77,5 +77,6 @@ msgstr "credit.control.dunning.fees.computer"
#. module: account_credit_control_dunning_fees
#: field:credit.control.policy.level,dunning_fees_type:0
msgid "unknown"
msgstr "unbekannt"
msgid "Type"
msgstr ""

View File

@@ -6,39 +6,45 @@ msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-04-16 07:11+0000\n"
"POT-Creation-Date: 2014-12-22 11:00+0000\n"
"PO-Revision-Date: 2014-04-16 07:11+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: account_credit_control_dunning_fees
#: code:_description:0
#: model:ir.model,name:account_credit_control_dunning_fees.model_credit_control_line
#, python-format
msgid "A credit control line"
msgstr "Ligne de relance"
#. module: account_credit_control_dunning_fees
#: code:_description:0
#: model:ir.model,name:account_credit_control_dunning_fees.model_credit_control_policy_level
#, python-format
msgid "A credit control policy level"
msgstr "Une politique de relance"
#. module: account_credit_control_dunning_fees
#: code:_description:0
#: field:credit.control.dunning.fees.computer,create_uid:0
msgid "Created by"
msgstr ""
#. module: account_credit_control_dunning_fees
#: field:credit.control.dunning.fees.computer,create_date:0
msgid "Created on"
msgstr ""
#. module: account_credit_control_dunning_fees
#: model:ir.model,name:account_credit_control_dunning_fees.model_credit_control_run
#, python-format
msgid "Credit control line generator"
msgstr "Générateur de relance"
#. module: account_credit_control_dunning_fees
#: field:credit.control.line,dunning_fees_amount:0
#: view:credit.control.policy:0
#: view:credit.control.policy:account_credit_control_dunning_fees.add_dunning_fees_on_policy
#: view:website:account_credit_control.report_credit_control_summary_document
msgid "Fees"
msgstr "Frais de relance"
@@ -63,18 +69,26 @@ msgid "Fixed"
msgstr "Fixe"
#. module: account_credit_control_dunning_fees
#: view:credit.control.policy:0
#: field:credit.control.dunning.fees.computer,id:0
msgid "ID"
msgstr ""
#. module: account_credit_control_dunning_fees
#: field:credit.control.dunning.fees.computer,write_uid:0
msgid "Last Updated by"
msgstr ""
#. module: account_credit_control_dunning_fees
#: field:credit.control.dunning.fees.computer,write_date:0
msgid "Last Updated on"
msgstr ""
#. module: account_credit_control_dunning_fees
#: view:credit.control.policy:account_credit_control_dunning_fees.add_dunning_fees_on_policy
msgid "Mail and reporting"
msgstr "Lettres et e-mails"
#. module: account_credit_control_dunning_fees
#: code:_description:0
#: model:ir.model,name:account_credit_control_dunning_fees.model_credit_control_dunning_fees_computer
#, python-format
msgid "credit.control.dunning.fees.computer"
msgstr "credit.control.dunning.fees.computer"
#. module: account_credit_control_dunning_fees
#: field:credit.control.policy.level,dunning_fees_type:0
msgid "unknown"
msgstr "inconnu"
msgid "Type"
msgstr "Type"

View File

@@ -18,7 +18,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import models, fields
from openerp import models, fields, api
class CreditControlLine(models.Model):
@@ -27,3 +27,10 @@ class CreditControlLine(models.Model):
_inherit = "credit.control.line"
dunning_fees_amount = fields.Float(string='Fees')
balance_due_total = fields.Float(string='Balance due with fees',
compute='compute_balance_due')
@api.one
@api.depends('dunning_fees_amount', 'balance_due')
def compute_balance_due(self):
self.balance_due_total = self.balance_due + self.dunning_fees_amount

View File

@@ -1,246 +0,0 @@
## -*- coding: utf-8 -*-
<html>
<head>
<style type="text/css">
${css}
body {
font-family: helvetica;
font-size: 12px;
}
.custom_text {
font-family: helvetica;
font-size: 12px;
}
table {
font-family: helvetica;
font-size: 12px;
}
.header {
margin-left: 0px;
text-align: left;
width: 300px;
font-size: 12px;
}
.title {
font-size: 16px;
font-weight: bold;
}
.basic_table{
text-align: center;
border: 1px solid lightGrey;
border-collapse: collapse;
font-family: helvetica;
font-size: 12px;
}
.basic_table th {
border: 1px solid lightGrey;
font-size: 11px;
font-weight: bold;
}
.basic_table td {
border: 1px solid lightGrey;
font-size: 12px;
}
.list_table {
border-color: black;
text-align: center;
border-collapse: collapse;
}
.list_table td {
border-color: gray;
border-top: 1px solid gray;
text-align: left;
font-size: 12px;
padding-right: 3px;
padding-left: 3px;
padding-top: 3px;
padding-bottom:3px;
}
.list_table th {
border-bottom: 2px solid black;
text-align: left;
font-size: 11px;
font-weight: bold;
padding-right: 3px
padding-left: 3px
}
.list_table thead {
display: table-header-group;
}
.address table {
font-size: 11px;
border-collapse: collapse;
margin: 0px;
padding: 0px;
}
.address .shipping {
}
.address .invoice {
margin-top: 10px;
}
.address .recipient {
font-size: 13px;
margin-right: 120px;
margin-left: 350px;
float: right;
}
table .address_title {
font-weight: bold;
}
.address td.name {
font-weight: bold;
}
td.amount, th.amount {
text-align: right;
padding-right:2px;
}
h1 {
font-size: 16px;
font-weight: bold;
}
tr.line .note {
border-style: none;
font-size: 9px;
padding-left: 10px;
}
tr.line {
margin-bottom: 10px;
}
</style>
</head>
<body>
%for comm in objects :
<% setLang(comm.get_contact_address().lang) %>
<div class="address">
<table class="recipient">
<%
add = comm.get_contact_address()
%>
%if comm.partner_id.id == add.id:
<tr><td class="name">${comm.partner_id.title and comm.partner_id.title.name or ''} ${comm.partner_id.name }</td></tr>
<% address_lines = comm.partner_id.contact_address.split("\n") %>
%else:
<tr><td class="name">${comm.partner_id.name or ''}</td></tr>
<tr><td>${add.title and add.title.name or ''} ${add.name}</td></tr>
<% address_lines = add.contact_address.split("\n")[1:] %>
%endif
%for part in address_lines:
%if part:
<tr><td>${part}</td></tr>
%endif
%endfor
</table>
<br/>
<br/>
<br/>
<br/>
</div>
<br/>
<br/>
<br/>
<div>
<h3 style="clear: both; padding-top: 20px;">
${_('Reminder')}: ${comm.current_policy_level.name or '' }
</h3>
<p>${_('Dear')},</p>
<p class="custom_text" width="95%">${comm.current_policy_level.custom_text.replace('\n', '<br />')}</p>
<br/>
<br/>
<p><b>${_('Summary')}<br/></b></p>
<table class="basic_table" style="width: 100%;">
<tr>
<th width="200">${_('Invoice number')}</th>
<th>${_('Invoice date')}</th>
<th>${_('Date due')}</th>
<th>${_('Invoiced amount')}</th>
<th>${_('Open amount')}</th>
<th>${_('Fees')}</th>
<th>${_('Currency')}</th>
</tr>
%for line in comm.credit_control_line_ids:
<tr>
%if line.invoice_id:
<td width="200">${line.invoice_id.number}
%if line.invoice_id.name:
<br/>
${line.invoice_id.name}
%endif
</td>
%else:
<td width="200">${line.move_line_id.name}</td>
%endif
<td class="date">${line.date_entry}</td>
<td class="date">${line.date_due}</td>
<td class="amount">${line.amount_due}</td>
<td class="amount">${line.balance_due}</td>
<td class="amount">${line.dunning_fees_amount}</td>
<td class="amount">${line.currency_id.name or comm.company_id.currency_id.name}</td>
</tr>
%endfor
</table>
<br/>
<br/>
<%doc>
<!-- uncomment to have info after summary -->
<p>${_('If you have any question, do not hesitate to contact us.')}</p>
<p>${comm.user_id.name} ${comm.user_id.email and '<%s>'%(comm.user_id.email) or ''}<br/>
${comm.company_id.name}<br/>
% if comm.company_id.street:
${comm.company_id.street or ''}<br/>
% endif
% if comm.company_id.street2:
${comm.company_id.street2}<br/>
% endif
% if comm.company_id.city or comm.company_id.zip:
${comm.company_id.zip or ''} ${comm.company_id.city or ''}<br/>
% endif
% if comm.company_id.country_id:
${comm.company_id.state_id and ('%s, ' % comm.company_id.state_id.name) or ''} ${comm.company_id.country_id.name or ''}<br/>
% endif
% if comm.company_id.phone:
Phone: ${comm.company_id.phone}<br/>
% endif
% if comm.company_id.website:
${comm.company_id.website or ''}<br/>
% endif
</%doc>
<p style="page-break-after:always"></p>
%endfor
</body>
</html>

View File

@@ -3,19 +3,19 @@
<data>
<template id="report_credit_control_summary_document_fees"
inherit_id="account_credit_control.report_credit_control_summary_document">
<xpath expr="//table[@id='summary_table']/thead/tr/th[last()]" position="after">
<xpath expr="//table[@id='summary_table']/thead/tr/th[last()]" position="before">
<th class="text-right">Fees</th>
</xpath>
<xpath expr="//span[@t-field='l.balance_due']" position="replace">
<span t-field="l.balance_due"/>
</xpath>
<xpath expr="//table[@id='summary_table']/tbody/tr/td[last()]" position="after">
<xpath expr="//table[@id='summary_table']/tbody/tr/td[last()]" position="before">
<td class="text-right">
<span t-field="l.dunning_fees_amount"
t-field-options='{"widget": "monetary",
"display_currency": "l.currency_id or l.company_id.currency_id"}'/>
<span t-field="l.dunning_fees_amount"/>
</td>
</xpath>
<xpath expr="//span[@t-field='l.balance_due']" position="replace">
<span t-field="l.balance_due_total"
t-field-options='{"widget": "monetary",
"display_currency": "l.currency_id or l.company_id.currency_id"}'/>
</xpath>
</template>
</data>