Skip to content

Commit

Permalink
[MIG] shopinvader_invoice -> shopinvader_restapi_invoice: Migration t…
Browse files Browse the repository at this point in the history
…o 16.0
  • Loading branch information
qgroulard committed Oct 20, 2023
1 parent c7c22bf commit 697d1e5
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 24 deletions.
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ exclude: |
^shopinvader_elasticsearch/|
^shopinvader_guest_mode/|
^shopinvader_import_image/|
^shopinvader_invoice/|
^shopinvader_lead/|
^shopinvader_locomotive/|
^shopinvader_locomotive_algolia/|
Expand Down
6 changes: 6 additions & 0 deletions setup/shopinvader_restapi_invoice/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Copyright 2019 ACSONE SA/NV (<http://acsone.eu>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Shopinvader Invoice",
"summary": """Shopinvader Invoice module""",
"name": "Shopinvader Restapi Invoice",
"summary": """Shopinvader Restapi Invoice module""",
"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"],
"depends": ["account", "shopinvader_restapi"],
"data": [],
"demo": [],
"installable": False,
"installable": True,
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,31 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields

from odoo.addons.shopinvader.tests.common import CommonCase
from odoo.addons.shopinvader_restapi.tests.common import CommonCase


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_restapi.sale_order_2")
cls.partner = cls.env.ref("shopinvader_restapi.partner_1")
cls.partner2 = cls.env.ref("shopinvader_restapi.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
cls.precision = 2

def setUp(self, *args, **kwargs):
super().setUp(*args, **kwargs)
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:
Expand Down Expand Up @@ -103,12 +104,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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,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 = {}
Expand Down

0 comments on commit 697d1e5

Please sign in to comment.