diff --git a/account_check_deposit/README.rst b/account_check_deposit/README.rst index 9a5e28e99..56fa1f015 100644 --- a/account_check_deposit/README.rst +++ b/account_check_deposit/README.rst @@ -1,22 +1,46 @@ -.. 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 +===================== +Account Check Deposit +===================== -============= -Check Deposit -============= +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png + :target: https://odoo-community.org/page/development-status + :alt: Mature +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--financial--tools-lightgray.png?logo=github + :target: https://github.com/OCA/account-financial-tools/tree/11.0/account_check_deposit + :alt: OCA/account-financial-tools +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/account-financial-tools-11-0/account-financial-tools-11-0-account_check_deposit + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/92/11.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| This module allows you to easily manage check deposits : you can select all -the checks you received and create a global deposit for the -selected checks. This module supports multi-currency ; each deposit has a currency -and all the checks of the deposit must have the same currency -(so, if you have checks in EUR and checks in USD, you must create 2 deposits : -one in EUR and one in USD). +the checks you received and create a global deposit for the selected checks. +This module supports multi-currency ; each deposit has a currency and all the +checks of the deposit must have the same currency (so, if you have checks in +EUR and checks in USD, you must create 2 deposits: one in EUR and one in USD). + +**Table of contents** + +.. contents:: + :local: Configuration ============= -In the menu *Accounting > Configuration > Accounting > Journals*, create a new journal: +In the menu *Invoicing > Configuration > Accounting > Journals*, create a new +journal: * Name: Checks Received * Type: Bank @@ -24,54 +48,80 @@ In the menu *Accounting > Configuration > Accounting > Journals*, create a new j * Default Debit Account: select an account for checks received * Default Credit Account: idem -This bank journal will be available as a payment method in Odoo. The account you configured as *Default Debit Account* and *Defaut Credit Account* is the account via which the amounts of checks will transit between the reception of a check from a customer and the validation of the check deposit in Odoo. +This bank journal will be available as a payment method in Odoo. The account +you configured as *Default Debit Account* and *Defaut Credit Account* is the +account via which the amounts of checks will transit between the reception of a +check from a customer and the validation of the check deposit in Odoo. -On the Settings page of the Accounting, you should configure the *Check Deposit Offsetting Account*: +On the Settings page of the Accounting, you should configure the +*Check Deposit Offsetting Account*: -* if you select *Bank Account*, the counter-part of the account move related to the check deposit will be the default debit account of the bank account selected on the check deposit. -* if you select *Transfer Account*, you will have to select a specific account that will be used as transfer account for check deposits. +* if you select *Bank Account*, the counter-part of the account move related to + the check deposit will be the default debit account of the bank account + selected on the check deposit. +* if you select *Transfer Account*, you will have to select a specific account + that will be used as transfer account for check deposits. Usage ===== -When you receive a check that pays a customer invoice, you can go to that invoice and click on the button *Register Payment* and select the *Check Received* journal as *Payment Method*. +When you receive a check that pays a customer invoice, you can go to that +invoice and click on the button *Register Payment* and select the +*Check Received* journal as *Payment Method*. -When you want to deposit checks to the bank, go to the menu *Accounting > Adviser > Check Deposit*, create a new check deposit and set the journal *Checks Received* and select the bank account on which you want to credit the checks. Then click on *Add an item* to select the checks you want to deposit at the bank. Eventually, validate the deposit and print the report (you probably want to customize this report). - -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/92/10.0 +When you want to deposit checks to the bank, go to the menu +*Accounting > Adviser > Check Deposit*, create a new check deposit and set the +journal *Checks Received* and select the bank account on which you want to +credit the checks. Then click on *Add an item* to select the checks you want to +deposit at the bank. Eventually, validate the deposit and print the report +(you probably want to customize this report). Bug Tracker =========== -Bugs are tracked on `GitHub Issues -`_. In case of trouble, please -check there if your issue has already been reported. If you spotted it first, -help us smashing it by providing a detailed and welcomed feedback. +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. Credits ======= +Authors +~~~~~~~ + +* Akretion +* Tecnativa + Contributors ------------- +~~~~~~~~~~~~ -* Benoît GUILLOT -* Chafique DELLI -* Alexis de Lattre -* Mourad EL HADJ MIMOUNE +* `Akretion `_: -Maintainer ----------- + * Benoît GUILLOT + * Chafique DELLI + * Alexis de Lattre + * Mourad EL HADJ MIMOUNE + +* `Tecnativa `_: + + * Pedro M. Baeza + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. .. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :target: https://odoo-community.org -This module is maintained by the OCA. - OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -To contribute to this module, please visit https://odoo-community.org. +This module is part of the `OCA/account-financial-tools `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_check_deposit/__manifest__.py b/account_check_deposit/__manifest__.py index 79d13f9f5..8c5dc9dbb 100644 --- a/account_check_deposit/__manifest__.py +++ b/account_check_deposit/__manifest__.py @@ -1,31 +1,34 @@ # -*- coding: utf-8 -*- -# © 2012-2015 Akretion (http://www.akretion.com/) +# Copyright 2012-2016 Akretion (http://www.akretion.com/) # @author: Benoît GUILLOT # @author: Chafique DELLI # @author: Alexis de Lattre +# Copyright 2018 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { 'name': 'Account Check Deposit', - 'version': '10.0.1.0.0', - 'category': 'Accounting & Finance', + 'version': '11.0.1.0.0', + 'category': 'Accounting', 'license': 'AGPL-3', 'summary': 'Manage deposit of checks to the bank', - 'author': "Akretion,Odoo Community Association (OCA)", - 'website': 'http://www.akretion.com/', + 'author': "Akretion," + "Tecnativa," + "Odoo Community Association (OCA)", + 'website': 'http://github.com/OCA/account-financial-tools', 'depends': [ - 'account_accountant', + 'account_invoicing', ], + 'development_status': 'Mature', 'data': [ 'data/sequence.xml', 'views/account_deposit_view.xml', 'views/account_move_line_view.xml', - 'views/account_config_settings.xml', + 'views/res_config_settings_views.xml', 'security/ir.model.access.csv', 'security/check_deposit_security.xml', 'report/report.xml', 'report/report_checkdeposit.xml', ], 'installable': True, - 'application': True, } diff --git a/account_check_deposit/models/__init__.py b/account_check_deposit/models/__init__.py index 2bec86b0c..91bc35f52 100644 --- a/account_check_deposit/models/__init__.py +++ b/account_check_deposit/models/__init__.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- - -from . import company -from . import account_config_settings from . import account_deposit +from . import account_move_line +from . import res_company +from . import res_config_settings diff --git a/account_check_deposit/models/account_config_settings.py b/account_check_deposit/models/account_config_settings.py deleted file mode 100644 index 51f3423fa..000000000 --- a/account_check_deposit/models/account_config_settings.py +++ /dev/null @@ -1,14 +0,0 @@ -# -*- coding: utf-8 -*- -# © 2016 Akretion (Alexis de Lattre ) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). - -from odoo import models, fields - - -class AccountConfigSettings(models.TransientModel): - _inherit = 'account.config.settings' - - check_deposit_offsetting_account = fields.Selection( - related='company_id.check_deposit_offsetting_account') - check_deposit_transfer_account_id = fields.Many2one( - related='company_id.check_deposit_transfer_account_id') diff --git a/account_check_deposit/models/account_deposit.py b/account_check_deposit/models/account_deposit.py index 1aa2ceaaf..e3c48e6ce 100644 --- a/account_check_deposit/models/account_deposit.py +++ b/account_check_deposit/models/account_deposit.py @@ -1,12 +1,12 @@ -# -*- coding: utf-8 -*- -# © 2012-2016 Akretion (http://www.akretion.com/) +# Copyright 2012-2016 Akretion (http://www.akretion.com/) # @author: Benoît GUILLOT # @author: Chafique DELLI # @author: Alexis de Lattre # @author: Mourad EL HADJ MIMOUNE +# Copyright 2018 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from odoo import models, fields, api, _ +from odoo import _, api, fields, models import odoo.addons.decimal_precision as dp from odoo.exceptions import ValidationError, UserError @@ -261,10 +261,3 @@ class AccountCheckDeposit(models.Model): self.currency_id = self.journal_id.currency_id else: self.currency_id = self.journal_id.company_id.currency_id - - -class AccountMoveLine(models.Model): - _inherit = "account.move.line" - - check_deposit_id = fields.Many2one( - 'account.check.deposit', string='Check Deposit', copy=False) diff --git a/account_check_deposit/models/account_move_line.py b/account_check_deposit/models/account_move_line.py new file mode 100644 index 000000000..0c3384303 --- /dev/null +++ b/account_check_deposit/models/account_move_line.py @@ -0,0 +1,19 @@ +# Copyright 2012-2016 Akretion (http://www.akretion.com/) +# @author: Benoît GUILLOT +# @author: Chafique DELLI +# @author: Alexis de Lattre +# @author: Mourad EL HADJ MIMOUNE +# Copyright 2018 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class AccountMoveLine(models.Model): + _inherit = "account.move.line" + + check_deposit_id = fields.Many2one( + 'account.check.deposit', + string='Check Deposit', + copy=False, + ) diff --git a/account_check_deposit/models/company.py b/account_check_deposit/models/res_company.py similarity index 97% rename from account_check_deposit/models/company.py rename to account_check_deposit/models/res_company.py index f83c1ac7d..f497ccac0 100644 --- a/account_check_deposit/models/company.py +++ b/account_check_deposit/models/res_company.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # © 2012-2016 Akretion (http://www.akretion.com/) # @author: Benoît GUILLOT # @author: Chafique DELLI diff --git a/account_check_deposit/models/res_config_settings.py b/account_check_deposit/models/res_config_settings.py new file mode 100644 index 000000000..dd434c841 --- /dev/null +++ b/account_check_deposit/models/res_config_settings.py @@ -0,0 +1,16 @@ +# Copyright 2016 Akretion (Alexis de Lattre ) +# Copyright 2018 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import fields, models + + +class ResConfigSettings(models.TransientModel): + _inherit = 'res.config.settings' + + check_deposit_offsetting_account = fields.Selection( + related='company_id.check_deposit_offsetting_account', + ) + check_deposit_transfer_account_id = fields.Many2one( + related='company_id.check_deposit_transfer_account_id', + ) diff --git a/account_check_deposit/readme/CONFIGURE.rst b/account_check_deposit/readme/CONFIGURE.rst new file mode 100644 index 000000000..478b663ae --- /dev/null +++ b/account_check_deposit/readme/CONFIGURE.rst @@ -0,0 +1,22 @@ +In the menu *Invoicing > Configuration > Accounting > Journals*, create a new +journal: + +* Name: Checks Received +* Type: Bank +* Short Code: CHK (or any code you want) +* Default Debit Account: select an account for checks received +* Default Credit Account: idem + +This bank journal will be available as a payment method in Odoo. The account +you configured as *Default Debit Account* and *Defaut Credit Account* is the +account via which the amounts of checks will transit between the reception of a +check from a customer and the validation of the check deposit in Odoo. + +On the Settings page of the Accounting, you should configure the +*Check Deposit Offsetting Account*: + +* if you select *Bank Account*, the counter-part of the account move related to + the check deposit will be the default debit account of the bank account + selected on the check deposit. +* if you select *Transfer Account*, you will have to select a specific account + that will be used as transfer account for check deposits. diff --git a/account_check_deposit/readme/CONTRIBUTORS.rst b/account_check_deposit/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..21d67b3a9 --- /dev/null +++ b/account_check_deposit/readme/CONTRIBUTORS.rst @@ -0,0 +1,10 @@ +* `Akretion `_: + + * Benoît GUILLOT + * Chafique DELLI + * Alexis de Lattre + * Mourad EL HADJ MIMOUNE + +* `Tecnativa `_: + + * Pedro M. Baeza diff --git a/account_check_deposit/readme/DESCRIPTION.rst b/account_check_deposit/readme/DESCRIPTION.rst new file mode 100644 index 000000000..7702051c2 --- /dev/null +++ b/account_check_deposit/readme/DESCRIPTION.rst @@ -0,0 +1,5 @@ +This module allows you to easily manage check deposits : you can select all +the checks you received and create a global deposit for the selected checks. +This module supports multi-currency ; each deposit has a currency and all the +checks of the deposit must have the same currency (so, if you have checks in +EUR and checks in USD, you must create 2 deposits: one in EUR and one in USD). diff --git a/account_check_deposit/readme/USAGE.rst b/account_check_deposit/readme/USAGE.rst new file mode 100644 index 000000000..ff0716cce --- /dev/null +++ b/account_check_deposit/readme/USAGE.rst @@ -0,0 +1,10 @@ +When you receive a check that pays a customer invoice, you can go to that +invoice and click on the button *Register Payment* and select the +*Check Received* journal as *Payment Method*. + +When you want to deposit checks to the bank, go to the menu +*Accounting > Adviser > Check Deposit*, create a new check deposit and set the +journal *Checks Received* and select the bank account on which you want to +credit the checks. Then click on *Add an item* to select the checks you want to +deposit at the bank. Eventually, validate the deposit and print the report +(you probably want to customize this report). diff --git a/account_check_deposit/tests/test_check_deposit.py b/account_check_deposit/tests/test_check_deposit.py index 9cc18f71c..7deef7f4a 100644 --- a/account_check_deposit/tests/test_check_deposit.py +++ b/account_check_deposit/tests/test_check_deposit.py @@ -1,6 +1,5 @@ -# -*- coding: utf-8 -*- -# © 2014-2016 Akretion (http://www.akretion.com) -# @author Mourad EL HADJ MIMOUNE +# Copyright 2014-2016 Akretion - Mourad EL HADJ MIMOUNE +# Copyright 2018 Tecnativa - Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo.addons.account.tests.account_test_classes\ @@ -143,8 +142,7 @@ class TestPayment(AccountingTestCase): invoice.action_invoice_open() return invoice - def create_check_deposit( - self, move_lines): + def create_check_deposit(self, move_lines): """ Returns an validated check deposit """ check_deposit = self.check_deposit_model.create({ 'journal_id': self.bank_journal.id, @@ -176,7 +174,7 @@ class TestPayment(AccountingTestCase): 'journal_id': self.check_journal.id, 'payment_method_id': self.payment_method_manual_in.id, }) - register_payments.create_payment() + register_payments.create_payments() payment = self.payment_model.search([], order="id desc", limit=1) self.assertAlmostEquals(payment.amount, 300) diff --git a/account_check_deposit/views/account_config_settings.xml b/account_check_deposit/views/account_config_settings.xml deleted file mode 100644 index 995e10a7f..000000000 --- a/account_check_deposit/views/account_config_settings.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - currency_rate_update.account_config_settings.form - account.config.settings - - -
-
-
-
-
-
-
-
- -
diff --git a/account_check_deposit/views/account_deposit_view.xml b/account_check_deposit/views/account_deposit_view.xml index 9e7ed8e9b..0851568ee 100644 --- a/account_check_deposit/views/account_deposit_view.xml +++ b/account_check_deposit/views/account_deposit_view.xml @@ -1,18 +1,15 @@ - - + - account.check.deposit.form account.check.deposit
@@ -138,5 +135,4 @@ parent="account.menu_finance_entries" sequence="20"/> - - + diff --git a/account_check_deposit/views/account_move_line_view.xml b/account_check_deposit/views/account_move_line_view.xml index 958589510..84635e024 100644 --- a/account_check_deposit/views/account_move_line_view.xml +++ b/account_check_deposit/views/account_move_line_view.xml @@ -1,37 +1,21 @@ - - + - - - account_check_deposit.view_move_line_form - account.move.line - - - - + + account.move.line + + + + + - - + - - account_check_deposit.view_move_line_form2 - account.move.line - - - - - - - - - - - + diff --git a/account_check_deposit/views/res_config_settings_views.xml b/account_check_deposit/views/res_config_settings_views.xml new file mode 100644 index 000000000..46d5f6a70 --- /dev/null +++ b/account_check_deposit/views/res_config_settings_views.xml @@ -0,0 +1,40 @@ + + + + + + res.config.settings.view.form.account_check_deposit + res.config.settings + + + +

Check Deposits

+
+
+
+
+
+
+
+
+
+
+
+
+ + + + +