From 8439ef36316c930c48c8082684bb0f0669aa97c3 Mon Sep 17 00:00:00 2001 From: Kitti U Date: Tue, 2 Apr 2019 09:13:44 +0700 Subject: [PATCH] [12.0][MIG] stock_orderpoint_uom --- stock_orderpoint_uom/README.rst | 71 ++- stock_orderpoint_uom/__manifest__.py | 2 +- .../models/stock_warehouse_orderpoint.py | 2 +- stock_orderpoint_uom/readme/CONFIGURE.rst | 2 + stock_orderpoint_uom/readme/CONTRIBUTORS.rst | 4 + stock_orderpoint_uom/readme/DESCRIPTION.rst | 8 + stock_orderpoint_uom/readme/USAGE.rst | 1 + .../static/description/index.html | 439 ++++++++++++++++++ .../test_stock_orderpoint_procure_uom.py | 6 +- .../views/stock_warehouse_orderpoint_view.xml | 4 +- 10 files changed, 508 insertions(+), 31 deletions(-) create mode 100644 stock_orderpoint_uom/readme/CONFIGURE.rst create mode 100644 stock_orderpoint_uom/readme/CONTRIBUTORS.rst create mode 100644 stock_orderpoint_uom/readme/DESCRIPTION.rst create mode 100644 stock_orderpoint_uom/readme/USAGE.rst create mode 100644 stock_orderpoint_uom/static/description/index.html diff --git a/stock_orderpoint_uom/README.rst b/stock_orderpoint_uom/README.rst index de6ce80fd..382f6de57 100644 --- a/stock_orderpoint_uom/README.rst +++ b/stock_orderpoint_uom/README.rst @@ -1,11 +1,30 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 - ==================== Stock Orderpoint UoM ==================== +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :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_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_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 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + This module allows users users to define what unit of measure should be used in procurements created from minimum stock rules. @@ -15,6 +34,11 @@ created, the quantity to be transferred will be expressed in meters, making it easier for the people responsible for the transfers to understand the requirement. +**Table of contents** + +.. contents:: + :local: + Configuration ============= @@ -24,48 +48,47 @@ and enable 'Sell and purchase products in different units of measure' option. Usage ===== -Go to 'Inventory > Master Data > Reordering Rules' and indicate a Procurement -UoM. - - -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/153/11.0 +Go to 'Inventory > Master Data > Reordering Rules' and indicate a Procurement UoM. 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. +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 `_. + +Do not contact contributors directly about support or help with technical issues. Credits ======= -Images ------- +Authors +~~~~~~~ -* Odoo Community Association: `Icon `_. +* Eficent Contributors ------------- +~~~~~~~~~~~~ * Jordi Ballester Alomar * Lois Rilo * Bhavesh Odedra +* Kitti Upariphutthiphong -Maintainer ----------- +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. .. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :target: https://odoo-community.org -This module is maintained by the OCA. - 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. -To contribute to this module, please visit https://odoo-community.org. +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_uom/__manifest__.py b/stock_orderpoint_uom/__manifest__.py index 5903c8c8e..8d1027c2a 100644 --- a/stock_orderpoint_uom/__manifest__.py +++ b/stock_orderpoint_uom/__manifest__.py @@ -5,7 +5,7 @@ "name": "Stock Orderpoint UoM", "summary": "Allows to create procurement orders in the UoM indicated in " "the orderpoint", - "version": "11.0.1.0.0", + "version": "12.0.1.0.0", "author": "Eficent, " "Odoo Community Association (OCA)", "website": "https://github.com/OCA/stock-logistics-warehouse", diff --git a/stock_orderpoint_uom/models/stock_warehouse_orderpoint.py b/stock_orderpoint_uom/models/stock_warehouse_orderpoint.py index 8be67a254..48ca6f9dc 100644 --- a/stock_orderpoint_uom/models/stock_warehouse_orderpoint.py +++ b/stock_orderpoint_uom/models/stock_warehouse_orderpoint.py @@ -9,7 +9,7 @@ from odoo.exceptions import UserError class Orderpoint(models.Model): _inherit = "stock.warehouse.orderpoint" - procure_uom_id = fields.Many2one(comodel_name='product.uom', + procure_uom_id = fields.Many2one(comodel_name='uom.uom', string="Procurement UoM") @api.constrains('product_id', 'procure_uom_id') diff --git a/stock_orderpoint_uom/readme/CONFIGURE.rst b/stock_orderpoint_uom/readme/CONFIGURE.rst new file mode 100644 index 000000000..2ade2a17c --- /dev/null +++ b/stock_orderpoint_uom/readme/CONFIGURE.rst @@ -0,0 +1,2 @@ +To configure this module, you need to 'Inventory > Configuration > Settings' +and enable 'Sell and purchase products in different units of measure' option. diff --git a/stock_orderpoint_uom/readme/CONTRIBUTORS.rst b/stock_orderpoint_uom/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..2e04b89ae --- /dev/null +++ b/stock_orderpoint_uom/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +* Jordi Ballester Alomar +* Lois Rilo +* Bhavesh Odedra +* Kitti Upariphutthiphong diff --git a/stock_orderpoint_uom/readme/DESCRIPTION.rst b/stock_orderpoint_uom/readme/DESCRIPTION.rst new file mode 100644 index 000000000..40508d5a0 --- /dev/null +++ b/stock_orderpoint_uom/readme/DESCRIPTION.rst @@ -0,0 +1,8 @@ +This module allows users users to define what unit of measure should be used +in procurements created from minimum stock rules. + +A typical use case would be a product that is stocked in centimeters, and +needs to be restocked in meters from another warehouse. When the picking is +created, the quantity to be transferred will be expressed in meters, making +it easier for the people responsible for the transfers to understand the +requirement. diff --git a/stock_orderpoint_uom/readme/USAGE.rst b/stock_orderpoint_uom/readme/USAGE.rst new file mode 100644 index 000000000..a38d3e7de --- /dev/null +++ b/stock_orderpoint_uom/readme/USAGE.rst @@ -0,0 +1 @@ +Go to 'Inventory > Master Data > Reordering Rules' and indicate a Procurement UoM. diff --git a/stock_orderpoint_uom/static/description/index.html b/stock_orderpoint_uom/static/description/index.html new file mode 100644 index 000000000..4ade4c683 --- /dev/null +++ b/stock_orderpoint_uom/static/description/index.html @@ -0,0 +1,439 @@ + + + + + + +Stock Orderpoint UoM + + + +
+

Stock Orderpoint UoM

+ + +

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

+

This module allows users users to define what unit of measure should be used +in procurements created from minimum stock rules.

+

A typical use case would be a product that is stocked in centimeters, and +needs to be restocked in meters from another warehouse. When the picking is +created, the quantity to be transferred will be expressed in meters, making +it easier for the people responsible for the transfers to understand the +requirement.

+

Table of contents

+ +
+

Configuration

+

To configure this module, you need to ‘Inventory > Configuration > Settings’ +and enable ‘Sell and purchase products in different units of measure’ option.

+
+
+

Usage

+

Go to ‘Inventory > Master Data > Reordering Rules’ and indicate a Procurement UoM.

+
+
+

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.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Eficent
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

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

+
+
+
+ + diff --git a/stock_orderpoint_uom/tests/test_stock_orderpoint_procure_uom.py b/stock_orderpoint_uom/tests/test_stock_orderpoint_procure_uom.py index 803679e5f..a62acb524 100644 --- a/stock_orderpoint_uom/tests/test_stock_orderpoint_procure_uom.py +++ b/stock_orderpoint_uom/tests/test_stock_orderpoint_procure_uom.py @@ -18,11 +18,11 @@ class TestStockOrderpointProcureUom(common.TransactionCase): self.purchase_line_model = self.env['purchase.order.line'] self.warehouse = self.env.ref('stock.warehouse0') self.location_stock = self.env.ref('stock.stock_location_stock') - self.uom_unit = self.env.ref('product.product_uom_unit') + self.uom_unit = self.env.ref('uom.product_uom_unit') self.uom_unit.rounding = 1 - self.uom_dozen = self.env.ref('product.product_uom_dozen') + self.uom_dozen = self.env.ref('uom.product_uom_dozen') self.uom_dozen.rounding = 1 - self.uom_kg = self.env.ref('product.product_uom_kgm') + self.uom_kg = self.env.ref('uom.product_uom_kgm') self.productA = productObj.create( {'name': 'product A', diff --git a/stock_orderpoint_uom/views/stock_warehouse_orderpoint_view.xml b/stock_orderpoint_uom/views/stock_warehouse_orderpoint_view.xml index d52bf56b1..68214d35d 100644 --- a/stock_orderpoint_uom/views/stock_warehouse_orderpoint_view.xml +++ b/stock_orderpoint_uom/views/stock_warehouse_orderpoint_view.xml @@ -8,7 +8,7 @@ ref="stock.view_warehouse_orderpoint_tree"/> - + @@ -21,7 +21,7 @@ + groups="uom.group_uom"/>