diff --git a/purchase_rfq_number/README.rst b/purchase_rfq_number/README.rst index 1130a2c48a4..9057147f165 100644 --- a/purchase_rfq_number/README.rst +++ b/purchase_rfq_number/README.rst @@ -108,6 +108,7 @@ Contributors ------------ - Prapassorn Sornkaew +- Alejandro Parrales Other credits ------------- diff --git a/purchase_rfq_number/readme/CONTRIBUTORS.md b/purchase_rfq_number/readme/CONTRIBUTORS.md index 41b18773dc9..1e30248516f 100644 --- a/purchase_rfq_number/readme/CONTRIBUTORS.md +++ b/purchase_rfq_number/readme/CONTRIBUTORS.md @@ -1 +1,2 @@ - Prapassorn Sornkaew \ +- Alejandro Parrales \ \ No newline at end of file diff --git a/purchase_rfq_number/static/description/index.html b/purchase_rfq_number/static/description/index.html index 147de6c8498..e4a77b92fdc 100644 --- a/purchase_rfq_number/static/description/index.html +++ b/purchase_rfq_number/static/description/index.html @@ -457,6 +457,7 @@

Authors

Contributors

diff --git a/purchase_rfq_number/tests/test_purchase_order.py b/purchase_rfq_number/tests/test_purchase_order.py index d7bfbfedd8a..f9234f22909 100644 --- a/purchase_rfq_number/tests/test_purchase_order.py +++ b/purchase_rfq_number/tests/test_purchase_order.py @@ -1,11 +1,10 @@ # Copyright 2021 ProThai Technology Co.,Ltd. (http://prothaitechnology.com) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -from odoo.exceptions import UserError -from odoo.tests import TransactionCase +from odoo.addons.base.tests.common import BaseCommon -class TestPurchaseOrder(TransactionCase): +class TestPurchaseOrder(BaseCommon): @classmethod def setUpClass(cls): super().setUpClass() @@ -14,6 +13,7 @@ def setUpClass(cls): company = cls.env.company company.keep_name_po = False company.auto_attachment_rfq = True + cls.partner = cls.env["res.partner"].create({"name": "RFQ Number Test Partner"}) def test_enumeration(self): order1 = self.purchase_order_model.create({"partner_id": self.partner.id}) @@ -66,10 +66,10 @@ def test_error_confirmation_sequence(self): ] ) next_name = sequence_id.get_next_char(sequence_id.number_next_actual) - try: - order.button_confirm() - except UserError: # pylint: disable=except-pass - pass + # Re-confirming an already confirmed order is a no-op in core Odoo + # (it doesn't raise anymore since 19.0); it must not consume/advance + # the purchase order sequence either. + order.button_confirm() order.update({"state": "draft"}) # Now the RFQ can be confirmed order.button_confirm()