diff --git a/stock_request_picking_type/README.rst b/stock_request_picking_type/README.rst index eef754900..98358fdf7 100644 --- a/stock_request_picking_type/README.rst +++ b/stock_request_picking_type/README.rst @@ -14,13 +14,13 @@ Stock Request Picking Type :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html :alt: License: LGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github - :target: https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_request_picking_type + :target: https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_request_picking_type :alt: OCA/stock-logistics-warehouse .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_request_picking_type + :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-13-0/stock-logistics-warehouse-13-0-stock_request_picking_type :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/153/12.0 + :target: https://runbot.odoo-community.org/runbot/153/13.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -45,7 +45,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -61,6 +61,8 @@ Contributors ~~~~~~~~~~~~ * Maxime Chambreuil +* Pimolnat Suntian +* Raphael Lee Maintainers ~~~~~~~~~~~ @@ -83,6 +85,6 @@ Current `maintainer `__: |maintainer-max3903| -This module is part of the `OCA/stock-logistics-warehouse `_ project on GitHub. +This module is part of the `OCA/stock-logistics-warehouse `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/stock_request_picking_type/__manifest__.py b/stock_request_picking_type/__manifest__.py index fd70e5e8e..f7ee2f6b4 100644 --- a/stock_request_picking_type/__manifest__.py +++ b/stock_request_picking_type/__manifest__.py @@ -7,9 +7,9 @@ "version": "13.0.1.0.0", "license": "LGPL-3", "website": "https://github.com/stock-logistics-warehouse", - "author": "Open Source Integrators, " "Odoo Community Association (OCA)", + "author": "Open Source Integrators, Odoo Community Association (OCA)", "category": "Warehouse", - "depends": ["stock_request_submit"], + "depends": ["stock_request"], "data": [ "data/stock_picking_type.xml", "views/stock_request_order_views.xml", diff --git a/stock_request_picking_type/data/stock_picking_type.xml b/stock_request_picking_type/data/stock_picking_type.xml index 8351114ea..136e087d2 100644 --- a/stock_request_picking_type/data/stock_picking_type.xml +++ b/stock_request_picking_type/data/stock_picking_type.xml @@ -3,6 +3,6 @@ Stock Requests stock_request_order - 0 + SRO diff --git a/stock_request_picking_type/models/stock_picking_type.py b/stock_request_picking_type/models/stock_picking_type.py index 3e118f19c..f1067c24c 100644 --- a/stock_request_picking_type/models/stock_picking_type.py +++ b/stock_request_picking_type/models/stock_picking_type.py @@ -15,9 +15,6 @@ class StockPickingType(models.Model): count_sr_late = fields.Integer(string="Late", compute="_compute_sr_count") def _compute_sr_count(self): - types = self.filtered(lambda picking: picking.code == "stock_request_order") - if not types: - return domains = { "count_sr_todo": [("state", "=", "submitted")], "count_sr_open": [("state", "=", "open")], @@ -41,7 +38,7 @@ class StockPickingType(models.Model): and x["picking_type_id"][0]: x["picking_type_id_count"] for x in data } - for record in types: + for record in self: record[field] = count.get(record.id, 0) def get_stock_request_order_picking_type_action(self): diff --git a/stock_request_picking_type/models/stock_request_order.py b/stock_request_picking_type/models/stock_request_order.py index f1e11a91d..366ec32ff 100644 --- a/stock_request_picking_type/models/stock_request_order.py +++ b/stock_request_picking_type/models/stock_request_order.py @@ -9,21 +9,16 @@ class StockRequestOrder(models.Model): @api.model def _get_default_picking_type(self): + companies = self._context.get("allowed_company_ids", []).copy() + companies.append(False) return ( self.env["stock.picking.type"] .search( [ ("code", "=", "stock_request_order"), - ( - "warehouse_id.company_id", - "in", - [ - self.env.context.get( - "company_id", self.env.user.company_id.id - ), - False, - ], - ), + "|", + ("warehouse_id.company_id", "in", companies), + ("warehouse_id", "=", False), ], limit=1, ) @@ -31,8 +26,8 @@ class StockRequestOrder(models.Model): ) picking_type_id = fields.Many2one( - "stock.picking.type", - "Operation Type", + comodel_name="stock.picking.type", + string="Operation Type", default=_get_default_picking_type, required=True, ) diff --git a/stock_request_picking_type/readme/CONTRIBUTORS.rst b/stock_request_picking_type/readme/CONTRIBUTORS.rst index ab792860d..e2a84a062 100644 --- a/stock_request_picking_type/readme/CONTRIBUTORS.rst +++ b/stock_request_picking_type/readme/CONTRIBUTORS.rst @@ -1 +1,3 @@ * Maxime Chambreuil +* Pimolnat Suntian +* Raphael Lee diff --git a/stock_request_picking_type/static/description/icon.png b/stock_request_picking_type/static/description/icon.png index c31ecfd9f..d4f6a65ac 100644 Binary files a/stock_request_picking_type/static/description/icon.png and b/stock_request_picking_type/static/description/icon.png differ diff --git a/stock_request_picking_type/static/description/index.html b/stock_request_picking_type/static/description/index.html index d09b4d05d..13822a105 100644 --- a/stock_request_picking_type/static/description/index.html +++ b/stock_request_picking_type/static/description/index.html @@ -367,7 +367,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

+

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

This module adds stock request orders within the Inventory app with a new operation type.

Table of contents

@@ -395,7 +395,7 @@ ul.auto-toc {

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -410,6 +410,8 @@ If you spotted it first, help us smashing it by providing a detailed and welcome

Contributors

@@ -421,7 +423,7 @@ mission is to support the collaborative development of Odoo features and promote its widespread use.

Current maintainer:

max3903

-

This module is part of the OCA/stock-logistics-warehouse project on GitHub.

+

This module is part of the OCA/stock-logistics-warehouse project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

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 ab8fcbedf..93105b7b9 100644 --- a/stock_request_picking_type/views/stock_request_order_views.xml +++ b/stock_request_picking_type/views/stock_request_order_views.xml @@ -1,55 +1,41 @@ - - stock.request.order.select + + stock.request.order.search stock.request.order + - - + - + + + + stock.request.order.form.picking.type + stock.request.order + + + + - - - - - - - + Stock Request Orders ir.actions.act_window stock.request.order - form tree,form - + [('picking_type_id', '=', active_id)] {'default_picking_type_id': active_id} @@ -57,7 +43,6 @@ Stock Request Orders ir.actions.act_window stock.request.order - form form