[FIX+IMP+REF] account_credit_control:

* Report use precise mode by default
* date_entry fields on line model to be used by report or in next MP on filter group by
* reporting layer, + add hook function to get contact address
* credit control mail are not in plain text but send as attachement
* policy level name is now translatable as it is use in report and mail
* permission on invoices because onetomany widget load data even if hidden ...
* translation files + lang source
* french translation
This commit is contained in:
unknown
2013-07-12 08:26:03 +02:00
committed by Pedro M. Baeza
parent 46824b3609
commit bde27de945
15 changed files with 3389 additions and 1632 deletions

View File

@@ -58,7 +58,8 @@ On each generated line, you have many choices:
* Change the state (so you can ignore or reopen lines)
""",
'website': 'http://www.camptocamp.com',
'data': ["data.xml",
'data': ["report/report.xml",
"data.xml",
"line_view.xml",
"account_view.xml",
"partner_view.xml",
@@ -68,7 +69,6 @@ On each generated line, you have many choices:
"wizard/credit_control_emailer_view.xml",
"wizard/credit_control_marker_view.xml",
"wizard/credit_control_printer_view.xml",
"report/report.xml",
"security/ir.model.access.csv"],
'demo_xml': ["credit_control_demo.xml"],
'tests': [],

View File

@@ -18,9 +18,11 @@
<notebook position="inside">
<page string="Credit Control"
groups="account_credit_control.group_account_credit_control_manager,account_credit_control.group_account_credit_control_user,account_credit_control.group_account_credit_control_info">
<field name="credit_policy_id" widget="selection"/>
<field name="credit_policy_id" widget="selection"
groups="account_credit_control.group_account_credit_control_manager,account_credit_control.group_account_credit_control_user,account_credit_control.group_account_credit_control_info"/>
<newline/>
<field name="credit_control_line_ids" colspan="4" nolabel="1"/>
<field name="credit_control_line_ids" colspan="4" nolabel="1"
groups="account_credit_control.group_account_credit_control_manager,account_credit_control.group_account_credit_control_user,account_credit_control.group_account_credit_control_info"/>
</page>
</notebook>
</field>

View File

@@ -4,120 +4,17 @@
<record id="email_template_credit_control_base" model="email.template">
<field name="name">Credit Control Email</field>
<field name="email_from">noreply@localhost</field>
<field name="subject">Credit Control: (${object.current_policy_level.name or 'n/a' })</field>
<field name="subject">Credit Control: (${object.current_policy_level.name or 'n/a'})</field>
<field name="email_to">${object.get_email() or ''}</field>
<field name="model_id" ref="model_credit_control_communication"/>
<field name="auto_delete" eval="True"/>
<field name="lang">${object.get_contact_address().lang or 'en_US'}</field>
<field name="report_template" ref="report_webkit_html"/>
<field name="body_html"><![CDATA[
%if mode and mode != 'pdf':
<!-- your css here -->
<style type="text/css">
body {
font-family: helvetica;
font-size: 11px;
}
.custom_text {
font-family: helvetica;
font-size: 11px;
text-align: justify;
}
.basic_table {
width: 100%;
text-align: center;
border: 1px solid lightGrey;
border-collapse: collapse;
}
.basic_table th {
border: 1px solid lightGrey;
font-size: 12px;
}
.basic_table td {
border: 1px solid lightGrey;
font-size: 12px;
}
td.amount, th.amount {
text-align: right;
white-space: nowrap;
}
th.date {
}
td.date {
white-space: nowrap;
}
</style>
%endif
<div>
<%
def carriage_returns(text):
return text.replace('\n', '<br />')
%>
<h1 style="clear: both; padding-top: 20px;">
Credit Control: ${object.current_policy_level.name or 'n/a' }
</h1>
<p>Dear ${object.partner_id.name or ''},</p>
<p class="custom_text">${object.current_policy_level.custom_text | carriage_returns }</p>
Dear ${object.get_contact_address().name or ''}
<br/>
<br/>
<table class="basic_table" style="width: 100%;">
<caption><b>Summary</b></caption>
<tr>
<th class="date">Date due</th>
<th class="amount">Amount due</th>
<th class="amount">Amount balance</th>
<th>Invoice number</th>
</tr>
%for line in object.credit_control_line_ids:
<tr>
<td class="date">${line.date_due}</td>
<td class="amount">${line.amount_due}</td>
<td class="amount">${line.balance_due}</td>
%if line.invoice_id:
<td>${line.invoice_id.number}</td>
%else:
<td>n/a</td>
%endif
%endfor
</table>
<br/>
<br/>
<p>If you have any question, do not hesitate to contact us.</p>
<p>Thank you for choosing ${object.company_id.name}! </p>
<p>${object.user_id.name} ${object.user_id.email and '<%s>'%(object.user_id.email) or ''}<br/>
${object.company_id.name}<br/>
% if object.company_id.street:
${object.company_id.street or ''}<br/>
% endif
% if object.company_id.street2:
${object.company_id.street2}<br/>
% endif
% if object.company_id.city or object.company_id.zip:
${object.company_id.zip or ''} ${object.company_id.city or ''}<br/>
% endif
% if object.company_id.country_id:
${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}<br/>
% endif
% if object.company_id.phone:
Phone: ${object.company_id.phone}<br/>
% endif
% if object.company_id.website:
${object.company_id.website or ''}<br/>
% endif
${object.current_policy_level.custom_mail_text}
]]></field>
</record>
@@ -143,15 +40,22 @@
<field name="email_template_id" ref="email_template_credit_control_base"/>
<field name="policy_id" ref="credit_control_3_time"/>
<field name="channel">email</field>
<field name="custom_text">Dear Sir or Madam,
Our records indicate that we have not received the payment of the above mentioned invoice (copy attached for your convenience).
<field name="custom_text">Our records indicate that we have not received the payment of the above mentioned invoice.
If it has already been sent, please disregard this notice. If not, please proceed with payment within 10 days.
Thank you in advance for your anticipated cooperation in this matter.
Best regards,
</field>
Best regards
</field>
<field name="custom_mail_text">Our records indicate that we have not received the payment of the above mentioned invoice (copy attached for your convenience).
If it has already been sent, please disregard this notice. If not, please proceed with payment within 10 days.
Thank you in advance for your anticipated cooperation in this matter.
Best regards
</field>
</record>
<record model="credit.control.policy.level"
@@ -163,15 +67,20 @@ Best regards,
<field name="email_template_id" ref="email_template_credit_control_base"/>
<field name="policy_id" ref="credit_control_3_time"/>
<field name="channel">email</field>
<field name="custom_text">Dear Sir or Madam,
Our records indicate that we have not yet received the payment of the above mentioned invoice (copy attached for your convenience) despite our first reminder.
If it has already been sent, please disregard this notice. If not, please proceed with payment within 5 days.
<field name="custom_text">Our records indicate that we have not yet received the payment of the above mentioned invoice despite our first reminder.
If it has already been sent, please disregard this notice. If not, please proceed with payment within 5 days.
Thank you in advance for your anticipated cooperation in this matter.
Best regards,
</field>
Best regards
</field>
<field name="custom_mail_text">Our records indicate that we have not yet received the payment of the above mentioned invoice (copy attached for your convenience) despite our first reminder.
If it has already been sent, please disregard this notice. If not, please proceed with payment within 5 days.
Thank you in advance for your anticipated cooperation in this matter.
Best regards
</field>
</record>
<record model="credit.control.policy.level"
@@ -183,19 +92,30 @@ Best regards,
<field name="email_template_id" ref="email_template_credit_control_base"/>
<field name="policy_id" ref="credit_control_3_time"/>
<field name="channel">letter</field>
<field name="custom_text">Dear Sir or Madam,
<field name="custom_text">
Our records indicate that we still have not received the payment of the above mentioned invoice despite our two reminders.
If payment have already been sent, please disregard this notice. If not, please proceed with payment.
If your payment has not been received in the next 5 days, your file will be transfered to our debt collection agency.
Our records indicate that we still have not received the payment of the above mentioned invoice (copy attached) despite our two reminders.
If payment have already been sent, please disregard this notice. If not, please proceed with payment.
If your payment has not been received in the next 5 days, your file will be transfered to our debt collection agency.
Should you need us to arrange a payment plan for you, please advise.
A customer account statement is enclosed for you convenience.
Should you need us to arrange a payment plan for you, please advise.
A customer account statement is enclosed for you convenience.
Thank you in advance for your anticipated cooperation in this matter.
Thank you in advance for your anticipated cooperation in this matter.
Best regards
</field>
Best regards,
</field>
<field name="custom_mail_text">Our records indicate that we still have not received the payment of the above mentioned invoice (copy attached) despite our two reminders.
If payment have already been sent, please disregard this notice. If not, please proceed with payment.
If your payment has not been received in the next 5 days, your file will be transfered to our debt collection agency.
Should you need us to arrange a payment plan for you, please advise.
A customer account statement is enclosed for you convenience.
Thank you in advance for your anticipated cooperation in this matter.
Best regards
</field>
</record>
<!-- policy 2 -->
@@ -213,17 +133,20 @@ Best regards,
<field name="email_template_id" ref="email_template_credit_control_base"/>
<field name="policy_id" ref="credit_control_2_time"/>
<field name="channel">email</field>
<field name="custom_text">Dear Sir or Madam,
<field name="custom_text">Our records indicate that we have not received the payment of the above mentioned invoice.
If it has already been sent, please disregard this notice. If not, please proceed with payment within 10 days.
Our records indicate that we have not received the payment of the
above mentioned invoice (copy attached for your convenience). If it
has already been sent, please disregard this notice. If not, please
proceed with payment within 10 days.
Thank you in advance for your anticipated cooperation in this matter.
Best regards
</field>
<field name="custom_mail_text">Our records indicate that we have not received the payment of the above mentioned invoice (copy attached for your convenience).
If it has already been sent, please disregard this notice. If not, please proceed with payment within 10 days.
Thank you in advance for your anticipated cooperation in this matter.
Best regards,
</field>
Best regards
</field>
</record>
<record model="credit.control.policy.level"
@@ -235,41 +158,51 @@ Best regards,
<field name="email_template_id" ref="email_template_credit_control_base"/>
<field name="policy_id" ref="credit_control_2_time"/>
<field name="channel">letter</field>
<field name="custom_text">Dear Sir or Madam,
<field name="custom_text">Our records indicate that we still have not received the payment of the above mentioned invoice despite our reminder.
Our records indicate that we still have not received the payment of
the above mentioned invoice (copy attached) despite our reminder.
If payment have already been sent, please disregard this notice. If
not, please proceed with payment. If your payment has not been
received in the next 5 days, your file will be transfered to our debt
collection agency.
If payment have already been sent, please disregard this notice. If not, please proceed with payment.
If your payment has not been received in the next 5 days, your file will be transfered to our debt
collection agency.
Should you need us to arrange a payment plan for you, please advise.
A customer account statement is enclosed for you convenience.
Should you need us to arrange a payment plan for you, please advise.
A customer account statement is enclosed for you convenience.
Thank you in advance for your anticipated cooperation in this matter.
Thank you in advance for your anticipated cooperation in this matter.
Best regards,
</field>
Best regards
</field>
<field name="custom_mail_text">Our records indicate that we still have not received the payment of the above mentioned invoice (copy attached) despite our reminder.
If payment have already been sent, please disregard this notice. If not, please proceed with payment.
If your payment has not been received in the next 5 days, your file will be transfered to our debt
collection agency.
Should you need us to arrange a payment plan for you, please advise.
A customer account statement is enclosed for you convenience.
Thank you in advance for your anticipated cooperation in this matter.
Best regards
</field>
</record>
<record id="group_account_credit_control_manager" model="res.groups">
<field name="name">Credit Control Manager</field>
<field name="category_id" ref="base.module_category_accounting_and_finance"/>
<field name="name">Credit Control Manager</field>
<field name="category_id" ref="base.module_category_accounting_and_finance"/>
</record>
<record id="group_account_credit_control_user" model="res.groups" context="{'noadmin':True}">
<field name="name">Credit Control User</field>
<field name="category_id" ref="base.module_category_accounting_and_finance"/>
<field name="name">Credit Control User</field>
<field name="category_id" ref="base.module_category_accounting_and_finance"/>
</record>
<record id="group_account_credit_control_info" model="res.groups" context="{'noadmin':True}">
<field name="name">Credit Control Info</field>
<field name="category_id" ref="base.module_category_accounting_and_finance"/>
<field name="name">Credit Control Info</field>
<field name="category_id" ref="base.module_category_accounting_and_finance"/>
</record>
<record id="base.main_company" model="res.company">
<field name="credit_policy_id" ref="credit_control_3_time"/>
<field name="credit_policy_id" ref="credit_control_3_time"/>
</record>
</data>

View File

@@ -1,713 +0,0 @@
# Translation of OpenERP Server.
# This file contains the translation of the following modules:
# * account_credit_control
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 6.1\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2012-11-07 13:23+0000\n"
"PO-Revision-Date: 2012-11-07 13:23+0000\n"
"Last-Translator: <>\n"
"Language-Team: \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
#: model:credit.control.policy.level,custom_text:account_credit_control.2_time_1
#: model:credit.control.policy.level,custom_text:account_credit_control.3_time_1
msgid "Dear Sir or Madam,\n"
"\n"
"Our records indicate that we have not received the payment of the\n"
"above mentioned invoice (copy attached for your convenience). If it\n"
"has already been sent, please disregard this notice. If not, please\n"
"proceed with payment within 10 days.\n"
"\n"
"Thank you in advance for your anticipated cooperation in this matter.\n"
"\n"
"Best regards,\n"
""
msgstr ""
#. module: account_credit_control
#: field:credit.control.policy.level,custom_text:0
msgid "Custom Message"
msgstr ""
#. module: account_credit_control
#: model:ir.model,name:account_credit_control.model_credit_control_mailer
msgid "Mass credit line mailer"
msgstr ""
#. module: account_credit_control
#: view:credit.control.lines:0
msgid "More..."
msgstr ""
#. module: account_credit_control
#: view:credit.control.lines:0
msgid "Group By..."
msgstr ""
#. module: account_credit_control
#: model:ir.actions.act_window,name:account_credit_control.credit_control_run
#: model:ir.ui.menu,name:account_credit_control.credit_control_run_menu
msgid "Credit Control Run"
msgstr ""
#. module: account_credit_control
#: field:credit.control.policy.level,computation_mode:0
msgid "Compute Mode"
msgstr ""
#. module: account_credit_control
#: model:ir.actions.act_window,name:account_credit_control.open_credit_line_emailer_wizard
#: model:ir.actions.act_window,name:account_credit_control.open_credit_line_emailer_wizard_menu_action
msgid "Send By Email"
msgstr ""
#. module: account_credit_control
#: model:ir.model,name:account_credit_control.model_credit_control_line
msgid "A credit control line"
msgstr ""
#. module: account_credit_control
#: field:credit.control.line,move_line_id:0
msgid "Move line"
msgstr ""
#. module: account_credit_control
#: model:res.groups,name:account_credit_control.group_account_credit_control_info
msgid "Credit Control Info"
msgstr ""
#. module: account_credit_control
#: model:ir.model,name:account_credit_control.model_credit_control_emailer
msgid "Mass credit line emailer"
msgstr ""
#. module: account_credit_control
#: field:credit.control.line,account_id:0
#: view:credit.control.lines:0
#: model:ir.model,name:account_credit_control.model_account_account
msgid "Account"
msgstr ""
#. module: account_credit_control
#: selection:credit.control.policy.level,computation_mode:0
msgid "Due Date"
msgstr ""
#. module: account_credit_control
#: field:credit.control.communication,current_policy_level:0
#: field:credit.control.line,level:0
#: view:credit.control.lines:0
#: field:credit.control.policy.level,level:0
msgid "Level"
msgstr ""
#. module: account_credit_control
#: field:credit.control.policy.level,delay_days:0
msgid "Delay (in days)"
msgstr ""
#. module: account_credit_control
#: model:ir.model,name:account_credit_control.model_credit_control_communication
msgid "credit control communication"
msgstr ""
#. module: account_credit_control
#: sql_constraint:account.move.line:0
msgid "Wrong credit or debit value in accounting entry !"
msgstr ""
#. module: account_credit_control
#: constraint:account.account:0
msgid "Error ! You can not create recursive accounts."
msgstr ""
#. module: account_credit_control
#: view:credit.control.emailer:0
msgid "Send emails for the selected lines"
msgstr ""
#. module: account_credit_control
#: model:ir.model,name:account_credit_control.model_credit_control_marker
msgid "Mass marker"
msgstr ""
#. module: account_credit_control
#: field:account.invoice,credit_policy_id:0
#: field:res.company,credit_policy_id:0
#: field:res.partner,credit_policy_id:0
msgid "Credit Control Policy"
msgstr ""
#. module: account_credit_control
#: view:account.invoice:0
msgid "Credit control"
msgstr ""
#. module: account_credit_control
#: constraint:account.move.line:0
msgid "The date of your Journal Entry is not in the defined period! You should change the date or remove this constraint from the journal."
msgstr ""
#. module: account_credit_control
#: view:credit.control.lines:0
msgid "New lines"
msgstr ""
#. module: account_credit_control
#: field:credit.control.line,date_sent:0
msgid "Sent date"
msgstr ""
#. module: account_credit_control
#: view:credit.control.policy:0
#: field:credit.control.policy,account_ids:0
msgid "Accounts"
msgstr ""
#. module: account_credit_control
#: field:credit.control.communication,partner_id:0
#: field:credit.control.line,partner_id:0
#: view:credit.control.lines:0
#: model:ir.model,name:account_credit_control.model_res_partner
msgid "Partner"
msgstr ""
#. module: account_credit_control
#: view:credit.control.emailer:0
msgid "Send the emails"
msgstr ""
#. module: account_credit_control
#: view:credit.control.marker:0
#: model:ir.actions.act_window,name:account_credit_control.open_credit_line_marker_wizard
#: model:ir.actions.act_window,name:account_credit_control.open_credit_line_marker_wizard_menu_action
msgid "Change Lines' State"
msgstr ""
#. module: account_credit_control
#: model:credit.control.policy.level,custom_text:account_credit_control.3_time_2
msgid "Dear Sir or Madam,\n"
"\n"
"Our records indicate that we have not yet received the payment of the\n"
"above mentioned invoice (copy attached for your convenience) despite\n"
"our first reminder. If it has already been sent, please disregard\n"
"this notice. If not, please proceed with payment within 5 days.\n"
"\n"
"Thank you in advance for your anticipated cooperation in this matter.\n"
"\n"
"Best regards,\n"
""
msgstr ""
#. module: account_credit_control
#: field:credit.control.policy.level,policy_id:0
msgid "Related Policy"
msgstr ""
#. module: account_credit_control
#: sql_constraint:account.account:0
msgid "The code of the account must be unique per company !"
msgstr ""
#. module: account_credit_control
#: constraint:res.company:0
msgid "Error! You can not create recursive companies."
msgstr ""
#. module: account_credit_control
#: view:credit.control.policy:0
#: view:credit.control.policy.level:0
msgid "Mail and reporting"
msgstr ""
#. module: account_credit_control
#: view:credit.control.printer:0
msgid "Print"
msgstr ""
#. module: account_credit_control
#: selection:credit.control.line,channel:0
#: selection:credit.control.policy.level,channel:0
msgid "Email"
msgstr ""
#. module: account_credit_control
#: field:credit.control.line,channel:0
#: view:credit.control.lines:0
#: field:credit.control.policy.level,channel:0
msgid "Channel"
msgstr ""
#. module: account_credit_control
#: help:credit.control.run,manual_ids:0
msgid "If a credit control line has been generated on a policy and the policy has been changed meantime, it has to be handled manually"
msgstr ""
#. module: account_credit_control
#: field:credit.control.printer,state:0
msgid "state"
msgstr ""
#. module: account_credit_control
#: field:credit.control.run,report:0
msgid "Report"
msgstr ""
#. module: account_credit_control
#: selection:credit.control.policy.level,computation_mode:0
msgid "Due Date, End Of Month"
msgstr ""
#. module: account_credit_control
#: field:credit.control.marker,name:0
msgid "Mark as"
msgstr ""
#. module: account_credit_control
#: model:credit.control.policy.level,custom_text:account_credit_control.2_time_2
msgid "Dear Sir or Madam,\n"
"\n"
"Our records indicate that we still have not received the payment of\n"
"the above mentioned invoice (copy attached) despite our reminder.\n"
"If payment have already been sent, please disregard this notice. If\n"
"not, please proceed with payment. If your payment has not been\n"
"received in the next 5 days, your file will be transfered to our debt\n"
"collection agency.\n"
"\n"
"Should you need us to arrange a payment plan for you, please advise.\n"
"A customer account statement is enclosed for you convenience.\n"
"\n"
"Thank you in advance for your anticipated cooperation in this matter.\n"
"\n"
"Best regards,\n"
""
msgstr ""
#. module: account_credit_control
#: view:credit.control.run:0
#: field:credit.control.run,policy_ids:0
msgid "Policies"
msgstr ""
#. module: account_credit_control
#: field:credit.control.line,date_due:0
msgid "Due date"
msgstr ""
#. module: account_credit_control
#: field:credit.control.policy,do_nothing:0
msgid "Do nothing"
msgstr ""
#. module: account_credit_control
#: field:credit.control.line,currency_id:0
msgid "Currency"
msgstr ""
#. module: account_credit_control
#: constraint:account.account:0
msgid "Configuration Error! \n"
"You can not define children to an account with internal type different of \"View\"! "
msgstr ""
#. module: account_credit_control
#: model:ir.model,name:account_credit_control.model_credit_control_printer
msgid "Mass printer"
msgstr ""
#. module: account_credit_control
#: field:credit.control.communication,company_id:0
#: field:credit.control.line,company_id:0
#: field:credit.control.policy,company_id:0
msgid "Company"
msgstr ""
#. module: account_credit_control
#: view:credit.control.marker:0
#: model:ir.actions.act_window,help:account_credit_control.open_credit_line_marker_wizard
msgid "Change the state of the selected lines."
msgstr ""
#. module: account_credit_control
#: view:credit.control.printer:0
msgid "Print the selected lines"
msgstr ""
#. module: account_credit_control
#: selection:credit.control.line,state:0
#: view:credit.control.lines:0
#: selection:credit.control.marker,name:0
#: selection:credit.control.run,state:0
msgid "Draft"
msgstr ""
#. module: account_credit_control
#: view:credit.control.lines:0
msgid "Credit policy"
msgstr ""
#. module: account_credit_control
#: view:credit.control.policy:0
#: view:credit.control.policy.level:0
msgid "Delay Setting"
msgstr ""
#. module: account_credit_control
#: field:credit.control.line,balance_due:0
msgid "Due balance"
msgstr ""
#. module: account_credit_control
#: view:credit.control.lines:0
msgid "Credit policy level"
msgstr ""
#. module: account_credit_control
#: model:ir.model,name:account_credit_control.model_credit_control_run
msgid "Credit control line generator"
msgstr ""
#. module: account_credit_control
#: field:credit.control.communication,user_id:0
msgid "User"
msgstr ""
#. module: account_credit_control
#: selection:credit.control.line,channel:0
#: selection:credit.control.policy.level,channel:0
msgid "Letter"
msgstr ""
#. module: account_credit_control
#: model:ir.model,name:account_credit_control.model_account_move_line
msgid "Journal Items"
msgstr ""
#. module: account_credit_control
#: model:ir.actions.act_window,help:account_credit_control.open_credit_line_printer_wizard
msgid "Print selected lines"
msgstr ""
#. module: account_credit_control
#: constraint:account.move.line:0
msgid "You can not create journal items on an account of type view."
msgstr ""
#. module: account_credit_control
#: field:credit.control.emailer,line_ids:0
#: field:credit.control.marker,line_ids:0
#: field:credit.control.printer,line_ids:0
#: model:ir.actions.act_window,name:account_credit_control.credit_control_line_action
#: model:ir.ui.menu,name:account_credit_control.credit_control_line_action_menu
#: field:res.partner,credit_control_line_ids:0
msgid "Credit Control Lines"
msgstr ""
#. module: account_credit_control
#: model:credit.control.policy.level,custom_text:account_credit_control.3_time_3
msgid "Dear Sir or Madam,\n"
"\n"
"Our records indicate that we still have not received the payment of\n"
"the above mentioned invoice (copy attached) despite our two reminders.\n"
"If payment have already been sent, please disregard this notice. If\n"
"not, please proceed with payment. If your payment has not been\n"
"received in the next 5 days, your file will be transfered to our debt\n"
"collection agency.\n"
"\n"
"Should you need us to arrange a payment plan for you, please advise.\n"
"A customer account statement is enclosed for you convenience.\n"
"\n"
"Thank you in advance for your anticipated cooperation in this matter.\n"
"\n"
"Best regards,\n"
""
msgstr ""
#. module: account_credit_control
#: model:ir.actions.act_window,name:account_credit_control.open_credit_line_printer_wizard
#: model:ir.actions.act_window,name:account_credit_control.open_credit_line_printer_wizard_menu_action
msgid "Print Lines"
msgstr ""
#. module: account_credit_control
#: field:credit.control.run,date:0
msgid "Controlling Date"
msgstr ""
#. module: account_credit_control
#: model:ir.model,name:account_credit_control.model_credit_control_policy
msgid "Define a reminder policy"
msgstr ""
#. module: account_credit_control
#: field:credit.control.policy.level,email_template_id:0
msgid "Email Template"
msgstr ""
#. module: account_credit_control
#: selection:credit.control.line,state:0
#: view:credit.control.lines:0
#: selection:credit.control.marker,name:0
msgid "Ready To Send"
msgstr ""
#. module: account_credit_control
#: model:ir.model,name:account_credit_control.model_res_company
msgid "Companies"
msgstr ""
#. module: account_credit_control
#: field:credit.control.printer,mark_as_sent:0
msgid "Mark letter lines as sent"
msgstr ""
#. module: account_credit_control
#: view:credit.control.run:0
msgid "Compute Credit Control Lines"
msgstr ""
#. module: account_credit_control
#: selection:credit.control.policy.level,computation_mode:0
msgid "Previous Reminder"
msgstr ""
#. module: account_credit_control
#: selection:credit.control.line,state:0
#: view:credit.control.lines:0
msgid "Error"
msgstr ""
#. module: account_credit_control
#: sql_constraint:account.invoice:0
msgid "Invoice Number must be unique per Company!"
msgstr ""
#. module: account_credit_control
#: view:credit.control.run:0
msgid "Report and Errors"
msgstr ""
#. module: account_credit_control
#: constraint:account.account:0
msgid "Configuration Error! \n"
"You can not select an account type with a deferral method different of \"Unreconciled\" for accounts with internal type \"Payable/Receivable\"! "
msgstr ""
#. module: account_credit_control
#: field:credit.control.line,state:0
#: field:credit.control.run,state:0
msgid "State"
msgstr ""
#. module: account_credit_control
#: help:credit.control.policy,do_nothing:0
msgid "For policies which should not generate lines or are obsolete"
msgstr ""
#. module: account_credit_control
#: field:account.account,credit_control_line_ids:0
#: field:account.invoice,credit_control_line_ids:0
#: field:credit.control.communication,credit_control_line_ids:0
#: model:ir.actions.act_window,name:account_credit_control.act_account_credit_relation_relation
#: model:ir.actions.act_window,name:account_credit_control.act_partner_credit_relation_relation
msgid "Credit Lines"
msgstr ""
#. module: account_credit_control
#: selection:credit.control.line,state:0
#: selection:credit.control.marker,name:0
#: selection:credit.control.run,state:0
msgid "Done"
msgstr ""
#. module: account_credit_control
#: field:account.move.line,invoice_id:0
#: field:credit.control.line,invoice_id:0
#: view:credit.control.lines:0
#: model:ir.model,name:account_credit_control.model_account_invoice
msgid "Invoice"
msgstr ""
#. module: account_credit_control
#: view:credit.control.emailer:0
#: view:credit.control.marker:0
#: view:credit.control.printer:0
msgid "Cancel"
msgstr ""
#. module: account_credit_control
#: view:credit.control.printer:0
msgid "Close"
msgstr ""
#. module: account_credit_control
#: selection:credit.control.line,state:0
msgid "Emailing Error"
msgstr ""
#. module: account_credit_control
#: help:account.invoice,credit_policy_id:0
msgid "The Credit Control Policy used for this invoice. If nothing is defined, it will use the account setting or the partner setting."
msgstr ""
#. module: account_credit_control
#: view:credit.control.lines:0
msgid "Run date"
msgstr ""
#. module: account_credit_control
#: constraint:account.move.line:0
msgid "Company must be the same for its related account and period."
msgstr ""
#. module: account_credit_control
#: field:credit.control.run,manual_ids:0
msgid "Lines to handle manually"
msgstr ""
#. module: account_credit_control
#: model:ir.ui.menu,name:account_credit_control.base_credit_control_configuration_menu
#: model:ir.ui.menu,name:account_credit_control.base_credit_control_menu
msgid "Credit Control"
msgstr ""
#. module: account_credit_control
#: view:credit.control.policy:0
#: field:credit.control.policy,level_ids:0
msgid "Policy Levels"
msgstr ""
#. module: account_credit_control
#: constraint:account.move.line:0
msgid "The selected account of your Journal Entry forces to provide a secondary currency. You should remove the secondary currency on the account or select a multi-currency view on the journal."
msgstr ""
#. module: account_credit_control
#: field:credit.control.line,policy_id:0
msgid "Policy"
msgstr ""
#. module: account_credit_control
#: model:email.template,subject:account_credit_control.email_template_credit_control_base
msgid "Credit Control: (${object.current_policy_level.name or 'n/a' })"
msgstr ""
#. module: account_credit_control
#: field:credit.control.printer,report_file:0
msgid "Generated Report"
msgstr ""
#. module: account_credit_control
#: view:credit.control.run:0
msgid "Move lines To be treated manually"
msgstr ""
#. module: account_credit_control
#: model:ir.actions.act_window,name:account_credit_control.credit_policy_configuration_action
#: model:ir.ui.menu,name:account_credit_control.credit_policy_configuration_action_menu
msgid "Credit Control Policies"
msgstr ""
#. module: account_credit_control
#: model:ir.actions.act_window,help:account_credit_control.open_credit_line_emailer_wizard
msgid "Send an email for the selected lines."
msgstr ""
#. module: account_credit_control
#: view:credit.control.lines:0
msgid "Sent"
msgstr ""
#. module: account_credit_control
#: constraint:credit.control.policy.level:0
msgid "The smallest level can not be of type Previous Reminder"
msgstr ""
#. module: account_credit_control
#: help:credit.control.policy,account_ids:0
msgid "This policy will be active only for the selected accounts"
msgstr ""
#. module: account_credit_control
#: help:credit.control.printer,mark_as_sent:0
msgid "Only letter lines will be marked."
msgstr ""
#. module: account_credit_control
#: view:credit.control.line:0
#: view:credit.control.lines:0
msgid "Control Credit Lines"
msgstr ""
#. module: account_credit_control
#: model:res.groups,name:account_credit_control.group_account_credit_control_manager
msgid "Credit Control Manager"
msgstr ""
#. module: account_credit_control
#: sql_constraint:res.company:0
msgid "The company name must be unique !"
msgstr ""
#. module: account_credit_control
#: field:credit.control.policy,name:0
#: field:credit.control.policy.level,name:0
msgid "Name"
msgstr ""
#. module: account_credit_control
#: help:res.partner,credit_policy_id:0
msgid "The Credit Control Policyused for this partner. This setting can be forced on the invoice. If nothing is defined, it will use the company setting."
msgstr ""
#. module: account_credit_control
#: field:credit.control.line,mail_message_id:0
msgid "Sent Email"
msgstr ""
#. module: account_credit_control
#: model:ir.model,name:account_credit_control.model_credit_control_policy_level
msgid "A credit control policy level"
msgstr ""
#. module: account_credit_control
#: model:ir.actions.report.xml,name:account_credit_control.report_webkit_html
msgid "Credit Summary"
msgstr ""
#. module: account_credit_control
#: field:credit.control.line,date:0
msgid "Controlling date"
msgstr ""
#. module: account_credit_control
#: constraint:account.move.line:0
msgid "You can not create journal items on closed account."
msgstr ""
#. module: account_credit_control
#: field:credit.control.line,amount_due:0
msgid "Due Amount Tax incl."
msgstr ""
#. module: account_credit_control
#: field:res.company,credit_control_tolerance:0
msgid "Credit Control Tolerance"
msgstr ""
#. module: account_credit_control
#: help:res.company,credit_policy_id:0
msgid "The Credit Control Policy used on partners by default. This setting can be overriden on partners or invoices."
msgstr ""
#. module: account_credit_control
#: field:credit.control.line,policy_level_id:0
msgid "Overdue Level"
msgstr ""

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -48,6 +48,10 @@ class CreditControlLine(orm.Model):
readonly=True,
states={'draft': [('readonly', False)]}),
'date_entry': fields.related('move_line_id', 'date', type='date',
string='Entry date',
store=True, readonly=True),
'date_sent': fields.date('Sent date',
readonly=True,
states={'draft': [('readonly', False)]}),

View File

@@ -211,7 +211,8 @@ class CreditControlPolicyLevel(Model):
_columns = {
'policy_id': fields.many2one('credit.control.policy',
'Related Policy', required=True),
'name': fields.char('Name', size=128, required=True),
'name': fields.char('Name', size=128, required=True,
translate=True),
'level': fields.integer('Level', required=True),
'computation_mode': fields.selection([('net_days', 'Due Date'),
@@ -227,6 +228,9 @@ class CreditControlPolicyLevel(Model):
('email', 'Email')],
'Channel', required=True),
'custom_text': fields.text('Custom Message', required=True, translate=True),
'custom_mail_text': fields.text('Custom Mail Message',
required=True, translate=True),
}
def _check_level_mode(self, cr, uid, rids, context=None):

View File

@@ -32,7 +32,10 @@
</page>
<page string="Mail and reporting">
<field name="email_template_id"/>
<field name="custom_text"/>
<newline/>
<field name="custom_text" colspan="4"/>
<newline/>
<field name="custom_mail_text" colspan="4"/>
</page>
</notebook>
</form>

View File

@@ -4,17 +4,17 @@
${css}
body {
font-family: helvetica;
font-size: 11px;
font-size: 12px;
}
.custom_text {
font-family: helvetica;
font-size: 11px;
font-size: 12px;
}
table {
font-family: helvetica;
font-size: 11px;
font-size: 12px;
}
.header {
@@ -33,11 +33,15 @@ 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: 12px;
font-size: 11px;
font-weight: bold;
}
.basic_table td {
@@ -65,7 +69,7 @@ table {
.list_table th {
border-bottom: 2px solid black;
text-align: left;
font-size: 12px;
font-size: 11px;
font-weight: bold;
padding-right: 3px
padding-left: 3px
@@ -105,6 +109,7 @@ table .address_title {
td.amount, th.amount {
text-align: right;
padding-right:2px;
}
h1 {
@@ -126,16 +131,20 @@ tr.line {
<body>
%for comm in objects :
<% setLang(comm.partner_id.lang) %>
<% setLang(comm.get_contact_address().lang) %>
<div class="address">
<table class="recipient">
%if comm.partner_id.parent_id:
<tr><td class="name">${comm.partner_id.parent_id.name or ''}</td></tr>
<tr><td>${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")[1:] %>
<%
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.title and comm.partner_id.title.name or ''} ${comm.partner_id.name }</td></tr>
<% address_lines = comm.partner_id.contact_address.split("\n") %>
<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:
@@ -149,19 +158,81 @@ tr.line {
<br/>
</div>
<br/>
<br/>
<br/>
<div>
<%
setLang(comm.partner_id.lang)
current_uri = '%s_policy_template' % (comm.partner_id.lang)
if not context.lookup.has_template(current_uri):
# awfully horrible we add page tags here beacause openerp replaced
# mako by Jinga but not everywere so they sandbox mako into jinga
# and jinga prevent %page tag to wwork
context.lookup.put_string(current_uri,
"""<%page args="object, user=None, ctx=None, quote=None, format_exception=True, mode='email'" />
""" + comm.current_policy_level.email_template_id.body_html)
%>
<%include file="${current_uri}" args="object=comm,user=user,ctx=ctx,quote=quote,format_exception=format_exception,mode='pdf'"/>
<h3 style="clear: both; padding-top: 20px;">
${_('Reminder')}: ${comm.current_policy_level.name or '' }
</h3>
<p>${_('Dear')} ${comm.get_contact_address().name or ''},</p>
<p class="custom_text" width="95%">${comm.current_policy_level.custom_text.replace('\n', '<br />')}</p>
<br/>
<br/>
<table class="basic_table" style="width: 100%;">
<caption><b>${_('Summary')}<br/></b></caption>
<tr>
<th width="200">${_('Invoice number')}</th>
<th>${_('Invoice date')}</th>
<th>${_('Date due')}</th>
<th>${_('Invoiced amount')}</th>
<th>${_('Open amount')}</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.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

View File

@@ -1,12 +1,16 @@
<openerp>
<data>
<report auto="False"
id="report_webkit_html"
model="credit.control.communication"
name="credit_control_summary"
file="account_credit_control/report/credit_control_summary.html.mako"
string="Credit Summary"
report_type="webkit"
webkit_header="report_webkit.ir_header_webkit_basesample0"/>
<report auto="False"
id="report_webkit_html"
model="credit.control.communication"
name="credit_control_summary"
file="account_credit_control/report/credit_control_summary.html.mako"
string="Credit Summary"
report_type="webkit"
webkit_header="report_webkit.ir_header_webkit_basesample0"/>
<record model="ir.actions.report.xml" id="report_webkit_html">
<field name="precise_mode" eval="True"/>
</record>
</data>
</openerp>

View File

@@ -16,3 +16,6 @@
"account_credit_control.ir_model_access_287",1,1,"group_account_credit_control_manager","credit_control_manager_level","account_credit_control.model_credit_control_policy_level",1,1
"account_credit_control.ir_model_access_288",0,0,"group_account_credit_control_user","credit_control_user_level","account_credit_control.model_credit_control_policy_level",1,0
"account_credit_control.ir_model_access_289",0,0,"group_account_credit_control_info","credit_control_info_level","account_credit_control.model_credit_control_policy_level",1,0
"account_credit_control.ir_model_access_290",0,0,"account.group_account_user","credit_control_fin_user_line","account_credit_control.model_credit_control_line",1,0
"account_credit_control.ir_model_access_291",0,0,"account.group_account_invoice","credit_control_fin_invoice_line","account_credit_control.model_credit_control_line",1,0
"account_credit_control.ir_model_access_292",1,1,"account.group_account_manager","credit_control_fin_manager_line","account_credit_control.model_credit_control_line",1,1
1 id perm_create perm_unlink group_id/id name model_id/id perm_read perm_write
16 account_credit_control.ir_model_access_287 1 1 group_account_credit_control_manager credit_control_manager_level account_credit_control.model_credit_control_policy_level 1 1
17 account_credit_control.ir_model_access_288 0 0 group_account_credit_control_user credit_control_user_level account_credit_control.model_credit_control_policy_level 1 0
18 account_credit_control.ir_model_access_289 0 0 group_account_credit_control_info credit_control_info_level account_credit_control.model_credit_control_policy_level 1 0
19 account_credit_control.ir_model_access_290 0 0 account.group_account_user credit_control_fin_user_line account_credit_control.model_credit_control_line 1 0
20 account_credit_control.ir_model_access_291 0 0 account.group_account_invoice credit_control_fin_invoice_line account_credit_control.model_credit_control_line 1 0
21 account_credit_control.ir_model_access_292 1 1 account.group_account_manager credit_control_fin_manager_line account_credit_control.model_credit_control_line 1 1

View File

@@ -26,7 +26,7 @@ logger = logging.getLogger('credit.control.line.mailing')
class CreditCommunication(TransientModel):
"""Shell calss used to provide a base model to email template and reporting.
"""Shell class used to provide a base model to email template and reporting.
Il use this approche in version 7 a browse record will exist even if not saved"""
_name = "credit.control.communication"
_description = "credit control communication"
@@ -51,13 +51,22 @@ class CreditCommunication(TransientModel):
def get_email(self, cr, uid, com_id, context=None):
"""Return a valid email for customer"""
assert not (isinstance(com_id, list) and len(com_id) > 1), \
"com_id: only one id expected"
if isinstance(com_id, list):
assert len(com_id) == 1, "get_email only support one id as parameter"
com_id = com_id[0]
form = self.browse(cr, uid, com_id, context=context)
contact = form.get_contact_address()
return contact.email
def get_contact_address(self, cr, uid, com_id, context=None):
pmod = self.pool['res.partner']
if isinstance(com_id, list):
com_id = com_id[0]
form = self.browse(cr, uid, com_id, context=context)
email = form.partner_id.email or False
return email
part = form.partner_id
add_ids = part.address_get(adr_pref=['invoice']) or {}
add_id = add_ids.get('invoice', add_ids.get('default', False))
return pmod.browse(cr, uid, add_id, context)
def _get_credit_lines(self, cr, uid, line_ids, partner_id, level_id, context=None):
"""Return credit lines related to a partner and a policy level"""
@@ -102,6 +111,7 @@ class CreditCommunication(TransientModel):
cr_line_obj = self.pool.get('credit.control.line')
email_temp_obj = self.pool.get('email.template')
email_message_obj = self.pool.get('mail.mail')
att_obj = self.pool.get('ir.attachment')
email_ids = []
essential_fields = ['subject',
'body_html',
@@ -136,7 +146,22 @@ class CreditCommunication(TransientModel):
{'mail_message_id': email_id,
'state': state},
context=context)
att_ids = []
for att in email_values.get('attachments', []):
attach_fname = att[0]
attach_datas = att[1]
data_attach = {
'name': attach_fname,
'datas': attach_datas,
'datas_fname': attach_fname,
'res_model': 'mail.mail',
'res_id': email_id,
'type': 'binary',
}
att_ids.append(att_obj.create(cr, uid, data_attach, context=context))
email_message_obj.write(cr, uid, [email_id],
{'attachment_ids': [(6, 0, att_ids)]},
context=context)
email_ids.append(email_id)
return email_ids