-
-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
122 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<!-- Copyright 2023 Akretion | ||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). --> | ||
<odoo> | ||
|
||
<record model="storage.backend" id="demo_wms_backend"> | ||
<field name="name">Demo WMS backend</field> | ||
<field name="directory_path">/</field> | ||
</record> | ||
|
||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,4 @@ def _run_wms_reception_confirmed(self): | |
|
||
def _run_wms_delivery_confirmed(self): | ||
raise NotImplementedError | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,4 @@ def scheduler_export(self, model, domain=False): | |
("delivery_confirmed", "Delivery confirmed"), | ||
] | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,4 @@ | ||
from . import test_sync | ||
from . import test_activate_sync | ||
from . import test_export_records | ||
from . import test_export_file | ||
from . import test_import |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Copyright 2023 Akretion | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo.tests.common import TransactionCase | ||
import uuid | ||
from odoo_test_helper import FakeModelLoader | ||
|
||
|
||
class WmsConnectorCommon(TransactionCase): | ||
|
||
@classmethod | ||
def setUpClass(cls): | ||
super().setUpClass() | ||
cls.backend = cls.env.ref("wms_connector.demo_wms_backend") | ||
cls.backend.directory_path = str(uuid.uuid1()) + "/" | ||
# cls.loader = FakeModelLoader(cls.env, cls.__module__) | ||
# cls.loader.backup_registry() | ||
# | ||
# from .model import ResUsers | ||
# | ||
# cls.loader.update_registry((AttachmentSynchronizeTask,)) | ||
|
||
def tearDown(self): | ||
super().tearDown() | ||
files = self.backend.list_files("OUT/") | ||
for f in files: | ||
self.backend.delete("OUT/" + f) | ||
|
||
@classmethod | ||
def tearDownClass(cls): | ||
# cls.loader.restore_registry() | ||
super().tearDownClass() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright 2023 Akretion | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import models | ||
|
||
|
||
# class ResUsers(models.Model): | ||
# _inherit = ["res.users", "synchronize.exportable.mixin", "synchronize.importable.mixin"] | ||
# | ||
# def _prepare_export_data(self): | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Copyright 2023 Akretion | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo.tests.common import TransactionCase | ||
|
||
|
||
class TestActivateSync(TransactionCase): | ||
def setUp(self): | ||
super().setUp() | ||
self.warehouse = self.env.ref("stock.warehouse0") | ||
|
||
def test_active_deactivate_wms_sync(self): | ||
self.warehouse.active_wms_sync = True | ||
for field in ( | ||
"wms_export_cron_id", | ||
"wms_import_confirm_reception_cron_id", | ||
"wms_import_confirm_delivery_cron_id", | ||
): | ||
self.assertTrue(getattr(self, field)) | ||
self.warehouse.active_wms_sync = False | ||
for field in ( | ||
"wms_export_cron_id", | ||
"wms_import_confirm_reception_cron_id", | ||
"wms_import_confirm_delivery_cron_id", | ||
): | ||
self.assertFalse(getattr(self, field).active) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright 2023 Akretion | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo.tests.common import TransactionCase | ||
|
||
|
||
class TestExportFile(TransactionCase): | ||
|
||
def setUp(self): | ||
super().setUp() | ||
self.warehouse = self.env.ref("stock.warehouse0") | ||
self.warehouse.active_wms_sync = True | ||
|
||
def test_run_export_cron(self): | ||
self.warehouse.wms_export_cron_id.run() | ||
pass | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Copyright 2023 Akretion | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo.tests.common import TransactionCase | ||
|
||
|
||
class TestImport(TransactionCase): | ||
|
||
def setUp(self): | ||
super().setUp() | ||
|
||
def test_import_file(self): | ||
pass |
This file was deleted.
Oops, something went wrong.