diff --git a/account_check_deposit/README.rst b/account_check_deposit/README.rst
index 00bf9f0b1..2ee129b2b 100644
--- a/account_check_deposit/README.rst
+++ b/account_check_deposit/README.rst
@@ -14,13 +14,13 @@ Account Check Deposit
: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/12.0/account_check_deposit
+ :target: https://github.com/OCA/account-financial-tools/tree/13.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-12-0/account-financial-tools-12-0-account_check_deposit
+ :target: https://translation.odoo-community.org/projects/account-financial-tools-13-0/account-financial-tools-13-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/12.0
+ :target: https://runbot.odoo-community.org/runbot/92/13.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -82,7 +82,7 @@ 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 `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -109,6 +109,10 @@ Contributors
* Pedro M. Baeza
+* `Ecosoft `__:
+
+ * Pimolnat Suntian
+
Maintainers
~~~~~~~~~~~
@@ -122,6 +126,6 @@ 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.
-This module is part of the `OCA/account-financial-tools `_ project on GitHub.
+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/models/account_deposit.py b/account_check_deposit/models/account_deposit.py
index 04c8f1ae2..aabc0ef17 100644
--- a/account_check_deposit/models/account_deposit.py
+++ b/account_check_deposit/models/account_deposit.py
@@ -9,8 +9,6 @@
from odoo import _, api, fields, models
from odoo.exceptions import UserError, ValidationError
-import odoo.addons.decimal_precision as dp
-
class AccountCheckDeposit(models.Model):
_name = "account.check.deposit"
@@ -112,14 +110,14 @@ class AccountCheckDeposit(models.Model):
string="Company",
required=True,
states={"done": [("readonly", "=", True)]},
- default=lambda self: self.env["res.company"]._company_default_get(),
+ default=lambda self: self.env.company,
)
total_amount = fields.Float(
compute="_compute_check_deposit",
string="Total Amount",
readonly=True,
store=True,
- digits=dp.get_precision("Account"),
+ digits="Account",
)
check_count = fields.Integer(
compute="_compute_check_deposit",
diff --git a/account_check_deposit/readme/CONTRIBUTORS.rst b/account_check_deposit/readme/CONTRIBUTORS.rst
index 21d67b3a9..200260459 100644
--- a/account_check_deposit/readme/CONTRIBUTORS.rst
+++ b/account_check_deposit/readme/CONTRIBUTORS.rst
@@ -8,3 +8,7 @@
* `Tecnativa `_:
* Pedro M. Baeza
+
+* `Ecosoft `__:
+
+ * Pimolnat Suntian
diff --git a/account_check_deposit/security/check_deposit_security.xml b/account_check_deposit/security/check_deposit_security.xml
index 1151b0ef9..1051eb453 100644
--- a/account_check_deposit/security/check_deposit_security.xml
+++ b/account_check_deposit/security/check_deposit_security.xml
@@ -8,8 +8,8 @@
Check Deposit multi-company
- ['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])]
+
+ ['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])]
+
diff --git a/account_check_deposit/static/description/index.html b/account_check_deposit/static/description/index.html
index cf25e5cd3..dac1345da 100644
--- a/account_check_deposit/static/description/index.html
+++ b/account_check_deposit/static/description/index.html
@@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-

+

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
@@ -429,7 +429,7 @@ deposit at the bank. Eventually, validate the deposit and print the report
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.
+feedback.
Do not contact contributors directly about support or help with technical issues.
@@ -455,6 +455,10 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
Pedro M. Baeza
+
Ecosoft:
+
@@ -464,7 +468,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
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.
-
This module is part of the OCA/account-financial-tools project on GitHub.
+
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/tests/test_check_deposit.py b/account_check_deposit/tests/test_check_deposit.py
index 2e330db28..d75a5cf7d 100644
--- a/account_check_deposit/tests/test_check_deposit.py
+++ b/account_check_deposit/tests/test_check_deposit.py
@@ -9,15 +9,12 @@ from odoo.addons.account.tests.account_test_classes import AccountingTestCase
class TestPayment(AccountingTestCase):
def setUp(self):
- super(TestPayment, self).setUp()
- self.register_payments_model = self.env["account.register.payments"]
+ super().setUp()
+ self.register_payments_model = self.env["account.payment.register"]
self.payment_model = self.env["account.payment"]
self.journal_model = self.env["account.journal"]
self.account_model = self.env["account.account"]
- self.invoice_model = self.env["account.invoice"]
- self.invoice_line_model = self.env["account.invoice.line"]
- self.acc_bank_stmt_model = self.env["account.bank.statement"]
- self.acc_bank_stmt_line_model = self.env["account.bank.statement.line"]
+ self.move_model = self.env["account.move"]
self.res_partner_bank_model = self.env["res.partner.bank"]
self.check_deposit_model = self.env["account.check.deposit"]
@@ -131,29 +128,27 @@ class TestPayment(AccountingTestCase):
def create_invoice(self, amount=100, inv_type="out_invoice", currency_id=None):
""" Returns an open invoice """
- invoice = self.invoice_model.create(
+ invoice = self.move_model.create(
{
+ "type": inv_type,
"partner_id": self.partner_agrolait.id,
"currency_id": currency_id,
- "name": inv_type == "out_invoice"
- and "invoice to client"
- or "invoice to supplier",
- "account_id": self.account_receivable.id,
- "type": inv_type,
- "date_invoice": time.strftime("%Y-%m-%d"),
+ "invoice_date": time.strftime("%Y-%m-%d"),
+ "date": time.strftime("%Y-%m-%d"),
+ "invoice_line_ids": [
+ (
+ 0,
+ 0,
+ {
+ "product_id": self.product.id,
+ "quantity": 1,
+ "price_unit": amount,
+ },
+ )
+ ],
}
)
- self.invoice_line_model.create(
- {
- "product_id": self.product.id,
- "quantity": 1,
- "price_unit": amount,
- "invoice_id": invoice.id,
- "name": "something",
- "account_id": self.account_revenue.id,
- }
- )
- invoice.action_invoice_open()
+ invoice.post()
return invoice
def create_check_deposit(self, move_lines):
@@ -177,12 +172,13 @@ class TestPayment(AccountingTestCase):
inv_1 = self.create_invoice(amount=100, currency_id=self.currency_eur_id)
inv_2 = self.create_invoice(amount=200, currency_id=self.currency_eur_id)
- ctx = {"active_model": "account.invoice", "active_ids": [inv_1.id, inv_2.id]}
+ ctx = {"active_model": "account.move", "active_ids": [inv_1.id, inv_2.id]}
register_payments = self.register_payments_model.with_context(ctx).create(
{
"payment_date": time.strftime("%Y-%m-%d"),
"journal_id": self.check_journal.id,
"payment_method_id": self.payment_method_manual_in.id,
+ "group_payment": True,
}
)
register_payments.create_payments()
@@ -190,8 +186,8 @@ class TestPayment(AccountingTestCase):
self.assertAlmostEquals(payment.amount, 300)
self.assertEqual(payment.state, "posted")
- self.assertEqual(inv_1.state, "paid")
- self.assertEqual(inv_2.state, "paid")
+ self.assertEqual(inv_1.state, "posted")
+ self.assertEqual(inv_2.state, "posted")
check_aml = payment.move_line_ids.filtered(
lambda r: r.account_id == self.received_check_account_id
diff --git a/setup/account_check_deposit/odoo/addons/account_check_deposit b/setup/account_check_deposit/odoo/addons/account_check_deposit
new file mode 120000
index 000000000..2fdb66035
--- /dev/null
+++ b/setup/account_check_deposit/odoo/addons/account_check_deposit
@@ -0,0 +1 @@
+../../../../account_check_deposit
\ No newline at end of file
diff --git a/setup/account_check_deposit/setup.py b/setup/account_check_deposit/setup.py
new file mode 100644
index 000000000..28c57bb64
--- /dev/null
+++ b/setup/account_check_deposit/setup.py
@@ -0,0 +1,6 @@
+import setuptools
+
+setuptools.setup(
+ setup_requires=['setuptools-odoo'],
+ odoo_addon=True,
+)