diff --git a/wms_connector/__manifest__.py b/wms_connector/__manifest__.py
index 5152e528fa7..50210a8e9bd 100644
--- a/wms_connector/__manifest__.py
+++ b/wms_connector/__manifest__.py
@@ -15,17 +15,10 @@
"data/cron.xml",
"data/ir_filters.xml",
"views/wms_product_sync.xml",
- "views/attachment_queue.xml",
"views/stock_picking.xml",
- "views/product_product.xml",
"views/stock_warehouse.xml",
],
"demo": [
- "demo/wms_product_sync.xml",
- "demo/attachment_queue.xml",
- "demo/stock_picking.xml",
- "demo/product_product.xml",
- "demo/stock_warehouse.xml",
"demo/storage_backend.xml",
],
}
diff --git a/wms_connector/data/ir_filters.xml b/wms_connector/data/ir_filters.xml
index 671652b1a2f..ed9946f7c77 100644
--- a/wms_connector/data/ir_filters.xml
+++ b/wms_connector/data/ir_filters.xml
@@ -21,7 +21,7 @@
]
- WMS: Default filter picking out
+ WMS: Default filter for picking out
stock.picking
[
("wms_export_date", "=", False),
diff --git a/wms_connector/demo/attachment_queue.xml b/wms_connector/demo/attachment_queue.xml
deleted file mode 100644
index 5d800853fbf..00000000000
--- a/wms_connector/demo/attachment_queue.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
diff --git a/wms_connector/demo/product_product.xml b/wms_connector/demo/product_product.xml
deleted file mode 100644
index 875bbb4cb41..00000000000
--- a/wms_connector/demo/product_product.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
diff --git a/wms_connector/demo/stock_picking.xml b/wms_connector/demo/stock_picking.xml
deleted file mode 100644
index f7f7f4a40bb..00000000000
--- a/wms_connector/demo/stock_picking.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
diff --git a/wms_connector/demo/stock_warehouse.xml b/wms_connector/demo/stock_warehouse.xml
deleted file mode 100644
index e188cff1e12..00000000000
--- a/wms_connector/demo/stock_warehouse.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
diff --git a/wms_connector/demo/wms_product_sync.xml b/wms_connector/demo/wms_product_sync.xml
deleted file mode 100644
index b0c8ad11813..00000000000
--- a/wms_connector/demo/wms_product_sync.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
-
-
-
-
diff --git a/wms_connector/models/stock_warehouse.py b/wms_connector/models/stock_warehouse.py
index eee11290ee8..45bc7f4c555 100644
--- a/wms_connector/models/stock_warehouse.py
+++ b/wms_connector/models/stock_warehouse.py
@@ -17,13 +17,13 @@
"name_fragment": "exports (products, awaiting receptions, preparation orders",
"code": "wh = env['stock.warehouse'].browse({0})\n"
"wh.{1}.scheduler_export("
- '"wms.product.sync", wh["wms_product_sync_filter_id"]._get_eval_domain()'
+ '"wms.product.sync", wh._wms_domain_for("wms_product_sync")'
")\n"
"wh.{1}.scheduler_export("
- '"stock.picking", wh["wms_export_picking_in_filter_id"]._get_eval_domain()'
+ '"stock.picking", wh._wms_domain_for("pickings_in")'
")\n"
"wh.{1}.scheduler_export("
- '"stock.picking", wh["wms_export_picking_out_filter_id"]._get_eval_domain()'
+ '"stock.picking", wh._wms_domain_for("pickings_out")'
")",
},
"reception": {
@@ -73,6 +73,15 @@ class StockWarehouse(models.Model):
)
wms_product_sync_ids = fields.One2many("wms.product.sync", "warehouse_id")
+ def _wms_domain_for(self, model_domain):
+ domains = {
+ "wms_product_sync": [("warehouse_id", "=", self.id)]
+ + self.wms_product_sync_filter_id._get_eval_domain(),
+ "pickings_in": self.wms_export_picking_in_filter_id._get_eval_domain(),
+ "pickings_out": self.wms_export_picking_out_filter_id._get_eval_domain(),
+ }
+ return domains[model_domain]
+
def _inverse_active_wms_sync(self):
for rec in self:
if rec.active_wms_sync:
@@ -138,9 +147,6 @@ def _deactivate_crons_tasks(self):
rec[mappings["fieldname_task"]].active = False
rec[mappings["fieldname_cron"]].active = False
- def action_open_flows(self):
- return {"type": "ir.action"}
-
def refresh_wms_products(self):
for rec in self:
prd_with_sync = self.wms_product_sync_ids.product_id
@@ -160,3 +166,45 @@ def refresh_wms_products(self):
("product_id", "in", (prd_with_sync - prd_matching).ids),
]
).unlink()
+
+ def button_open_wms_sync_ids(self):
+ return {
+ "name": "WMS synchronized products",
+ "view_mode": "tree,form",
+ "views": [
+ (self.env.ref("wms_connector.wms_product_sync_tree_view").id, "tree"),
+ (self.env.ref("wms_connector.wms_product_sync_form_view").id, "form"),
+ ],
+ "res_model": "wms.product.sync",
+ "type": "ir.actions.act_window",
+ "target": "current",
+ "domain": self._wms_domain_for("wms_product_sync"),
+ }
+
+ def button_open_wms_pickings_in(self):
+ return {
+ "name": "WMS synchronized transfers",
+ "view_mode": "tree,form",
+ "views": [
+ (False, "tree"),
+ (False, "form"),
+ ],
+ "res_model": "stock.picking",
+ "type": "ir.actions.act_window",
+ "target": "current",
+ "domain": self._wms_domain_for("pickings_in"),
+ }
+
+ def button_open_wms_pickings_out(self):
+ return {
+ "name": "WMS synchronized transfers",
+ "view_mode": "tree,form",
+ "views": [
+ (False, "tree"),
+ (False, "form"),
+ ],
+ "res_model": "stock.picking",
+ "type": "ir.actions.act_window",
+ "target": "current",
+ "domain": self._wms_domain_for("pickings_out"),
+ }
diff --git a/wms_connector/tests/test_import.py b/wms_connector/tests/test_import.py
deleted file mode 100644
index 49dc40d0ac2..00000000000
--- a/wms_connector/tests/test_import.py
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2023 Akretion
-# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
-
-from .common import WmsConnectorCase
-
-
-class TestImport(WmsConnectorCase):
- def setUp(self):
- super().setUp()
-
- def test_import_file(self):
- pass
diff --git a/wms_connector/views/attachment_queue.xml b/wms_connector/views/attachment_queue.xml
deleted file mode 100644
index 971144e31f7..00000000000
--- a/wms_connector/views/attachment_queue.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/wms_connector/views/product_product.xml b/wms_connector/views/product_product.xml
deleted file mode 100644
index 61753f5b22b..00000000000
--- a/wms_connector/views/product_product.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/wms_connector/views/stock_picking.xml b/wms_connector/views/stock_picking.xml
index 52b1360120d..122c9d6bc7c 100644
--- a/wms_connector/views/stock_picking.xml
+++ b/wms_connector/views/stock_picking.xml
@@ -3,14 +3,20 @@
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
-
-
-
-
-
-
-
-
+
+ stock.picking.form (in wms_connector)
+ stock.picking
+
+
+
+
+
diff --git a/wms_connector/views/stock_warehouse.xml b/wms_connector/views/stock_warehouse.xml
index 559f2fd962e..12b3e8e6b99 100644
--- a/wms_connector/views/stock_warehouse.xml
+++ b/wms_connector/views/stock_warehouse.xml
@@ -11,6 +11,31 @@
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
diff --git a/wms_connector/views/wms_product_sync.xml b/wms_connector/views/wms_product_sync.xml
index 58b7f4b9a37..e74ba17c971 100644
--- a/wms_connector/views/wms_product_sync.xml
+++ b/wms_connector/views/wms_product_sync.xml
@@ -26,29 +26,20 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+ wms.product.sync.tree (in wms_connector)
+ wms.product.sync
+
+
+
+
+
+
+
+
- Wms Product Sync
+ Wms Product Sync
wms.product.sync
tree,form
[]
@@ -57,7 +48,7 @@