From e6befe278b69a7739d5e5c9ae5695d236460db41 Mon Sep 17 00:00:00 2001 From: ps-tubtim Date: Tue, 20 Oct 2020 17:13:26 +0700 Subject: [PATCH] [MIG] stock_orderpoint_manual_procurement_uom: Migration to 13.0 --- .../README.rst | 15 ++++++++------- .../__manifest__.py | 2 +- .../models/stock_warehouse_orderpoint.py | 3 +-- .../readme/CONTRIBUTORS.rst | 3 ++- .../static/description/index.html | 11 ++++++----- .../test_stock_orderpoint_manual_procurement.py | 10 +++++----- 6 files changed, 23 insertions(+), 21 deletions(-) diff --git a/stock_orderpoint_manual_procurement_uom/README.rst b/stock_orderpoint_manual_procurement_uom/README.rst index 411613789..8409a7eac 100644 --- a/stock_orderpoint_manual_procurement_uom/README.rst +++ b/stock_orderpoint_manual_procurement_uom/README.rst @@ -14,13 +14,13 @@ Stock Orderpoint Manual Procurement UoM :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-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_orderpoint_manual_procurement_uom + :target: https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_orderpoint_manual_procurement_uom :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_orderpoint_manual_procurement_uom + :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-13-0/stock-logistics-warehouse-13-0-stock_orderpoint_manual_procurement_uom :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. @@ -55,14 +55,15 @@ Credits Authors ~~~~~~~ -* Eficent +* ForgeFlow Contributors ~~~~~~~~~~~~ -* Lois Rilo Antelo +* Lois Rilo Antelo * Bhavesh Odedra * Kitti Upariphutthiphong +* Pimolnat Suntian Maintainers ~~~~~~~~~~~ @@ -77,6 +78,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -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_orderpoint_manual_procurement_uom/__manifest__.py b/stock_orderpoint_manual_procurement_uom/__manifest__.py index 51fa730c6..8c4b33e0f 100644 --- a/stock_orderpoint_manual_procurement_uom/__manifest__.py +++ b/stock_orderpoint_manual_procurement_uom/__manifest__.py @@ -5,7 +5,7 @@ "summary": "Glue module for stock_orderpoint_uom and " "stock_orderpoint_manual_procurement", "version": "13.0.1.0.0", - "author": "Eficent, Odoo Community Association (OCA)", + "author": "ForgeFlow, Odoo Community Association (OCA)", "website": "https://github.com/OCA/stock-logistics-warehouse", "category": "Warehouse Management", "depends": ["stock_orderpoint_uom", "stock_orderpoint_manual_procurement"], diff --git a/stock_orderpoint_manual_procurement_uom/models/stock_warehouse_orderpoint.py b/stock_orderpoint_manual_procurement_uom/models/stock_warehouse_orderpoint.py index a30bb31e3..4675ce0e2 100644 --- a/stock_orderpoint_manual_procurement_uom/models/stock_warehouse_orderpoint.py +++ b/stock_orderpoint_manual_procurement_uom/models/stock_warehouse_orderpoint.py @@ -1,13 +1,12 @@ # Copyright 2018-20 ForgeFlow S.L. (https://www.forgeflow.com) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -from odoo import api, models +from odoo import models class StockWarehouseOrderpoint(models.Model): _inherit = "stock.warehouse.orderpoint" - @api.multi def _get_procure_recommended_qty(self, virtual_qty, op_qtys): product_qty = super( StockWarehouseOrderpoint, self diff --git a/stock_orderpoint_manual_procurement_uom/readme/CONTRIBUTORS.rst b/stock_orderpoint_manual_procurement_uom/readme/CONTRIBUTORS.rst index da3985eca..1d4f33339 100644 --- a/stock_orderpoint_manual_procurement_uom/readme/CONTRIBUTORS.rst +++ b/stock_orderpoint_manual_procurement_uom/readme/CONTRIBUTORS.rst @@ -1,3 +1,4 @@ -* Lois Rilo Antelo +* Lois Rilo Antelo * Bhavesh Odedra * Kitti Upariphutthiphong +* Pimolnat Suntian diff --git a/stock_orderpoint_manual_procurement_uom/static/description/index.html b/stock_orderpoint_manual_procurement_uom/static/description/index.html index 4ca8d27c2..834ea3b87 100644 --- a/stock_orderpoint_manual_procurement_uom/static/description/index.html +++ b/stock_orderpoint_manual_procurement_uom/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: AGPL-3 OCA/stock-logistics-warehouse Translate me on Weblate Try me on Runbot

+

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

Glue module for stock_orderpoint_uom and stock_orderpoint_manual_procurement

Table of contents

@@ -393,7 +393,7 @@ measure indicated in the reordering rule.

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.

@@ -401,15 +401,16 @@ If you spotted it first, help us smashing it by providing a detailed and welcome

Authors

    -
  • Eficent
  • +
  • ForgeFlow

Contributors

@@ -419,7 +420,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

-

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_orderpoint_manual_procurement_uom/tests/test_stock_orderpoint_manual_procurement.py b/stock_orderpoint_manual_procurement_uom/tests/test_stock_orderpoint_manual_procurement.py index 9a8ed3d54..927ee9749 100644 --- a/stock_orderpoint_manual_procurement_uom/tests/test_stock_orderpoint_manual_procurement.py +++ b/stock_orderpoint_manual_procurement_uom/tests/test_stock_orderpoint_manual_procurement.py @@ -51,7 +51,7 @@ class TestStockWarehouseOrderpoint(common.TransactionCase): # Add default quantity quantity = 20.00 - self._update_product_qty(self.product, self.location, quantity) + self._update_product_qty(self.product, quantity) # Create Reordering Rule self.reorder = self.create_orderpoint() @@ -90,12 +90,12 @@ class TestStockWarehouseOrderpoint(common.TransactionCase): ) return product - def _update_product_qty(self, product, location, quantity): + def _update_product_qty(self, product, quantity): """Update Product quantity.""" change_product_qty = self.stock_change_model.create( { - "location_id": location.id, "product_id": product.id, + "product_tmpl_id": product.product_tmpl_id.id, "new_quantity": quantity, } ) @@ -104,7 +104,7 @@ class TestStockWarehouseOrderpoint(common.TransactionCase): def create_orderpoint(self): """Create a Reordering Rule""" - reorder = self.reordering_rule_model.sudo(self.user).create( + reorder = self.reordering_rule_model.with_user(self.user).create( { "name": "Order-point", "product_id": self.product.id, @@ -124,7 +124,7 @@ class TestStockWarehouseOrderpoint(common.TransactionCase): "active_id": self.reorder.id, } wizard = ( - self.make_procurement_orderpoint_model.sudo(self.user) + self.make_procurement_orderpoint_model.with_user(self.user) .with_context(context) .create({}) )