From 243e8efb87e530af910b5a93c38f22bbf26fd58f Mon Sep 17 00:00:00 2001
From: Kitti U
Date: Thu, 4 Apr 2019 10:59:27 +0700
Subject: [PATCH] [12.0][MIG] stock_secondary_unit
---
stock_secondary_unit/README.rst | 11 ++--
stock_secondary_unit/__manifest__.py | 2 +-
stock_secondary_unit/models/product.py | 1 +
stock_secondary_unit/models/stock_move.py | 3 +-
stock_secondary_unit/readme/CONTRIBUTORS.rst | 1 +
.../static/description/index.html | 7 ++-
.../tests/test_stock_secondary_unit.py | 57 ++++++++++++++-----
stock_secondary_unit/views/product_views.xml | 10 ++--
.../views/stock_move_views.xml | 2 +-
.../views/stock_picking_views.xml | 6 +-
10 files changed, 66 insertions(+), 34 deletions(-)
diff --git a/stock_secondary_unit/README.rst b/stock_secondary_unit/README.rst
index c97b74b79..4fc4c5c55 100644
--- a/stock_secondary_unit/README.rst
+++ b/stock_secondary_unit/README.rst
@@ -14,13 +14,13 @@ Stock Secondary Unit
: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/11.0/stock_secondary_unit
+ :target: https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_secondary_unit
: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-11-0/stock-logistics-warehouse-11-0-stock_secondary_unit
+ :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_secondary_unit
: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/11.0
+ :target: https://runbot.odoo-community.org/runbot/153/12.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
@@ -51,7 +51,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.
@@ -68,6 +68,7 @@ Contributors
* Carlos Dauden
* Sergio Teruel
+* Kitti Upariphutthiphong
Maintainers
~~~~~~~~~~~
@@ -82,6 +83,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_secondary_unit/__manifest__.py b/stock_secondary_unit/__manifest__.py
index d2d65f53a..6c6c66b3d 100644
--- a/stock_secondary_unit/__manifest__.py
+++ b/stock_secondary_unit/__manifest__.py
@@ -3,7 +3,7 @@
{
'name': 'Stock Secondary Unit',
'summary': 'Get product quantities in a secondary unit',
- 'version': '11.0.1.0.0',
+ 'version': '12.0.1.0.0',
'development_status': 'Beta',
'category': 'stock',
'website': 'https://github.com/OCA/stock-logistics-warehouse',
diff --git a/stock_secondary_unit/models/product.py b/stock_secondary_unit/models/product.py
index 49efefb03..46fa07283 100644
--- a/stock_secondary_unit/models/product.py
+++ b/stock_secondary_unit/models/product.py
@@ -7,6 +7,7 @@ from odoo.tools.float_utils import float_round
class StockProductSecondaryUnit(models.AbstractModel):
_name = 'stock.product.secondary.unit'
+ _description = 'Stock Product Secondary Unit'
secondary_unit_qty_available = fields.Float(
string='Quantity On Hand (2Unit)',
diff --git a/stock_secondary_unit/models/stock_move.py b/stock_secondary_unit/models/stock_move.py
index dcb5d6156..13b553d97 100644
--- a/stock_secondary_unit/models/stock_move.py
+++ b/stock_secondary_unit/models/stock_move.py
@@ -7,6 +7,7 @@ from odoo.tools.float_utils import float_round
class StockSecondaryUnitMixin(models.AbstractModel):
_name = 'stock.secondary.unit.mixin'
+ _description = 'Stock Secondary Unit Mixin'
secondary_uom_id = fields.Many2one(
comodel_name='product.secondary.unit',
@@ -36,7 +37,7 @@ class StockMoveLine(models.Model):
def create(self, vals):
move = self.env['stock.move'].browse(vals['move_id'])
if move.secondary_uom_id:
- uom = self.env['product.uom'].browse(vals['product_uom_id'])
+ uom = self.env['uom.uom'].browse(vals['product_uom_id'])
factor = move.secondary_uom_id.factor * uom.factor
move_line_qty = vals.get(
'product_uom_qty', vals.get('qty_done', 0.0))
diff --git a/stock_secondary_unit/readme/CONTRIBUTORS.rst b/stock_secondary_unit/readme/CONTRIBUTORS.rst
index b919cb776..3b07d85d5 100644
--- a/stock_secondary_unit/readme/CONTRIBUTORS.rst
+++ b/stock_secondary_unit/readme/CONTRIBUTORS.rst
@@ -1,2 +1,3 @@
* Carlos Dauden
* Sergio Teruel
+* Kitti Upariphutthiphong
diff --git a/stock_secondary_unit/static/description/index.html b/stock_secondary_unit/static/description/index.html
index 65a1255be..d6d5885d2 100644
--- a/stock_secondary_unit/static/description/index.html
+++ b/stock_secondary_unit/static/description/index.html
@@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-
+
This module extends the functionality of stock module to allow define
other units with their conversion factor.
Table of contents
@@ -400,7 +400,7 @@ other units with their conversion factor.
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.
@@ -425,7 +426,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.