diff --git a/stock_request_picking_type/README.rst b/stock_request_picking_type/README.rst index 443e71982..eef754900 100644 --- a/stock_request_picking_type/README.rst +++ b/stock_request_picking_type/README.rst @@ -25,7 +25,7 @@ Stock Request Picking Type |badge1| |badge2| |badge3| |badge4| |badge5| -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. **Table of contents** @@ -36,8 +36,8 @@ Usage ===== * 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 Bug Tracker =========== diff --git a/stock_request_picking_type/__manifest__.py b/stock_request_picking_type/__manifest__.py index bccedbc55..54d256284 100644 --- a/stock_request_picking_type/__manifest__.py +++ b/stock_request_picking_type/__manifest__.py @@ -4,18 +4,18 @@ { 'name': 'Stock Request Picking Type', 'summary': 'Add Stock Requests to the Inventory App', - 'version': '12.0.1.0.0', + 'version': '12.0.2.0.0', 'license': 'LGPL-3', 'website': 'https://github.com/stock-logistics-warehouse', 'author': 'Open Source Integrators, ' 'Odoo Community Association (OCA)', 'category': 'Warehouse Management', 'depends': [ - 'stock_request', + 'stock_request_submit', ], '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/i18n/stock_request_picking_type.pot b/stock_request_picking_type/i18n/stock_request_picking_type.pot index e271851d0..589537703 100644 --- a/stock_request_picking_type/i18n/stock_request_picking_type.pot +++ b/stock_request_picking_type/i18n/stock_request_picking_type.pot @@ -40,34 +40,29 @@ msgstr "" #. module: stock_request_picking_type #: model_terms:ir.ui.view,arch_db:stock_request_picking_type.stock_request_type_kanban -#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_filter +#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_order_filter msgid "Done" msgstr "" #. module: stock_request_picking_type -#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.stock_request_type_kanban -msgid "Draft" -msgstr "" - -#. module: stock_request_picking_type -#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_filter +#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_order_filter msgid "Expected Date" msgstr "" #. module: stock_request_picking_type -#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_filter +#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_order_filter msgid "Expected Date by Month" msgstr "" #. module: stock_request_picking_type -#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_filter +#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_order_filter msgid "Group By..." msgstr "" #. module: stock_request_picking_type #: model:ir.model.fields,field_description:stock_request_picking_type.field_stock_picking_type__count_sr_open #: model_terms:ir.ui.view,arch_db:stock_request_picking_type.stock_request_type_kanban -#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_filter +#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_order_filter msgid "In Progress" msgstr "" @@ -79,12 +74,12 @@ msgstr "" #. module: stock_request_picking_type #: model:ir.model.fields,field_description:stock_request_picking_type.field_stock_picking_type__count_sr_late #: model_terms:ir.ui.view,arch_db:stock_request_picking_type.stock_request_type_kanban -#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_filter +#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_order_filter msgid "Late" msgstr "" #. module: stock_request_picking_type -#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_filter +#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_order_filter msgid "Late Stock Requests" msgstr "" @@ -94,7 +89,7 @@ msgid "Manufacturing Operation" msgstr "" #. module: stock_request_picking_type -#: model:ir.model.fields,field_description:stock_request_picking_type.field_stock_request__picking_type_id +#: model:ir.model.fields,field_description:stock_request_picking_type.field_stock_request_order__picking_type_id msgid "Operation Type" msgstr "" @@ -104,13 +99,8 @@ msgid "Picking Type" msgstr "" #. module: stock_request_picking_type -#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_filter -msgid "Product" -msgstr "" - -#. module: stock_request_picking_type -#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_filter -msgid "Search Stock Request" +#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_order_filter +msgid "Search Stock Request Orders" msgstr "" #. module: stock_request_picking_type @@ -119,38 +109,43 @@ msgid "Settings" msgstr "" #. module: stock_request_picking_type -#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_filter +#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_order_filter msgid "State" msgstr "" #. module: stock_request_picking_type -#: model:ir.model,name:stock_request_picking_type.model_stock_request +#: model:ir.model,name:stock_request_picking_type.model_stock_request_order #: model_terms:ir.ui.view,arch_db:stock_request_picking_type.stock_request_type_kanban #: selection:stock.picking.type,code:0 -msgid "Stock Request" -msgstr "" - -#. module: stock_request_picking_type -#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_filter -msgid "Stock Requesta in Progress." +msgid "Stock Request Order" msgstr "" #. module: stock_request_picking_type #: model:ir.actions.act_window,name:stock_request_picking_type.action_picking_dashboard -#: model:ir.actions.act_window,name:stock_request_picking_type.action_stock_request_form -#: model:ir.ui.menu,name:stock_request_picking_type.menu_stock_request -#: model:stock.picking.type,name:stock_request_picking_type.stock_request +#: model:ir.actions.act_window,name:stock_request_picking_type.action_stock_request_order_form +#: model:ir.ui.menu,name:stock_request_picking_type.menu_stock_request_order +msgid "Stock Request Orders" +msgstr "" + +#. module: stock_request_picking_type +#: model:stock.picking.type,name:stock_request_picking_type.stock_request_order msgid "Stock Requests" msgstr "" #. module: stock_request_picking_type -#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_filter -msgid "Stock Requests in draft." +#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_order_filter +msgid "Stock Requests To Do." +msgstr "" + +#. module: stock_request_picking_type +#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_order_filter +msgid "Stock Requests in Progress." msgstr "" #. module: stock_request_picking_type #: model:ir.model.fields,field_description:stock_request_picking_type.field_stock_picking_type__count_sr_todo -#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_filter +#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.stock_request_type_kanban +#: model_terms:ir.ui.view,arch_db:stock_request_picking_type.view_stock_request_order_filter msgid "To Do" msgstr "" diff --git a/stock_request_picking_type/migrations/12.0.2.0.0/post-migration.py b/stock_request_picking_type/migrations/12.0.2.0.0/post-migration.py new file mode 100644 index 000000000..2a9d38e06 --- /dev/null +++ b/stock_request_picking_type/migrations/12.0.2.0.0/post-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 9c7eb4a13..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,17 +17,18 @@ 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 = { - 'count_sr_todo': [('state', '=', 'draft')], + 'count_sr_todo': [('state', '=', 'submitted')], 'count_sr_open': [('state', '=', 'open')], 'count_sr_late': [('expected_date', '<', fields.Date.today()), - ('state', 'in', ('draft', 'open'))], + ('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/static/description/index.html b/stock_request_picking_type/static/description/index.html index 75ca00260..d09b4d05d 100644 --- a/stock_request_picking_type/static/description/index.html +++ b/stock_request_picking_type/static/description/index.html @@ -368,7 +368,7 @@ ul.auto-toc { !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Beta License: LGPL-3 OCA/stock-logistics-warehouse Translate me on Weblate Try me on Runbot

-

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.

Table of contents

    @@ -386,8 +386,8 @@ ul.auto-toc {

    Usage

    • 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 01e9a511e..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 @@
@@ -66,7 +66,7 @@ All
- Draft + To Do
In Progress @@ -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 58% rename from stock_request_picking_type/views/stock_request_views.xml rename to stock_request_picking_type/views/stock_request_order_views.xml index fff0146fe..9b807c842 100644 --- a/stock_request_picking_type/views/stock_request_views.xml +++ b/stock_request_picking_type/views/stock_request_order_views.xml @@ -1,22 +1,19 @@ - - - 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 -