diff --git a/stock_request_picking_type/__manifest__.py b/stock_request_picking_type/__manifest__.py index abba854be..8d868e7cb 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': '12.0.1.1.0', + 'version': '12.0.2.0.0', 'license': 'LGPL-3', 'website': 'https://github.com/stock-logistics-warehouse', 'author': 'Open Source Integrators, ' @@ -15,7 +15,7 @@ ], 'data': [ 'data/stock_picking_type.xml', - 'views/stock_request_views.xml', + 'views/stock_request_order_views.xml', 'views/stock_picking_views.xml', ], 'development_status': 'Beta', diff --git a/stock_request_picking_type/data/stock_picking_type.xml b/stock_request_picking_type/data/stock_picking_type.xml index 0c2bca50b..3876c66a4 100644 --- a/stock_request_picking_type/data/stock_picking_type.xml +++ b/stock_request_picking_type/data/stock_picking_type.xml @@ -1,10 +1,9 @@ - - + Stock Requests - - stock_request + + stock_request_order 0 diff --git a/stock_request_picking_type/migrations/12.0.2.0.0/pre-migration.py b/stock_request_picking_type/migrations/12.0.2.0.0/pre-migration.py new file mode 100644 index 000000000..2a9d38e06 --- /dev/null +++ b/stock_request_picking_type/migrations/12.0.2.0.0/pre-migration.py @@ -0,0 +1,14 @@ +# Copyright (C) 2019 Open Source Integrators +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). + + +def migrate(env, version): + if not version: + return + + env.execute("UPDATE stock_request_order " + "SET picking_type_id = (" + "SELECT id " + "FROM stock_picking_type " + "WHERE code = 'stock_request_order') " + "WHERE picking_type_id IS NULL;") diff --git a/stock_request_picking_type/models/__init__.py b/stock_request_picking_type/models/__init__.py index 1953de94f..bed61e447 100644 --- a/stock_request_picking_type/models/__init__.py +++ b/stock_request_picking_type/models/__init__.py @@ -1,5 +1,5 @@ # Copyright 2019 Open Source Integrators # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). -from . import stock_request +from . import stock_request_order from . import stock_picking_type diff --git a/stock_request_picking_type/models/stock_picking_type.py b/stock_request_picking_type/models/stock_picking_type.py index 66af76884..47fa48ea3 100644 --- a/stock_request_picking_type/models/stock_picking_type.py +++ b/stock_request_picking_type/models/stock_picking_type.py @@ -7,8 +7,8 @@ from odoo import fields, models class StockPickingType(models.Model): _inherit = 'stock.picking.type' - code = fields.Selection(selection_add=[('stock_request', - 'Stock Request')]) + code = fields.Selection(selection_add=[('stock_request_order', + 'Stock Request Order')]) count_sr_todo = fields.Integer(string="To Do", compute='_compute_sr_count') count_sr_open = fields.Integer(string="In Progress", @@ -17,7 +17,8 @@ class StockPickingType(models.Model): compute='_compute_sr_count') def _compute_sr_count(self): - types = self.filtered(lambda picking: picking.code == 'stock_request') + types = self.filtered( + lambda picking: picking.code == 'stock_request_order') if not types: return domains = { @@ -27,7 +28,7 @@ class StockPickingType(models.Model): ('state', 'in', ('submitted', 'open'))], } for field in domains: - data = self.env['stock.request'].read_group( + data = self.env['stock.request.order'].read_group( domains[field] + [('state', 'not in', ('done', 'cancel')), ('picking_type_id', 'in', self.ids)], @@ -38,6 +39,6 @@ class StockPickingType(models.Model): for record in types: record[field] = count.get(record.id, 0) - def get_stock_request_picking_type_action(self): + def get_stock_request_order_picking_type_action(self): return self._get_action( 'stock_request_picking_type.action_picking_dashboard') diff --git a/stock_request_picking_type/models/stock_request.py b/stock_request_picking_type/models/stock_request_order.py similarity index 82% rename from stock_request_picking_type/models/stock_request.py rename to stock_request_picking_type/models/stock_request_order.py index f37e82dd5..984aad6a6 100644 --- a/stock_request_picking_type/models/stock_request.py +++ b/stock_request_picking_type/models/stock_request_order.py @@ -4,13 +4,13 @@ from odoo import api, fields, models -class StockRequest(models.Model): - _inherit = 'stock.request' +class StockRequestOrder(models.Model): + _inherit = 'stock.request.order' @api.model def _get_default_picking_type(self): return self.env['stock.picking.type'].search([ - ('code', '=', 'stock_request'), + ('code', '=', 'stock_request_order'), ('warehouse_id.company_id', 'in', [self.env.context.get('company_id', self.env.user.company_id.id), False])], diff --git a/stock_request_picking_type/readme/DESCRIPTION.rst b/stock_request_picking_type/readme/DESCRIPTION.rst index 5d16cd18e..0173f58f4 100644 --- a/stock_request_picking_type/readme/DESCRIPTION.rst +++ b/stock_request_picking_type/readme/DESCRIPTION.rst @@ -1 +1 @@ -This module adds stock requests within the Inventory app with a new operation type. +This module adds stock request orders within the Inventory app with a new operation type. diff --git a/stock_request_picking_type/readme/USAGE.rst b/stock_request_picking_type/readme/USAGE.rst index e785e49f6..a2807118d 100644 --- a/stock_request_picking_type/readme/USAGE.rst +++ b/stock_request_picking_type/readme/USAGE.rst @@ -1,3 +1,3 @@ * Go to Inventory -* Click on the Stock Requests tile to process stock requests -* You can also go to Inventory > Operations > Stock Requests +* Click on the Stock Request Orders tile to process stock requests +* You can also go to Inventory > Operations > Stock Request Orders diff --git a/stock_request_picking_type/views/stock_picking_views.xml b/stock_request_picking_type/views/stock_picking_views.xml index 628041667..41f55ef1e 100644 --- a/stock_request_picking_type/views/stock_picking_views.xml +++ b/stock_request_picking_type/views/stock_picking_views.xml @@ -13,11 +13,11 @@ -
+
- +
@@ -30,7 +30,7 @@
@@ -80,7 +80,7 @@ New
@@ -100,16 +100,16 @@ - + Operation Types stock.picking.type - {"invisible": [("code", "=", "stock_request")]} + {"invisible": [("code", "=", "stock_request_order")]} - {"invisible": [("code", "=", "stock_request")]} + {"invisible": [("code", "=", "stock_request_order")]} diff --git a/stock_request_picking_type/views/stock_request_views.xml b/stock_request_picking_type/views/stock_request_order_views.xml similarity index 66% rename from stock_request_picking_type/views/stock_request_views.xml rename to stock_request_picking_type/views/stock_request_order_views.xml index 5ba1d9b5f..9b807c842 100644 --- a/stock_request_picking_type/views/stock_request_views.xml +++ b/stock_request_picking_type/views/stock_request_order_views.xml @@ -1,13 +1,11 @@ - - - stock.request.select - stock.request + + stock.request.order.select + stock.request.order - + - - @@ -25,28 +22,28 @@ - Stock Requests + Stock Request Orders ir.actions.act_window - stock.request + stock.request.order form tree,form - + [('picking_type_id', '=', active_id)] {'default_picking_type_id': active_id} - - Stock Requests + + Stock Request Orders ir.actions.act_window - stock.request + stock.request.order form form -