diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c0682511d0..9801917242 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -30,7 +30,6 @@ exclude: | ^shopinvader_guest_mode/| ^shopinvader_image/| ^shopinvader_import_image/| - ^shopinvader_invoice/| ^shopinvader_lead/| ^shopinvader_locomotive/| ^shopinvader_locomotive_algolia/| diff --git a/setup/shopinvader_invoice/odoo/addons/shopinvader_invoice b/setup/shopinvader_invoice/odoo/addons/shopinvader_invoice new file mode 120000 index 0000000000..312bc4a004 --- /dev/null +++ b/setup/shopinvader_invoice/odoo/addons/shopinvader_invoice @@ -0,0 +1 @@ +../../../../shopinvader_invoice \ No newline at end of file diff --git a/setup/shopinvader_invoice/setup.py b/setup/shopinvader_invoice/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/shopinvader_invoice/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/shopinvader_invoice/__manifest__.py b/shopinvader_invoice/__manifest__.py index 72a13d48f2..4974575625 100644 --- a/shopinvader_invoice/__manifest__.py +++ b/shopinvader_invoice/__manifest__.py @@ -6,10 +6,10 @@ "author": "ACSONE SA/NV", "website": "https://github.com/shopinvader/odoo-shopinvader", "category": "shopinvader", - "version": "14.0.2.2.0", + "version": "16.0.1.0.0", "license": "AGPL-3", "depends": ["account", "shopinvader"], "data": [], "demo": [], - "installable": False, + "installable": True, } diff --git a/shopinvader_invoice/tests/common.py b/shopinvader_invoice/tests/common.py index cbc97d1285..5a6a218921 100644 --- a/shopinvader_invoice/tests/common.py +++ b/shopinvader_invoice/tests/common.py @@ -10,26 +10,26 @@ class CommonInvoiceCase(CommonCase): Common for invoice service """ - def setUp(self, *args, **kwargs): - super(CommonInvoiceCase, self).setUp(*args, **kwargs) - self.invoice_obj = self.env["account.move"] - self.journal_obj = self.env["account.journal"] - self.register_payments_obj = self.env["account.payment.register"] - self.sale = self.env.ref("shopinvader.sale_order_2") - self.partner = self.env.ref("shopinvader.partner_1") - self.partner2 = self.env.ref("shopinvader.partner_2") - self.product = self.env.ref("product.product_product_4") - self.bank_journal_euro = self.journal_obj.create( + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.invoice_obj = cls.env["account.move"] + cls.journal_obj = cls.env["account.journal"] + cls.register_payments_obj = cls.env["account.payment.register"] + cls.sale = cls.env.ref("shopinvader.sale_order_2") + cls.partner = cls.env.ref("shopinvader.partner_1") + cls.partner2 = cls.env.ref("shopinvader.partner_2") + cls.product = cls.env.ref("product.product_product_4") + cls.bank_journal_euro = cls.journal_obj.create( {"name": "Bank", "type": "bank", "code": "BNK67"} ) - self.payment_method_manual_in = self.env.ref( - "account.account_payment_method_manual_in" - ) - self.precision = 2 - with self.work_on_services(partner=self.partner) as work: - self.service = work.component(usage="invoices") - with self.work_on_services(partner=self.backend.anonymous_partner_id) as work: - self.service_guest = work.component(usage="invoice") + cls.precision = 2 + with cls.work_on_services(cls, partner=cls.partner) as work: + cls.service = work.component(usage="invoices") + with cls.work_on_services( + cls, partner=cls.backend.anonymous_partner_id + ) as work: + cls.service_guest = work.component(usage="invoice") def _check_data_content(self, data, invoices): """ @@ -103,12 +103,11 @@ def _make_payment(self, invoice, journal=False, amount=False): :return: bool """ ctx = {"active_model": invoice._name, "active_ids": invoice.ids} - wizard_obj = self.register_payments_obj.with_context(ctx) + wizard_obj = self.register_payments_obj.with_context(**ctx) register_payments = wizard_obj.create( { "payment_date": fields.Date.today(), "journal_id": self.bank_journal_euro.id, - "payment_method_id": self.payment_method_manual_in.id, } ) if journal: diff --git a/shopinvader_invoice/tests/test_invoice_service.py b/shopinvader_invoice/tests/test_invoice_service.py index b0721f8b90..14155e9c62 100644 --- a/shopinvader_invoice/tests/test_invoice_service.py +++ b/shopinvader_invoice/tests/test_invoice_service.py @@ -7,9 +7,10 @@ class TestInvoiceServiceAnonymous(CommonInvoiceCase): - def setUp(self, *args, **kwargs): - super(TestInvoiceServiceAnonymous, self).setUp(*args, **kwargs) - self.partner = self.env.ref("base.res_partner_2").copy() + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.partner = cls.env.ref("base.res_partner_2").copy() def test_get_invoice_anonymous(self): """ @@ -45,7 +46,6 @@ def _make_payment(self, invoice, journal=False, amount=False): { "payment_date": fields.Date.today(), "journal_id": self.bank_journal_euro.id, - "payment_method_id": self.payment_method_manual_in.id, } ) values = {}