diff --git a/account_sequence_option/__manifest__.py b/account_sequence_option/__manifest__.py index 964c60afd..76f0946ab 100644 --- a/account_sequence_option/__manifest__.py +++ b/account_sequence_option/__manifest__.py @@ -10,7 +10,10 @@ "website": "https://github.com/OCA/account-financial-tools", "category": "Accounting", "depends": ["account", "base_sequence_option"], - "data": ["data/account_sequence_option.xml"], + "data": [ + "data/account_sequence_option.xml", + "views/account_move_views.xml", + ], "demo": ["demo/account_demo_options.xml"], "maintainers": ["kittiu"], "license": "LGPL-3", diff --git a/account_sequence_option/readme/CONTRIBUTORS.rst b/account_sequence_option/readme/CONTRIBUTORS.rst index 6ce956d96..2837571ca 100644 --- a/account_sequence_option/readme/CONTRIBUTORS.rst +++ b/account_sequence_option/readme/CONTRIBUTORS.rst @@ -1 +1,4 @@ * Kitti U. +* `Sygel `_: + + * Ángel García de la Chica Herrera diff --git a/account_sequence_option/tests/test_account_sequence_option.py b/account_sequence_option/tests/test_account_sequence_option.py index 1e061b200..1b94d70e4 100644 --- a/account_sequence_option/tests/test_account_sequence_option.py +++ b/account_sequence_option/tests/test_account_sequence_option.py @@ -1,6 +1,8 @@ # Copyright 2021 Ecosoft Co., Ltd. (http://ecosoft.co.th) # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). +from datetime import timedelta + from odoo import fields from odoo.tests.common import Form, TransactionCase, tagged @@ -72,3 +74,14 @@ class TestAccountSequenceOption(TransactionCase): self.payment = self._create_payment("outbound", "supplier") self.payment.action_post() self.assertIn("VPAY", self.payment.name) + # 7. Create out invoice, post invoice, reset invoice to Draft + # Change Date, post invoice. + self.invoice = self._create_invoice("out_invoice") + self.invoice.action_post() + old_name = self.invoice.name + self.invoice.button_draft() + self.invoice.write( + {"invoice_date": self.invoice.invoice_date - timedelta(days=1)} + ) + self.invoice.action_post() + self.assertEqual(old_name, self.invoice.name) diff --git a/account_sequence_option/views/account_move_views.xml b/account_sequence_option/views/account_move_views.xml new file mode 100644 index 000000000..c37ab1df9 --- /dev/null +++ b/account_sequence_option/views/account_move_views.xml @@ -0,0 +1,15 @@ + + + + + account_sequence_option_view_move_form + account.move + + + + + + + +