From c1c9a9df9250564c675c2157ea47ae8e3af46454 Mon Sep 17 00:00:00 2001 From: Antoni Marroig Campomar Date: Mon, 17 Jun 2024 08:19:06 +0200 Subject: [PATCH] [MIG] stock_request_picking_type: Migration to 17.0 --- stock_request_picking_type/__manifest__.py | 2 +- .../models/stock_picking_type.py | 12 +- .../views/stock_picking_views.xml | 370 +++++++++--------- .../views/stock_request_order_views.xml | 2 +- 4 files changed, 206 insertions(+), 180 deletions(-) diff --git a/stock_request_picking_type/__manifest__.py b/stock_request_picking_type/__manifest__.py index 21ce674f..bfd819d2 100644 --- a/stock_request_picking_type/__manifest__.py +++ b/stock_request_picking_type/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Stock Request Picking Type", "summary": "Add Stock Requests to the Inventory App", - "version": "16.0.1.0.0", + "version": "17.0.1.0.0", "license": "LGPL-3", "website": "https://github.com/OCA/stock-logistics-request", "author": "Open Source Integrators, Odoo Community Association (OCA)", diff --git a/stock_request_picking_type/models/stock_picking_type.py b/stock_request_picking_type/models/stock_picking_type.py index 0f5063e7..85e8e174 100644 --- a/stock_request_picking_type/models/stock_picking_type.py +++ b/stock_request_picking_type/models/stock_picking_type.py @@ -1,7 +1,7 @@ # Copyright 2019 Open Source Integrators # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). -from odoo import fields, models +from odoo import api, fields, models class StockPickingType(models.Model): @@ -45,3 +45,13 @@ def _compute_sr_count(self): def get_stock_request_order_picking_type_action(self): return self._get_action("stock_request_picking_type.action_picking_dashboard") + + @api.depends("code") + def _compute_show_picking_type(self): + for record in self: + record.show_picking_type = record.code in [ + "incoming", + "outgoing", + "internal", + "stock_request_order", + ] diff --git a/stock_request_picking_type/views/stock_picking_views.xml b/stock_request_picking_type/views/stock_picking_views.xml index 98d4ce19..325d8f37 100644 --- a/stock_request_picking_type/views/stock_picking_views.xml +++ b/stock_request_picking_type/views/stock_picking_views.xml @@ -1,5 +1,4 @@ - stock.picking.type.kanban stock.picking.type @@ -10,189 +9,206 @@ - + + + All + + + All + + + + + To Do + + + Ready + + + + + In Progress + + + Waiting + + + + + Done + + + Operations + + + +
+ +
+
+ + + + + + + + + + + + +
+
+
+
+
+ + + + + +
+ +
-
-
-
- - - -
- -
-
-
- - - -
-
-
-
-
- -
-
-
- -
- -
-
-
- -
- -
-
-
-
-
- + + Late +
-
-
- - - Operation Types - stock.picking.type - - - +
{"invisible": [("code", "=", "stock_request_order")]} - - - {"invisible": [("code", "=", "stock_request_order")]} - + name="t-if" + >code == "stock_request_order" and record.count_picking_backorders.raw_value > 0 +
-
diff --git a/stock_request_picking_type/views/stock_request_order_views.xml b/stock_request_picking_type/views/stock_request_order_views.xml index 73b653c0..9b132a1e 100644 --- a/stock_request_picking_type/views/stock_request_order_views.xml +++ b/stock_request_picking_type/views/stock_request_order_views.xml @@ -26,7 +26,7 @@ name="picking_type_id" domain="[('code', '=', 'stock_request_order')]" context="{'default_code': 'stock_request_order'}" - attrs="{'readonly': [('state', '!=', 'draft')]}" + readonly="state != 'draft'" />