mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[MIG] Clean the code to respect PEP8 (remove useless imports, remove useless spaces, ...) and fix some small bugs
(cherry picked from commit efd9e9f8efe9a5e8da791d179b5a5d57710a31c3) [FIX] Add space to respect PEP8 (cherry picked from commit 06c93c610646bb4269f303c3a7a55700cc6dfd1f) [FIX] Replace the field "full_reconcile_id" by "reconciled" in a search domain on account.move.line (cherry picked from commit cf2cfd43e34dff9eef2571b87de777a183c220c0)
This commit is contained in:
committed by
Sylvain Van Hoof
parent
36d7408b36
commit
8826b25dcd
@@ -1,3 +1,8 @@
|
||||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
|
||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||
:alt: License: AGPL-3
|
||||
|
||||
==============
|
||||
Credit Control
|
||||
==============
|
||||
|
||||
@@ -5,7 +10,7 @@ Configuration
|
||||
-------------
|
||||
|
||||
Configure the policies and policy levels in ``Accounting > Configuration >
|
||||
Credit Control > Credit Policies``.
|
||||
Credit Control > Credit Control Policies``.
|
||||
You can define as many policy levels as you need.
|
||||
|
||||
Configure a tolerance for the Credit control and a default policy
|
||||
@@ -16,14 +21,24 @@ You are able to specify a particular policy for one partner or one invoice.
|
||||
Usage
|
||||
-----
|
||||
|
||||
Menu entries are located in ``Accounting > Periodical Processing > Credit
|
||||
Control``.
|
||||
Menu entries are located in ``Accounting > Report > Credit Control``.
|
||||
|
||||
Create a new "run" in the ``Credit Control Run`` menu with the controlling date.
|
||||
Then, use the ``Compute credit lines`` button. All the credit control lines will
|
||||
Then, use the ``Compute Credit Lines`` button. All the credit control lines will
|
||||
be generated. You can find them in the ``Credit Control Lines`` menu.
|
||||
|
||||
On each generated line, you have many choices:
|
||||
* Send a email
|
||||
* Print a letter
|
||||
* Change the state (so you can ignore or reopen lines)
|
||||
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Contributors
|
||||
------------
|
||||
|
||||
* Nicolas Bessi (Camptocamp)
|
||||
* Guewen Baconnier (Camptocamp)
|
||||
* Sylvain Van Hoof (Okia SPRL) <sylvain@okia.be>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#
|
||||
##############################################################################
|
||||
{'name': 'Account Credit Control',
|
||||
'version': '10.0.0.3.0',
|
||||
'version': '10.0.1.0.0',
|
||||
'author': "Camptocamp,Odoo Community Association (OCA),Okia",
|
||||
'maintainer': 'Camptocamp',
|
||||
'category': 'Finance',
|
||||
@@ -28,7 +28,7 @@
|
||||
'account',
|
||||
'mail',
|
||||
],
|
||||
'website': 'http://www.camptocamp.com',
|
||||
'website': 'https://www.camptocamp.com',
|
||||
'data': [
|
||||
"security/res_groups.xml",
|
||||
# Reports
|
||||
@@ -55,8 +55,6 @@
|
||||
# Security
|
||||
"security/ir.model.access.csv",
|
||||
],
|
||||
'demo': [
|
||||
],
|
||||
'installable': True,
|
||||
'license': 'AGPL-3',
|
||||
'application': True
|
||||
|
||||
@@ -1,249 +1,247 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<data noupdate="1">
|
||||
<!--Email template -->
|
||||
<record id="email_template_credit_control_base" model="mail.template">
|
||||
<field name="name">Credit Control Email</field>
|
||||
<field name="email_from">${object.partner_id.company_id.email or ''}</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="credit_control_summary"/>
|
||||
<field name="body_html"><![CDATA[
|
||||
Dear ${object.contact_address.name or ''}
|
||||
<br/>
|
||||
<br/>
|
||||
${object.current_policy_level.custom_mail_text | safe}
|
||||
]]></field>
|
||||
</record>
|
||||
<odoo noupdate="1">
|
||||
<!--Email template -->
|
||||
<record id="email_template_credit_control_base" model="mail.template">
|
||||
<field name="name">Credit Control Email</field>
|
||||
<field name="email_from">${object.partner_id.company_id.email or ''}</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="credit_control_summary"/>
|
||||
<field name="body_html"><![CDATA[
|
||||
Dear ${object.contact_address.name or ''}
|
||||
<br/>
|
||||
<br/>
|
||||
${object.current_policy_level.custom_mail_text | safe}
|
||||
]]></field>
|
||||
</record>
|
||||
|
||||
<!-- policy no follow -->
|
||||
<record model="credit.control.policy"
|
||||
id="credit_control_no_follow">
|
||||
<field name="name">No follow</field>
|
||||
<field name="do_nothing" eval="1"/>
|
||||
</record>
|
||||
<!-- policy no follow -->
|
||||
<record model="credit.control.policy"
|
||||
id="credit_control_no_follow">
|
||||
<field name="name">No follow</field>
|
||||
<field name="do_nothing" eval="1"/>
|
||||
</record>
|
||||
|
||||
<!-- no follow policy -->
|
||||
<record model="credit.control.policy.level"
|
||||
id="no_follow_1">
|
||||
<field name="name">No follow</field>
|
||||
<field name="level" eval="1"/>
|
||||
<field name="computation_mode">net_days</field>
|
||||
<field name="delay_days" eval="0"/>
|
||||
<field name="email_template_id"
|
||||
ref="email_template_credit_control_base"/>
|
||||
<field name="policy_id" ref="credit_control_no_follow"/>
|
||||
<field name="channel">email</field>
|
||||
<field name="custom_text">Manual no follow</field>
|
||||
<!-- no follow policy -->
|
||||
<record model="credit.control.policy.level"
|
||||
id="no_follow_1">
|
||||
<field name="name">No follow</field>
|
||||
<field name="level" eval="1"/>
|
||||
<field name="computation_mode">net_days</field>
|
||||
<field name="delay_days" eval="0"/>
|
||||
<field name="email_template_id"
|
||||
ref="email_template_credit_control_base"/>
|
||||
<field name="policy_id" ref="credit_control_no_follow"/>
|
||||
<field name="channel">email</field>
|
||||
<field name="custom_text">Manual no follow</field>
|
||||
|
||||
<field name="custom_mail_text">Manual no follow</field>
|
||||
</record>
|
||||
<field name="custom_mail_text">Manual no follow</field>
|
||||
</record>
|
||||
|
||||
<!-- policy 1 -->
|
||||
<record model="credit.control.policy"
|
||||
id="credit_control_3_time">
|
||||
<field name="name">3 time policy</field>
|
||||
</record>
|
||||
<!-- policy 1 -->
|
||||
<record model="credit.control.policy"
|
||||
id="credit_control_3_time">
|
||||
<field name="name">3 time policy</field>
|
||||
</record>
|
||||
|
||||
<record model="credit.control.policy.level"
|
||||
id="3_time_1">
|
||||
<field name="name">10 days net</field>
|
||||
<field name="level" eval="1"/>
|
||||
<field name="computation_mode">net_days</field>
|
||||
<field name="delay_days" eval="10"/>
|
||||
<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">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.
|
||||
<record model="credit.control.policy.level"
|
||||
id="3_time_1">
|
||||
<field name="name">10 days net</field>
|
||||
<field name="level" eval="1"/>
|
||||
<field name="computation_mode">net_days</field>
|
||||
<field name="delay_days" eval="10"/>
|
||||
<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">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.
|
||||
Thank you in advance for your anticipated cooperation in this
|
||||
matter.
|
||||
|
||||
Best regards
|
||||
</field>
|
||||
Best regards
|
||||
</field>
|
||||
|
||||
<field name="custom_mail_text"><![CDATA[
|
||||
Our records indicate that we have not received the payment of the invoices mentioned in the attached document.<br/>
|
||||
<br/>
|
||||
If it has already been sent, please disregard this notice. If not, please proceed with payment within 10 days.<br/>
|
||||
<br/>
|
||||
Thank you in advance for your anticipated cooperation in this matter.<br/>
|
||||
<br/>
|
||||
Best regards
|
||||
]]></field>
|
||||
</record>
|
||||
<field name="custom_mail_text"><![CDATA[
|
||||
Our records indicate that we have not received the payment of the invoices mentioned in the attached document.<br/>
|
||||
<br/>
|
||||
If it has already been sent, please disregard this notice. If not, please proceed with payment within 10 days.<br/>
|
||||
<br/>
|
||||
Thank you in advance for your anticipated cooperation in this matter.<br/>
|
||||
<br/>
|
||||
Best regards
|
||||
]]></field>
|
||||
</record>
|
||||
|
||||
<record model="credit.control.policy.level"
|
||||
id="3_time_2">
|
||||
<field name="name">30 days end of month</field>
|
||||
<field name="level" eval="2"/>
|
||||
<field name="computation_mode">end_of_month</field>
|
||||
<field name="delay_days" eval="30"/>
|
||||
<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">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.
|
||||
<record model="credit.control.policy.level"
|
||||
id="3_time_2">
|
||||
<field name="name">30 days end of month</field>
|
||||
<field name="level" eval="2"/>
|
||||
<field name="computation_mode">end_of_month</field>
|
||||
<field name="delay_days" eval="30"/>
|
||||
<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">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.
|
||||
Thank you in advance for your anticipated cooperation in this
|
||||
matter.
|
||||
|
||||
Best regards
|
||||
</field>
|
||||
<field name="custom_mail_text"><![CDATA[
|
||||
Our records indicate that we have not yet received the payment of the invoices mentioned in the attached document despite our first reminder.<br/>
|
||||
If it has already been sent, please disregard this notice. If not, please proceed with payment within 5 days.<br/>
|
||||
<br/>
|
||||
Thank you in advance for your anticipated cooperation in this matter.<br/>
|
||||
<br/>
|
||||
Best regards
|
||||
]]></field>
|
||||
</record>
|
||||
Best regards
|
||||
</field>
|
||||
<field name="custom_mail_text"><![CDATA[
|
||||
Our records indicate that we have not yet received the payment of the invoices mentioned in the attached document despite our first reminder.<br/>
|
||||
If it has already been sent, please disregard this notice. If not, please proceed with payment within 5 days.<br/>
|
||||
<br/>
|
||||
Thank you in advance for your anticipated cooperation in this matter.<br/>
|
||||
<br/>
|
||||
Best regards
|
||||
]]></field>
|
||||
</record>
|
||||
|
||||
<record model="credit.control.policy.level"
|
||||
id="3_time_3">
|
||||
<field name="name">10 days last reminder</field>
|
||||
<field name="level" eval="3"/>
|
||||
<field name="computation_mode">previous_date</field>
|
||||
<field name="delay_days" eval="10"/>
|
||||
<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">
|
||||
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.
|
||||
<record model="credit.control.policy.level"
|
||||
id="3_time_3">
|
||||
<field name="name">10 days last reminder</field>
|
||||
<field name="level" eval="3"/>
|
||||
<field name="computation_mode">previous_date</field>
|
||||
<field name="delay_days" eval="10"/>
|
||||
<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">
|
||||
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.
|
||||
|
||||
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"><![CDATA[
|
||||
Our records indicate that we still have not received the payment of the invoices mentioned in the attached document despite our two reminders.<br/>
|
||||
If payment have already been sent, please disregard this notice. If not, please proceed with payment.<br/>
|
||||
If your payment has not been received in the next 5 days, your file will be transfered to our debt collection agency.<br/>
|
||||
<br/>
|
||||
Should you need us to arrange a payment plan for you, please advise.<br/>
|
||||
A customer account statement is enclosed for you convenience.<br/>
|
||||
<br/>
|
||||
Thank you in advance for your anticipated cooperation in this matter.<br/>
|
||||
<br/>
|
||||
Best regards
|
||||
]]></field>
|
||||
</record>
|
||||
<field name="custom_mail_text"><![CDATA[
|
||||
Our records indicate that we still have not received the payment of the invoices mentioned in the attached document despite our two reminders.<br/>
|
||||
If payment have already been sent, please disregard this notice. If not, please proceed with payment.<br/>
|
||||
If your payment has not been received in the next 5 days, your file will be transfered to our debt collection agency.<br/>
|
||||
<br/>
|
||||
Should you need us to arrange a payment plan for you, please advise.<br/>
|
||||
A customer account statement is enclosed for you convenience.<br/>
|
||||
<br/>
|
||||
Thank you in advance for your anticipated cooperation in this matter.<br/>
|
||||
<br/>
|
||||
Best regards
|
||||
]]></field>
|
||||
</record>
|
||||
|
||||
<!-- policy 2 -->
|
||||
<record model="credit.control.policy"
|
||||
id="credit_control_2_time">
|
||||
<field name="name">2 time policy</field>
|
||||
</record>
|
||||
<!-- policy 2 -->
|
||||
<record model="credit.control.policy"
|
||||
id="credit_control_2_time">
|
||||
<field name="name">2 time policy</field>
|
||||
</record>
|
||||
|
||||
<record model="credit.control.policy.level"
|
||||
id="2_time_1">
|
||||
<field name="name">30 days end of month</field>
|
||||
<field name="level" eval="1"/>
|
||||
<field name="computation_mode">end_of_month</field>
|
||||
<field name="delay_days" eval="30"/>
|
||||
<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">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.
|
||||
<record model="credit.control.policy.level"
|
||||
id="2_time_1">
|
||||
<field name="name">30 days end of month</field>
|
||||
<field name="level" eval="1"/>
|
||||
<field name="computation_mode">end_of_month</field>
|
||||
<field name="delay_days" eval="30"/>
|
||||
<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">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.
|
||||
Thank you in advance for your anticipated cooperation in this
|
||||
matter.
|
||||
|
||||
Best regards
|
||||
</field>
|
||||
<field name="custom_mail_text"><![CDATA[
|
||||
Our records indicate that we have not received the payment of the invoices mentioned in the attached document.<br/>
|
||||
If it has already been sent, please disregard this notice. If not, please proceed with payment within 10 days.<br/>
|
||||
<br/>
|
||||
Thank you in advance for your anticipated cooperation in this matter.<br/>
|
||||
<br/>
|
||||
Best regards
|
||||
]]></field>
|
||||
</record>
|
||||
Best regards
|
||||
</field>
|
||||
<field name="custom_mail_text"><![CDATA[
|
||||
Our records indicate that we have not received the payment of the invoices mentioned in the attached document.<br/>
|
||||
If it has already been sent, please disregard this notice. If not, please proceed with payment within 10 days.<br/>
|
||||
<br/>
|
||||
Thank you in advance for your anticipated cooperation in this matter.<br/>
|
||||
<br/>
|
||||
Best regards
|
||||
]]></field>
|
||||
</record>
|
||||
|
||||
<record model="credit.control.policy.level"
|
||||
id="2_time_2">
|
||||
<field name="name">60 days last reminder</field>
|
||||
<field name="level" eval="2"/>
|
||||
<field name="computation_mode">previous_date</field>
|
||||
<field name="delay_days" eval="60"/>
|
||||
<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">Our records indicate that we still have
|
||||
not received the payment of the above mentioned invoice despite
|
||||
our reminder.
|
||||
<record model="credit.control.policy.level"
|
||||
id="2_time_2">
|
||||
<field name="name">60 days last reminder</field>
|
||||
<field name="level" eval="2"/>
|
||||
<field name="computation_mode">previous_date</field>
|
||||
<field name="delay_days" eval="60"/>
|
||||
<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">Our records indicate that we still have
|
||||
not received the payment of the above mentioned invoice 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>
|
||||
<field name="custom_mail_text"><![CDATA[
|
||||
Our records indicate that we still have not received the payment of the invoices mentioned in the attached document despite our reminder.
|
||||
<br/>
|
||||
<br/>
|
||||
If payment have already been sent, please disregard this notice. If not, please proceed with payment.<br/>
|
||||
If your payment has not been received in the next 5 days, your file will be transfered to our debt<br/>
|
||||
collection agency.<br/>
|
||||
<br/>
|
||||
Should you need us to arrange a payment plan for you, please advise.<br/>
|
||||
A customer account statement is enclosed for you convenience.<br/>
|
||||
<br/>
|
||||
Thank you in advance for your anticipated cooperation in this matter.<br/>
|
||||
<br/>
|
||||
Best regards
|
||||
]]></field>
|
||||
</record>
|
||||
Best regards
|
||||
</field>
|
||||
<field name="custom_mail_text"><![CDATA[
|
||||
Our records indicate that we still have not received the payment of the invoices mentioned in the attached document despite our reminder.
|
||||
<br/>
|
||||
<br/>
|
||||
If payment have already been sent, please disregard this notice. If not, please proceed with payment.<br/>
|
||||
If your payment has not been received in the next 5 days, your file will be transfered to our debt<br/>
|
||||
collection agency.<br/>
|
||||
<br/>
|
||||
Should you need us to arrange a payment plan for you, please advise.<br/>
|
||||
A customer account statement is enclosed for you convenience.<br/>
|
||||
<br/>
|
||||
Thank you in advance for your anticipated cooperation in this matter.<br/>
|
||||
<br/>
|
||||
Best regards
|
||||
]]></field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="base.main_company" model="res.company">
|
||||
<field name="credit_policy_id" ref="credit_control_3_time"/>
|
||||
</record>
|
||||
<record id="base.main_company" model="res.company">
|
||||
<field name="credit_policy_id" ref="credit_control_3_time"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
import logging
|
||||
from odoo import SUPERUSER_ID
|
||||
from odoo.modules.registry import RegistryManager
|
||||
|
||||
uid = SUPERUSER_ID
|
||||
|
||||
__name__ = 'Change custom_mail_text text field to hmtl field'
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
def migrate_replace_text_with_html(cr, registry):
|
||||
cr.execute("""update credit_control_policy_level set
|
||||
custom_mail_text=regexp_replace(custom_mail_text, E'[\\n]',
|
||||
'<br/>','g')""")
|
||||
cr.execute("""update ir_translation set
|
||||
value=regexp_replace(value, E'[\\n]','<br/>','g')
|
||||
where name='credit.control.policy.level,custom_mail_text'""")
|
||||
|
||||
|
||||
def migrate(cr, version):
|
||||
if not version:
|
||||
# it is the installation of the module
|
||||
return
|
||||
registry = RegistryManager.get(cr.dbname)
|
||||
migrate_replace_text_with_html(cr, registry)
|
||||
@@ -18,7 +18,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
from odoo import models, fields
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class AccountAccount(models.Model):
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
from odoo import models, fields, api, _
|
||||
from odoo.exceptions import Warning
|
||||
from odoo import _, api, fields, models
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class AccountInvoice(models.Model):
|
||||
@@ -57,7 +57,7 @@ class AccountInvoice(models.Model):
|
||||
('state', '!=', 'draft')]
|
||||
cc_nondraft_lines = cc_line_obj.search(nondraft_domain)
|
||||
if cc_nondraft_lines:
|
||||
raise Warning(
|
||||
raise UserError(
|
||||
_('You cannot cancel this invoice.\n'
|
||||
'A payment reminder has already been '
|
||||
'sent to the customer.\n'
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
##############################################################################
|
||||
import logging
|
||||
|
||||
from odoo import models, fields, api, _
|
||||
from odoo.exceptions import Warning
|
||||
from odoo import _, api, fields, models
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -226,7 +226,7 @@ class CreditControlLine(models.Model):
|
||||
def unlink(self):
|
||||
for line in self:
|
||||
if line.state != 'draft':
|
||||
raise Warning(
|
||||
raise UserError(
|
||||
_('You are not allowed to delete a credit control '
|
||||
'line that is not in draft state.')
|
||||
)
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
from odoo import models, fields, api, _
|
||||
from odoo.exceptions import Warning
|
||||
from odoo import _, api, fields, models
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class CreditControlPolicy(models.Model):
|
||||
@@ -198,7 +198,7 @@ class CreditControlPolicy(models.Model):
|
||||
if account in x.account_ids or x.do_nothing]
|
||||
if self not in allowed:
|
||||
allowed_names = u"\n".join(x.name for x in allowed)
|
||||
raise Warning(
|
||||
raise UserError(
|
||||
_('You can only use a policy set on '
|
||||
'account %s.\n'
|
||||
'Please choose one of the following '
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
##############################################################################
|
||||
import logging
|
||||
|
||||
from odoo import models, fields, api, _
|
||||
from odoo.exceptions import Warning
|
||||
from odoo import _, api, fields, models
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -84,16 +84,16 @@ class CreditControlRun(models.Model):
|
||||
runs = self.search([('date', '>', controlling_date)],
|
||||
order='date DESC', limit=1)
|
||||
if runs:
|
||||
raise Warning(_('A run has already been executed more '
|
||||
'recently than %s') % (runs.date))
|
||||
raise UserError(_('A run has already been executed more '
|
||||
'recently than %s') % (runs.date))
|
||||
|
||||
line_obj = self.env['credit.control.line']
|
||||
lines = line_obj.search([('date', '>', controlling_date)],
|
||||
order='date DESC', limit=1)
|
||||
if lines:
|
||||
raise Warning(_('A credit control line more '
|
||||
'recent than %s exists at %s') %
|
||||
(controlling_date, lines.date))
|
||||
raise UserError(_('A credit control line more '
|
||||
'recent than %s exists at %s') %
|
||||
(controlling_date, lines.date))
|
||||
|
||||
@api.multi
|
||||
@api.returns('credit.control.line')
|
||||
@@ -105,7 +105,7 @@ class CreditControlRun(models.Model):
|
||||
|
||||
policies = self.policy_ids
|
||||
if not policies:
|
||||
raise Warning(_('Please select a policy'))
|
||||
raise UserError(_('Please select a policy'))
|
||||
|
||||
report = ''
|
||||
generated = self.env['credit.control.line']
|
||||
@@ -157,8 +157,8 @@ class CreditControlRun(models.Model):
|
||||
except Exception:
|
||||
# In case of exception openerp will do a rollback
|
||||
# for us and free the lock
|
||||
raise Warning(_('A credit control run is already running '
|
||||
'in background, please try later.'))
|
||||
raise UserError(_('A credit control run is already running '
|
||||
'in background, please try later.'))
|
||||
|
||||
self._generate_credit_lines()
|
||||
return True
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
from odoo import models, fields
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class Mail(models.Model):
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
from odoo import models, fields
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResCompany(models.Model):
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
from odoo import models, fields, api
|
||||
from odoo.exceptions import Warning, ValidationError
|
||||
from odoo import api, fields, models
|
||||
from odoo.exceptions import UserError, ValidationError
|
||||
|
||||
|
||||
class ResPartner(models.Model):
|
||||
@@ -54,6 +54,6 @@ class ResPartner(models.Model):
|
||||
policy = partner.credit_policy_id
|
||||
try:
|
||||
policy.check_policy_against_account(account)
|
||||
except Warning as err:
|
||||
except UserError as err:
|
||||
# constrains should raise ValidationError exceptions
|
||||
raise ValidationError(err)
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
"id","perm_create","perm_unlink","group_id/id","name","model_id/id","perm_read","perm_write"
|
||||
"account_credit_control.ir_model_access_270",1,1,"group_account_credit_control_manager","credit_control_manager_line","account_credit_control.model_credit_control_line",1,1
|
||||
"account_credit_control.ir_model_access_271",1,1,"group_account_credit_control_user","credit_control_user_line","account_credit_control.model_credit_control_line",1,1
|
||||
"account_credit_control.ir_model_access_272",0,0,"group_account_credit_control_info","credit_control_info_line","account_credit_control.model_credit_control_line",1,0
|
||||
"account_credit_control.ir_model_access_273",1,1,"group_account_credit_control_manager","credit_control_manager_mail_template","mail.model_mail_template",1,1
|
||||
"account_credit_control.ir_model_access_275",1,1,"group_account_credit_control_manager","credit_control_manager_mail_message","mail.model_mail_message",1,1
|
||||
"account_credit_control.ir_model_access_276",1,0,"group_account_credit_control_user","credit_control_user_mail_message","mail.model_mail_message",1,1
|
||||
"account_credit_control.ir_model_access_277",0,0,"group_account_credit_control_info","credit_control_info_mail_message","mail.model_mail_message",1,0
|
||||
"account_credit_control.ir_model_access_281",1,1,"group_account_credit_control_manager","credit_control_mananger_run","account_credit_control.model_credit_control_run",1,1
|
||||
"account_credit_control.ir_model_access_282",1,1,"group_account_credit_control_user","credit_control_user_run","account_credit_control.model_credit_control_run",1,1
|
||||
"account_credit_control.ir_model_access_283",0,0,"group_account_credit_control_info","credit_control_info_run","account_credit_control.model_credit_control_run",1,0
|
||||
"account_credit_control.ir_model_access_284",1,1,"group_account_credit_control_manager","credit_control_manager_policy","account_credit_control.model_credit_control_policy",1,1
|
||||
"account_credit_control.ir_model_access_285",0,0,"group_account_credit_control_user","credit_control_user_policy","account_credit_control.model_credit_control_policy",1,0
|
||||
"account_credit_control.ir_model_access_286",0,0,"group_account_credit_control_info","credit_control_info_policy","account_credit_control.model_credit_control_policy",1,0
|
||||
"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
|
||||
id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink
|
||||
account_credit_control.ir_model_access_270,credit_control_manager_line,account_credit_control.model_credit_control_line,group_account_credit_control_manager,1,1,1,1
|
||||
account_credit_control.ir_model_access_271,credit_control_user_line,account_credit_control.model_credit_control_line,group_account_credit_control_user,1,1,1,1
|
||||
account_credit_control.ir_model_access_272,credit_control_info_line,account_credit_control.model_credit_control_line,group_account_credit_control_info,1,0,0,0
|
||||
account_credit_control.ir_model_access_273,credit_control_manager_mail_template,mail.model_mail_template,group_account_credit_control_manager,1,1,1,1
|
||||
account_credit_control.ir_model_access_275,credit_control_manager_mail_message,mail.model_mail_message,group_account_credit_control_manager,1,1,1,1
|
||||
account_credit_control.ir_model_access_276,credit_control_user_mail_message,mail.model_mail_message,group_account_credit_control_user,1,1,1,0
|
||||
account_credit_control.ir_model_access_277,credit_control_info_mail_message,mail.model_mail_message,group_account_credit_control_info,1,0,0,0
|
||||
account_credit_control.ir_model_access_281,credit_control_mananger_run,account_credit_control.model_credit_control_run,group_account_credit_control_manager,1,1,1,1
|
||||
account_credit_control.ir_model_access_282,credit_control_user_run,account_credit_control.model_credit_control_run,group_account_credit_control_user,1,1,1,1
|
||||
account_credit_control.ir_model_access_283,credit_control_info_run,account_credit_control.model_credit_control_run,group_account_credit_control_info,1,0,0,0
|
||||
account_credit_control.ir_model_access_284,credit_control_manager_policy,account_credit_control.model_credit_control_policy,group_account_credit_control_manager,1,1,1,1
|
||||
account_credit_control.ir_model_access_285,credit_control_user_policy,account_credit_control.model_credit_control_policy,group_account_credit_control_user,1,0,0,0
|
||||
account_credit_control.ir_model_access_286,credit_control_info_policy,account_credit_control.model_credit_control_policy,group_account_credit_control_info,1,0,0,0
|
||||
account_credit_control.ir_model_access_287,credit_control_manager_level,account_credit_control.model_credit_control_policy_level,group_account_credit_control_manager,1,1,1,1
|
||||
account_credit_control.ir_model_access_288,credit_control_user_level,account_credit_control.model_credit_control_policy_level,group_account_credit_control_user,1,0,0,0
|
||||
account_credit_control.ir_model_access_289,credit_control_info_level,account_credit_control.model_credit_control_policy_level,group_account_credit_control_info,1,0,0,0
|
||||
account_credit_control.ir_model_access_290,credit_control_fin_user_line,account_credit_control.model_credit_control_line,account.group_account_user,1,0,0,0
|
||||
account_credit_control.ir_model_access_291,credit_control_fin_invoice_line,account_credit_control.model_credit_control_line,account.group_account_invoice,1,0,0,0
|
||||
account_credit_control.ir_model_access_292,credit_control_fin_manager_line,account_credit_control.model_credit_control_line,account.group_account_manager,1,1,1,1
|
||||
|
||||
|
@@ -49,26 +49,26 @@
|
||||
<field name="model">credit.control.line</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Control Credit Lines">
|
||||
<group string="Filters">
|
||||
<filter name="filter_draft" icon="terp-mail-message-new"
|
||||
<group string="Filters" name="filters">
|
||||
<filter name="filter_draft" icon="fa-envelope"
|
||||
string="Draft" domain="[('state', '=', 'draft')]"
|
||||
help="Draft lines have to be triaged."/>
|
||||
<filter name="filter_to_be_sent" icon="terp-mail-forward"
|
||||
<filter name="filter_to_be_sent" icon="fa-share"
|
||||
string="Ready To Send"
|
||||
domain="[('state', '=', 'to_be_sent')]"
|
||||
help="These lines are ready to send by email or by letter using the Actions."/>
|
||||
<filter name="filter_ignored" icon="terp-mail_delete"
|
||||
<filter name="filter_ignored" icon="fa-times"
|
||||
string="Ignored"
|
||||
domain="[('state', '=', 'ignored')]"
|
||||
help="Lines which have been ignored from previous runs."/>
|
||||
<filter name="filter_sent" icon="terp-mail-replied"
|
||||
<filter name="filter_sent" icon="fa-paper-plane"
|
||||
string="Sent" domain="[('state', '=', 'sent')]"
|
||||
help="Lines already sent."/>
|
||||
<filter name="filter_error" icon="terp-gtk-stop"
|
||||
<filter name="filter_error" icon="fa-exclamation-triangle"
|
||||
string="Error"
|
||||
domain="[('state', 'in', ('error', 'email_error'))]"
|
||||
help="An error has occured during the sending of the email."/>
|
||||
<filter name="filter_manual" icon="terp-gtk-stop"
|
||||
<filter name="filter_manual" icon="fa-hand-paper-o"
|
||||
string="Manual change"
|
||||
domain="[('manually_overridden', '=', True)]"
|
||||
help="The line was deprecated by a manual change of policy on invoice."/>
|
||||
@@ -79,7 +79,7 @@
|
||||
<field name="policy_id"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="More...">
|
||||
<group expand="0" string="More..." name="group_by">
|
||||
<field name="partner_id"/>
|
||||
<field name="account_id"/>
|
||||
<field name="invoice_id"/>
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#
|
||||
##############################################################################
|
||||
import logging
|
||||
from odoo import models, fields, api
|
||||
from odoo import api, fields, models
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from odoo import models, fields, api, _
|
||||
from odoo.exceptions import Warning
|
||||
from odoo import _, api, fields, models
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class CreditControlEmailer(models.TransientModel):
|
||||
@@ -60,7 +60,7 @@ class CreditControlEmailer(models.TransientModel):
|
||||
def email_lines(self):
|
||||
self.ensure_one()
|
||||
if not self.line_ids:
|
||||
raise Warning(_('No credit control lines selected.'))
|
||||
raise UserError(_('No credit control lines selected.'))
|
||||
|
||||
comm_obj = self.env['credit.control.communication']
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
from odoo import models, fields, api, _
|
||||
from odoo.exceptions import Warning
|
||||
from odoo import _, api, fields, models
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class CreditControlMarker(models.TransientModel):
|
||||
@@ -72,12 +72,12 @@ class CreditControlMarker(models.TransientModel):
|
||||
self.ensure_one()
|
||||
|
||||
if not self.line_ids:
|
||||
raise Warning(_('No credit control lines selected.'))
|
||||
raise UserError(_('No credit control lines selected.'))
|
||||
|
||||
filtered_lines = self._filter_lines(self.line_ids)
|
||||
if not filtered_lines:
|
||||
raise Warning(_('No lines will be changed. '
|
||||
'All the selected lines are already done.'))
|
||||
raise UserError(_('No lines will be changed. '
|
||||
'All the selected lines are already done.'))
|
||||
|
||||
self._mark_lines(filtered_lines, self.name)
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
##############################################################################
|
||||
import logging
|
||||
|
||||
from odoo import models, fields, api, _
|
||||
from odoo.exceptions import Warning
|
||||
from odoo import _, api, fields, models
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -60,11 +60,11 @@ class CreditControlPolicyChanger(models.TransientModel):
|
||||
selected_lines = self.env['account.move.line']
|
||||
for invoice in invoice_obj.browse(active_ids):
|
||||
if invoice.type in ('in_invoice', 'in_refund', 'out_refund'):
|
||||
raise Warning(_('Please use wizard on customer invoices'))
|
||||
raise UserError(_('Please use wizard on customer invoices'))
|
||||
|
||||
domain = [('account_id', '=', invoice.account_id.id),
|
||||
('move_id', '=', invoice.move_id.id),
|
||||
('reconcile_id', '=', False)]
|
||||
('reconciled', '=', False)]
|
||||
move_lines = selected_lines.search(domain)
|
||||
selected_lines |= move_lines
|
||||
return selected_lines
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from odoo import models, fields, api, _
|
||||
from odoo.exceptions import Warning
|
||||
from odoo import _, api, fields, models
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class CreditControlPrinter(models.TransientModel):
|
||||
@@ -58,7 +58,7 @@ class CreditControlPrinter(models.TransientModel):
|
||||
self.ensure_one()
|
||||
comm_obj = self.env['credit.control.communication']
|
||||
if not self.line_ids:
|
||||
raise Warning(_('No credit control lines selected.'))
|
||||
raise UserError(_('No credit control lines selected.'))
|
||||
|
||||
lines = self._get_lines(self.line_ids, self._credit_line_predicate)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user