From 456788790737a22ea03e297ce93110e1ae9d908f Mon Sep 17 00:00:00 2001 From: Maxime Chambreuil Date: Tue, 28 May 2019 08:59:38 -0500 Subject: [PATCH 1/7] [IMP] stock_request_picking_type: Use Submitted state --- stock_request_picking_type/models/stock_picking_type.py | 4 ++-- stock_request_picking_type/views/stock_picking_views.xml | 2 +- stock_request_picking_type/views/stock_request_views.xml | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/stock_request_picking_type/models/stock_picking_type.py b/stock_request_picking_type/models/stock_picking_type.py index 9c7eb4a13..66af76884 100644 --- a/stock_request_picking_type/models/stock_picking_type.py +++ b/stock_request_picking_type/models/stock_picking_type.py @@ -21,10 +21,10 @@ class StockPickingType(models.Model): 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( diff --git a/stock_request_picking_type/views/stock_picking_views.xml b/stock_request_picking_type/views/stock_picking_views.xml index 01e9a511e..628041667 100644 --- a/stock_request_picking_type/views/stock_picking_views.xml +++ b/stock_request_picking_type/views/stock_picking_views.xml @@ -66,7 +66,7 @@ All
- Draft + To Do
In Progress diff --git a/stock_request_picking_type/views/stock_request_views.xml b/stock_request_picking_type/views/stock_request_views.xml index fff0146fe..5ba1d9b5f 100644 --- a/stock_request_picking_type/views/stock_request_views.xml +++ b/stock_request_picking_type/views/stock_request_views.xml @@ -8,11 +8,11 @@ - + - + From 4fc65724b79d7f6fd53d4171dc4bd47f5a11cd83 Mon Sep 17 00:00:00 2001 From: Maxime Chambreuil Date: Tue, 28 May 2019 09:19:24 -0500 Subject: [PATCH 2/7] [IMP] Bump version --- stock_request_picking_type/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stock_request_picking_type/__manifest__.py b/stock_request_picking_type/__manifest__.py index bccedbc55..abba854be 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.0.0', + 'version': '12.0.1.1.0', 'license': 'LGPL-3', 'website': 'https://github.com/stock-logistics-warehouse', 'author': 'Open Source Integrators, ' From 20f404421cd0cf4e3e5d5f78c13094d6125aa7dc Mon Sep 17 00:00:00 2001 From: Maxime Chambreuil Date: Mon, 8 Jul 2019 20:03:20 -0500 Subject: [PATCH 3/7] [FIX] stock_request_picking_type --- stock_request_picking_type/__manifest__.py | 4 +-- .../data/stock_picking_type.xml | 7 ++--- .../migrations/12.0.2.0.0/pre-migration.py | 14 +++++++++ stock_request_picking_type/models/__init__.py | 2 +- .../models/stock_picking_type.py | 11 +++---- ...tock_request.py => stock_request_order.py} | 6 ++-- .../readme/DESCRIPTION.rst | 2 +- stock_request_picking_type/readme/USAGE.rst | 4 +-- .../views/stock_picking_views.xml | 14 ++++----- ...iews.xml => stock_request_order_views.xml} | 29 +++++++++---------- 10 files changed, 52 insertions(+), 41 deletions(-) create mode 100644 stock_request_picking_type/migrations/12.0.2.0.0/pre-migration.py rename stock_request_picking_type/models/{stock_request.py => stock_request_order.py} (82%) rename stock_request_picking_type/views/{stock_request_views.xml => stock_request_order_views.xml} (66%) 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 - From b08f7b3c916a08303a268f62e05f98185fd56f10 Mon Sep 17 00:00:00 2001 From: Maxime Chambreuil Date: Mon, 8 Jul 2019 23:55:04 -0500 Subject: [PATCH 4/7] [REN] stock_request_picking_type: migration script --- .../migrations/12.0.2.0.0/{pre-migration.py => post-migration.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename stock_request_picking_type/migrations/12.0.2.0.0/{pre-migration.py => post-migration.py} (100%) 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/post-migration.py similarity index 100% rename from stock_request_picking_type/migrations/12.0.2.0.0/pre-migration.py rename to stock_request_picking_type/migrations/12.0.2.0.0/post-migration.py From dbf3b362f6e60050a2ff3a7b12bbdfccdb09d249 Mon Sep 17 00:00:00 2001 From: Maxime Chambreuil Date: Fri, 9 Aug 2019 12:46:09 -0500 Subject: [PATCH 5/7] [FIX] stock_request_picking_type: Depends on stock_request_submit --- stock_request_picking_type/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stock_request_picking_type/__manifest__.py b/stock_request_picking_type/__manifest__.py index 8d868e7cb..54d256284 100644 --- a/stock_request_picking_type/__manifest__.py +++ b/stock_request_picking_type/__manifest__.py @@ -11,7 +11,7 @@ 'Odoo Community Association (OCA)', 'category': 'Warehouse Management', 'depends': [ - 'stock_request', + 'stock_request_submit', ], 'data': [ 'data/stock_picking_type.xml', From e383a35f4d4d2a5010493c74e49b582886cb3b52 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Tue, 13 Aug 2019 14:55:42 +0000 Subject: [PATCH 6/7] [UPD] Update stock_request_picking_type.pot --- .../i18n/stock_request_picking_type.pot | 63 +++++++++---------- 1 file changed, 29 insertions(+), 34 deletions(-) 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 "" From 5918fa8c7c65d9a24e6ab5aa977f7bd2717c2e46 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Tue, 13 Aug 2019 15:49:56 +0000 Subject: [PATCH 7/7] [UPD] README.rst --- stock_request_picking_type/README.rst | 6 +++--- stock_request_picking_type/static/description/index.html | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) 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/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