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.
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.
+
+
From 07f23f037f8c1cab9e32ab28e8ed947fef9e5a36 Mon Sep 17 00:00:00 2001
From: oca-travis
Date: Sat, 16 Feb 2019 13:38:59 +0000
Subject: [PATCH 03/17] [UPD] Update stock_secondary_unit.pot
---
stock_secondary_unit/i18n/es.po | 50 ++++++++-
.../i18n/stock_secondary_unit.pot | 105 ++++++++++++++++++
2 files changed, 151 insertions(+), 4 deletions(-)
create mode 100644 stock_secondary_unit/i18n/stock_secondary_unit.pot
diff --git a/stock_secondary_unit/i18n/es.po b/stock_secondary_unit/i18n/es.po
index a67559a4e..f1716d95e 100644
--- a/stock_secondary_unit/i18n/es.po
+++ b/stock_secondary_unit/i18n/es.po
@@ -17,26 +17,38 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 2.0.6\n"
+#. module: stock_secondary_unit
+#: model:ir.ui.view,arch_db:stock_secondary_unit.report_delivery_document
+msgid "Secondary Qty"
+msgstr ""
+
#. module: stock_secondary_unit
#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_product_secondary_unit_display_name
+#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_secondary_unit_mixin_display_name
msgid "Display Name"
msgstr "Mostrar Nombre"
#. module: stock_secondary_unit
#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_product_secondary_unit_id
+#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_secondary_unit_mixin_id
msgid "ID"
msgstr "ID"
#. module: stock_secondary_unit
#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_product_secondary_unit___last_update
+#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_secondary_unit_mixin___last_update
msgid "Last Modified on"
msgstr "Última modificación en"
#. module: stock_secondary_unit
-#: model:ir.ui.view,arch_db:stock_secondary_unit.product_form_view_procurement_button
-#: model:ir.ui.view,arch_db:stock_secondary_unit.product_template_form_view_procurement_button
-msgid "On Hand (2unit)"
-msgstr "A mano (2Ud.)"
+#: model:ir.model,name:stock_secondary_unit.model_stock_move_line
+msgid "Packing Operation"
+msgstr ""
+
+#. module: stock_secondary_unit
+#: model:ir.model,name:stock_secondary_unit.model_procurement_rule
+msgid "Procurement Rule"
+msgstr ""
#. module: stock_secondary_unit
#: model:ir.model,name:stock_secondary_unit.model_product_product
@@ -55,21 +67,51 @@ msgstr "Plantilla de producto"
msgid "Quantity On Hand (2Unit)"
msgstr "Cantidad a mano (2Ud.)"
+#. module: stock_secondary_unit
+#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_move_line_secondary_uom_id
+#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_move_secondary_uom_id
+#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_secondary_unit_mixin_secondary_uom_id
+#, fuzzy
+msgid "Second unit"
+msgstr "Unidad Secundaria"
+
#. module: stock_secondary_unit
#: model:ir.model.fields,field_description:stock_secondary_unit.field_product_product_stock_secondary_uom_id
#: model:ir.model.fields,field_description:stock_secondary_unit.field_product_template_stock_secondary_uom_id
msgid "Second unit for inventory"
msgstr "Segunda unidad de medida para inventario"
+#. module: stock_secondary_unit
+#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_move_line_secondary_uom_qty
+#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_move_secondary_uom_qty
+#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_secondary_unit_mixin_secondary_uom_qty
+#, fuzzy
+msgid "Secondary Qty"
+msgstr "Unidad Secundaria"
+
#. module: stock_secondary_unit
#: model:ir.ui.view,arch_db:stock_secondary_unit.view_template_property_form
msgid "Secondary unit"
msgstr "Unidad Secundaria"
+#. module: stock_secondary_unit
+#: model:ir.model,name:stock_secondary_unit.model_stock_move
+msgid "Stock Move"
+msgstr ""
+
#. module: stock_secondary_unit
#: model:ir.model,name:stock_secondary_unit.model_stock_product_secondary_unit
msgid "stock.product.secondary.unit"
msgstr ""
+#. module: stock_secondary_unit
+#: model:ir.model,name:stock_secondary_unit.model_stock_secondary_unit_mixin
+#, fuzzy
+msgid "stock.secondary.unit.mixin"
+msgstr "Unidad Secundaria"
+
+#~ msgid "On Hand (2unit)"
+#~ msgstr "A mano (2Ud.)"
+
#~ msgid "Second Unit Quantity On Hand"
#~ msgstr "Segunda unidad de medida por defecto"
diff --git a/stock_secondary_unit/i18n/stock_secondary_unit.pot b/stock_secondary_unit/i18n/stock_secondary_unit.pot
new file mode 100644
index 000000000..cec48daa5
--- /dev/null
+++ b/stock_secondary_unit/i18n/stock_secondary_unit.pot
@@ -0,0 +1,105 @@
+# Translation of Odoo Server.
+# This file contains the translation of the following modules:
+# * stock_secondary_unit
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: Odoo Server 11.0\n"
+"Report-Msgid-Bugs-To: \n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: stock_secondary_unit
+#: model:ir.ui.view,arch_db:stock_secondary_unit.report_delivery_document
+msgid "Secondary Qty"
+msgstr ""
+
+#. module: stock_secondary_unit
+#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_product_secondary_unit_display_name
+#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_secondary_unit_mixin_display_name
+msgid "Display Name"
+msgstr ""
+
+#. module: stock_secondary_unit
+#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_product_secondary_unit_id
+#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_secondary_unit_mixin_id
+msgid "ID"
+msgstr ""
+
+#. module: stock_secondary_unit
+#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_product_secondary_unit___last_update
+#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_secondary_unit_mixin___last_update
+msgid "Last Modified on"
+msgstr ""
+
+#. module: stock_secondary_unit
+#: model:ir.model,name:stock_secondary_unit.model_stock_move_line
+msgid "Packing Operation"
+msgstr ""
+
+#. module: stock_secondary_unit
+#: model:ir.model,name:stock_secondary_unit.model_procurement_rule
+msgid "Procurement Rule"
+msgstr ""
+
+#. module: stock_secondary_unit
+#: model:ir.model,name:stock_secondary_unit.model_product_product
+msgid "Product"
+msgstr ""
+
+#. module: stock_secondary_unit
+#: model:ir.model,name:stock_secondary_unit.model_product_template
+msgid "Product Template"
+msgstr ""
+
+#. module: stock_secondary_unit
+#: model:ir.model.fields,field_description:stock_secondary_unit.field_product_product_secondary_unit_qty_available
+#: model:ir.model.fields,field_description:stock_secondary_unit.field_product_template_secondary_unit_qty_available
+#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_product_secondary_unit_secondary_unit_qty_available
+msgid "Quantity On Hand (2Unit)"
+msgstr ""
+
+#. module: stock_secondary_unit
+#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_move_line_secondary_uom_id
+#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_move_secondary_uom_id
+#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_secondary_unit_mixin_secondary_uom_id
+msgid "Second unit"
+msgstr ""
+
+#. module: stock_secondary_unit
+#: model:ir.model.fields,field_description:stock_secondary_unit.field_product_product_stock_secondary_uom_id
+#: model:ir.model.fields,field_description:stock_secondary_unit.field_product_template_stock_secondary_uom_id
+msgid "Second unit for inventory"
+msgstr ""
+
+#. module: stock_secondary_unit
+#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_move_line_secondary_uom_qty
+#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_move_secondary_uom_qty
+#: model:ir.model.fields,field_description:stock_secondary_unit.field_stock_secondary_unit_mixin_secondary_uom_qty
+msgid "Secondary Qty"
+msgstr ""
+
+#. module: stock_secondary_unit
+#: model:ir.ui.view,arch_db:stock_secondary_unit.view_template_property_form
+msgid "Secondary unit"
+msgstr ""
+
+#. module: stock_secondary_unit
+#: model:ir.model,name:stock_secondary_unit.model_stock_move
+msgid "Stock Move"
+msgstr ""
+
+#. module: stock_secondary_unit
+#: model:ir.model,name:stock_secondary_unit.model_stock_product_secondary_unit
+msgid "stock.product.secondary.unit"
+msgstr ""
+
+#. module: stock_secondary_unit
+#: model:ir.model,name:stock_secondary_unit.model_stock_secondary_unit_mixin
+msgid "stock.secondary.unit.mixin"
+msgstr ""
+
From 56d27f003a6f1e5a47752e230cbc069d9640bad3 Mon Sep 17 00:00:00 2001
From: Sergio Teruel
Date: Tue, 19 Feb 2019 18:20:36 +0100
Subject: [PATCH 04/17] [11.0][FIX] stock_secondary_unit: Remove
procurement_rule move. Fix dependencies
---
stock_secondary_unit/__manifest__.py | 2 +-
stock_secondary_unit/models/__init__.py | 1 -
.../models/procurement_rule.py | 23 -------------------
3 files changed, 1 insertion(+), 25 deletions(-)
delete mode 100644 stock_secondary_unit/models/procurement_rule.py
diff --git a/stock_secondary_unit/__manifest__.py b/stock_secondary_unit/__manifest__.py
index 5e0d2718b..d2d65f53a 100644
--- a/stock_secondary_unit/__manifest__.py
+++ b/stock_secondary_unit/__manifest__.py
@@ -12,7 +12,7 @@
'application': False,
'installable': True,
'depends': [
- 'sale_stock',
+ 'stock',
'product_secondary_unit',
],
'data': [
diff --git a/stock_secondary_unit/models/__init__.py b/stock_secondary_unit/models/__init__.py
index e86540488..960afa99e 100644
--- a/stock_secondary_unit/models/__init__.py
+++ b/stock_secondary_unit/models/__init__.py
@@ -1,4 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
-from . import procurement_rule
from . import product
from . import stock_move
diff --git a/stock_secondary_unit/models/procurement_rule.py b/stock_secondary_unit/models/procurement_rule.py
deleted file mode 100644
index 1d6ec8133..000000000
--- a/stock_secondary_unit/models/procurement_rule.py
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright 2018 Tecnativa - Sergio Teruel
-# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
-from odoo import models
-
-
-class ProcurementRule(models.Model):
- _inherit = 'procurement.rule'
-
- def _get_stock_move_values(self, product_id, product_qty, product_uom,
- location_id, name, origin, values, group_id):
- res = super(ProcurementRule, self)._get_stock_move_values(
- product_id, product_qty, product_uom, location_id, name, origin,
- values, group_id
- )
- if values.get('sale_line_id', False):
- sale_line = self.env['sale.order.line'].browse(
- values['sale_line_id'])
- if sale_line.secondary_uom_id:
- res.update({
- 'secondary_uom_id': sale_line.secondary_uom_id.id,
- 'secondary_uom_qty': sale_line.secondary_uom_qty,
- })
- return res
From 6e2dd7e94e55aca6c0cc85dfff69701e2562a9c1 Mon Sep 17 00:00:00 2001
From: oca-travis
Date: Wed, 20 Feb 2019 12:59:37 +0000
Subject: [PATCH 05/17] [UPD] Update stock_secondary_unit.pot
---
stock_secondary_unit/i18n/stock_secondary_unit.pot | 5 -----
1 file changed, 5 deletions(-)
diff --git a/stock_secondary_unit/i18n/stock_secondary_unit.pot b/stock_secondary_unit/i18n/stock_secondary_unit.pot
index cec48daa5..3d970583b 100644
--- a/stock_secondary_unit/i18n/stock_secondary_unit.pot
+++ b/stock_secondary_unit/i18n/stock_secondary_unit.pot
@@ -41,11 +41,6 @@ msgstr ""
msgid "Packing Operation"
msgstr ""
-#. module: stock_secondary_unit
-#: model:ir.model,name:stock_secondary_unit.model_procurement_rule
-msgid "Procurement Rule"
-msgstr ""
-
#. module: stock_secondary_unit
#: model:ir.model,name:stock_secondary_unit.model_product_product
msgid "Product"
From 243e8efb87e530af910b5a93c38f22bbf26fd58f Mon Sep 17 00:00:00 2001
From: Kitti U
Date: Thu, 4 Apr 2019 10:59:27 +0700
Subject: [PATCH 06/17] [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.