From ae3bf14623cebc5d05c5034b067fc76bc3d1bfd2 Mon Sep 17 00:00:00 2001
From: Sergio Teruel
Date: Fri, 7 Feb 2020 23:33:08 +0100
Subject: [PATCH] [MIG] stock_inventory_cost_info: Migration to v13.0
[UPD] Update stock_inventory_cost_info.pot
Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.
Translation: stock-logistics-warehouse-13.0/stock-logistics-warehouse-13.0-stock_inventory_cost_info
Translate-URL: https://translation.odoo-community.org/projects/stock-logistics-warehouse-13-0/stock-logistics-warehouse-13-0-stock_inventory_cost_info/
---
stock_inventory_cost_info/README.rst | 11 ++++---
stock_inventory_cost_info/__manifest__.py | 2 +-
stock_inventory_cost_info/i18n/es.po | 1 -
.../i18n/stock_inventory_cost_info.pot | 8 ++---
.../models/stock_inventory.py | 8 ++---
.../readme/CONTRIBUTORS.rst | 1 +
.../static/description/index.html | 7 ++--
.../tests/test_stock_inventory_cost_info.py | 4 +--
.../views/report_stockinventory.xml | 15 ++++++---
.../views/stock_inventory_views.xml | 33 +++++--------------
10 files changed, 41 insertions(+), 49 deletions(-)
diff --git a/stock_inventory_cost_info/README.rst b/stock_inventory_cost_info/README.rst
index 3717c45dc..6fac21db1 100644
--- a/stock_inventory_cost_info/README.rst
+++ b/stock_inventory_cost_info/README.rst
@@ -14,13 +14,13 @@ Stock Inventory Cost Info
: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_inventory_cost_info
+ :target: https://github.com/OCA/stock-logistics-warehouse/tree/13.0/stock_inventory_cost_info
: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_inventory_cost_info
+ :target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-13-0/stock-logistics-warehouse-13-0-stock_inventory_cost_info
: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|
@@ -58,7 +58,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.
@@ -77,6 +77,7 @@ Contributors
* Ernesto Tejeda
* Pedro M. Baeza
+ * Sergio Teruel
Maintainers
~~~~~~~~~~~
@@ -91,6 +92,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_inventory_cost_info/__manifest__.py b/stock_inventory_cost_info/__manifest__.py
index bf88649fe..4174a0bd0 100644
--- a/stock_inventory_cost_info/__manifest__.py
+++ b/stock_inventory_cost_info/__manifest__.py
@@ -4,7 +4,7 @@
{
"name": "Stock Inventory Cost Info",
"summary": "Shows the cost of the inventory adjustments",
- "version": "12.0.1.0.0",
+ "version": "13.0.1.0.0",
"author": "Tecnativa, " "Odoo Community Association (OCA)",
"website": "https://github.com/OCA/stock-logistics-warehouse",
"category": "Warehouse",
diff --git a/stock_inventory_cost_info/i18n/es.po b/stock_inventory_cost_info/i18n/es.po
index 31ad4dfec..20a65e264 100644
--- a/stock_inventory_cost_info/i18n/es.po
+++ b/stock_inventory_cost_info/i18n/es.po
@@ -39,6 +39,5 @@ msgstr "LĂnea de inventario"
#. module: stock_inventory_cost_info
#: model_terms:ir.ui.view,arch_db:stock_inventory_cost_info.stock_inventory_line_tree
#: model_terms:ir.ui.view,arch_db:stock_inventory_cost_info.stock_inventory_line_tree2
-#: model_terms:ir.ui.view,arch_db:stock_inventory_cost_info.view_inventory_form
msgid "Total"
msgstr ""
diff --git a/stock_inventory_cost_info/i18n/stock_inventory_cost_info.pot b/stock_inventory_cost_info/i18n/stock_inventory_cost_info.pot
index 05330c3fb..7f6f69939 100644
--- a/stock_inventory_cost_info/i18n/stock_inventory_cost_info.pot
+++ b/stock_inventory_cost_info/i18n/stock_inventory_cost_info.pot
@@ -1,12 +1,12 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
-# * stock_inventory_cost_info
+# * stock_inventory_cost_info
#
msgid ""
msgstr ""
-"Project-Id-Version: Odoo Server 12.0\n"
+"Project-Id-Version: Odoo Server 13.0\n"
"Report-Msgid-Bugs-To: \n"
-"Last-Translator: <>\n"
+"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -36,7 +36,5 @@ msgstr ""
#. module: stock_inventory_cost_info
#: model_terms:ir.ui.view,arch_db:stock_inventory_cost_info.stock_inventory_line_tree
#: model_terms:ir.ui.view,arch_db:stock_inventory_cost_info.stock_inventory_line_tree2
-#: model_terms:ir.ui.view,arch_db:stock_inventory_cost_info.view_inventory_form
msgid "Total"
msgstr ""
-
diff --git a/stock_inventory_cost_info/models/stock_inventory.py b/stock_inventory_cost_info/models/stock_inventory.py
index 2c630733d..00ce55c13 100644
--- a/stock_inventory_cost_info/models/stock_inventory.py
+++ b/stock_inventory_cost_info/models/stock_inventory.py
@@ -14,9 +14,9 @@ class InventoryLine(models.Model):
string="Adjustment cost", compute="_compute_adjustment_cost", store=True
)
- @api.depends("product_qty", "theoretical_qty", "inventory_id.state")
+ @api.depends("difference_qty", "inventory_id.state")
def _compute_adjustment_cost(self):
for record in self:
- adjusted_qty = record.product_qty - record.theoretical_qty
- adjustment_cost = adjusted_qty * record.product_id.standard_price
- record.adjustment_cost = adjustment_cost
+ record.adjustment_cost = (
+ record.difference_qty * record.product_id.standard_price
+ )
diff --git a/stock_inventory_cost_info/readme/CONTRIBUTORS.rst b/stock_inventory_cost_info/readme/CONTRIBUTORS.rst
index b31cef321..0c7110256 100644
--- a/stock_inventory_cost_info/readme/CONTRIBUTORS.rst
+++ b/stock_inventory_cost_info/readme/CONTRIBUTORS.rst
@@ -2,3 +2,4 @@
* Ernesto Tejeda
* Pedro M. Baeza
+ * Sergio Teruel
diff --git a/stock_inventory_cost_info/static/description/index.html b/stock_inventory_cost_info/static/description/index.html
index ad55ff2da..c7fe5d013 100644
--- a/stock_inventory_cost_info/static/description/index.html
+++ b/stock_inventory_cost_info/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 Inventory Adjustments to show a new
column Adjustment cost in Inventory Details list and PDF report table. The
value of Adjustment cost will be self-calculated according to:
@@ -407,7 +407,7 @@ zero in all existing inventory adjustment before installation.
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.
@@ -424,6 +424,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
Tecnativa:
- Ernesto Tejeda
- Pedro M. Baeza
+- Sergio Teruel
@@ -435,7 +436,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_inventory_cost_info/tests/test_stock_inventory_cost_info.py b/stock_inventory_cost_info/tests/test_stock_inventory_cost_info.py
index 7e4fb44c8..91e37f01e 100644
--- a/stock_inventory_cost_info/tests/test_stock_inventory_cost_info.py
+++ b/stock_inventory_cost_info/tests/test_stock_inventory_cost_info.py
@@ -2,9 +2,10 @@
# Copyright 2019 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
-from odoo.tests.common import TransactionCase
+from odoo.tests.common import TransactionCase, tagged
+@tagged("post_install", "-at_install")
class TestStockInventoryCostInfo(TransactionCase):
def setUp(self):
super(TestStockInventoryCostInfo, self).setUp()
@@ -18,7 +19,6 @@ class TestStockInventoryCostInfo(TransactionCase):
self.inventory = self.env["stock.inventory"].create(
{
"name": "Another inventory",
- "filter": "partial",
"line_ids": [
(
0,
diff --git a/stock_inventory_cost_info/views/report_stockinventory.xml b/stock_inventory_cost_info/views/report_stockinventory.xml
index e2f0da9d9..8d9dda2c3 100644
--- a/stock_inventory_cost_info/views/report_stockinventory.xml
+++ b/stock_inventory_cost_info/views/report_stockinventory.xml
@@ -1,11 +1,18 @@
-
+
-
- Adjustment cost |
+
+
+ Adjustment cost
+ |
- |
+
+
+ |
diff --git a/stock_inventory_cost_info/views/stock_inventory_views.xml b/stock_inventory_cost_info/views/stock_inventory_views.xml
index 6eb2e3c8a..d3671e3f3 100644
--- a/stock_inventory_cost_info/views/stock_inventory_views.xml
+++ b/stock_inventory_cost_info/views/stock_inventory_views.xml
@@ -1,40 +1,25 @@
-
+
-
stock.inventory.line.tree.cost.info
stock.inventory.line
-
+
-
-
-
+
+
+
-
stock.inventory.line.tree2.cost.info
stock.inventory.line
-
+
-
-
-
+
+
+
-
-
- stock.inventory.form
- stock.inventory
-
-
-
-
-
-
-
-
-