[12.0][MIG] stock_inventory_exclude_sublocation: Migration to 12.0

This commit is contained in:
Bhavesh Odedra
2019-06-21 17:34:21 +05:30
committed by hveficent
parent 0929983a78
commit 4c12ac5f04
5 changed files with 28 additions and 43 deletions

View File

@@ -14,13 +14,13 @@ Stock Inventory Exclude Sublocation
: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_inventory_exclude_sublocation
:target: https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_inventory_exclude_sublocation
: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_inventory_exclude_sublocation
:target: https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_inventory_exclude_sublocation
: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|
@@ -55,7 +55,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-warehouse/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 <https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_inventory_exclude_sublocation%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_inventory_exclude_sublocation%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
@@ -72,6 +72,7 @@ Contributors
~~~~~~~~~~~~
* Lois Rilo Antelo <lois.rilo@eficent.com>
* Bhavesh Odedra <bodedra@opensourceintegrators.com>
Maintainers
~~~~~~~~~~~
@@ -86,6 +87,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 <https://github.com/OCA/stock-logistics-warehouse/tree/11.0/stock_inventory_exclude_sublocation>`_ project on GitHub.
This module is part of the `OCA/stock-logistics-warehouse <https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_inventory_exclude_sublocation>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@@ -6,7 +6,7 @@
"name": "Stock Inventory Exclude Sublocation",
"summary": "Allow to perform inventories of a location without including "
"its child locations.",
"version": "11.0.2.0.0",
"version": "12.0.1.0.0",
"development_status": "Mature",
"author": "Eficent, "
"Tecnativa, "

View File

@@ -1 +1,2 @@
* Lois Rilo Antelo <lois.rilo@eficent.com>
* Bhavesh Odedra <bodedra@opensourceintegrators.com>

View File

@@ -3,13 +3,13 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.14: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils 0.12: http://docutils.sourceforge.net/" />
<title>Stock Inventory Exclude Sublocation</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
:Id: $Id: html4css1.css 7614 2013-02-21 15:55:51Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
@@ -37,14 +37,6 @@ table.borderless td, table.borderless th {
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
@@ -169,12 +161,12 @@ h2.subtitle {
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
img.align-left, .figure.align-left, object.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
img.align-right, .figure.align-right, object.align-right {
clear: right ;
float: right ;
margin-left: 1em }
@@ -185,11 +177,6 @@ img.align-center, .figure.align-center, object.align-center {
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
@@ -207,15 +194,6 @@ div.align-right {
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
@@ -367,7 +345,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/11.0/stock_inventory_exclude_sublocation"><img alt="OCA/stock-logistics-warehouse" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/stock-logistics-warehouse-11-0/stock-logistics-warehouse-11-0-stock_inventory_exclude_sublocation"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/153/11.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_inventory_exclude_sublocation"><img alt="OCA/stock-logistics-warehouse" src="https://img.shields.io/badge/github-OCA%2Fstock--logistics--warehouse-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/stock-logistics-warehouse-12-0/stock-logistics-warehouse-12-0-stock_inventory_exclude_sublocation"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/153/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module extends the functionality of Inventory Adjustment to allow you to
exclude all the sublocations when doing an inventory adjustment for a
given location.</p>
@@ -403,7 +381,7 @@ E.g. if we apply a cycle count strategy.</p>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_inventory_exclude_sublocation%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/issues/new?body=module:%20stock_inventory_exclude_sublocation%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
@@ -419,6 +397,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<h2><a class="toc-backref" href="#id5">Contributors</a></h2>
<ul class="simple">
<li>Lois Rilo Antelo &lt;<a class="reference external" href="mailto:lois.rilo&#64;eficent.com">lois.rilo&#64;eficent.com</a>&gt;</li>
<li>Bhavesh Odedra &lt;<a class="reference external" href="mailto:bodedra&#64;opensourceintegrators.com">bodedra&#64;opensourceintegrators.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
@@ -428,7 +407,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/11.0/stock_inventory_exclude_sublocation">OCA/stock-logistics-warehouse</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/stock-logistics-warehouse/tree/12.0/stock_inventory_exclude_sublocation">OCA/stock-logistics-warehouse</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>

View File

@@ -61,6 +61,10 @@ class TestStockInventoryExcludeSublocation(TransactionCase):
'name': 'Lot for product1',
'product_id': self.product1.id
})
self.lot_b = self.lot_model.create({
'name': 'Lot for product1',
'product_id': self.product2.id
})
self.package = self.package_model.create({'name': 'PACK00TEST1'})
# Add a product in each location
@@ -71,7 +75,7 @@ class TestStockInventoryExcludeSublocation(TransactionCase):
(0, 0, {
'product_id': self.product1.id,
'product_uom_id': self.env.ref(
"product.product_uom_unit").id,
"uom.product_uom_unit").id,
'product_qty': 2.0,
'location_id': self.location.id,
'prod_lot_id': self.lot_a.id
@@ -79,14 +83,14 @@ class TestStockInventoryExcludeSublocation(TransactionCase):
(0, 0, {
'product_id': self.product2.id,
'product_uom_id': self.env.ref(
"product.product_uom_unit").id,
"uom.product_uom_unit").id,
'product_qty': 4.0,
'location_id': self.sublocation.id,
'prod_lot_id': self.lot_a.id
'prod_lot_id': self.lot_b.id
}),
],
})
starting_inv.action_done()
starting_inv.action_validate()
def _create_inventory_all_products(self, name, location,
exclude_sublocation):
@@ -104,7 +108,7 @@ class TestStockInventoryExcludeSublocation(TransactionCase):
inventory_location = self._create_inventory_all_products(
'location inventory', self.location, False)
inventory_location.action_start()
inventory_location.action_done()
inventory_location.action_validate()
lines = inventory_location.line_ids
self.assertEqual(len(lines), 2, 'Not all expected products are '
'included')
@@ -117,9 +121,9 @@ class TestStockInventoryExcludeSublocation(TransactionCase):
inventory_sublocation = self._create_inventory_all_products(
'sublocation inventory', self.sublocation, True)
inventory_location.action_start()
inventory_location.action_done()
inventory_location.action_validate()
inventory_sublocation.action_start()
inventory_sublocation.action_done()
inventory_sublocation.action_validate()
lines_location = inventory_location.line_ids
lines_sublocation = inventory_sublocation.line_ids
self.assertEqual(len(lines_location), 1,
@@ -137,7 +141,7 @@ class TestStockInventoryExcludeSublocation(TransactionCase):
'exclude_sublocation': True
})
inventory.action_start()
inventory.action_done()
inventory.action_validate()
lines = inventory.line_ids
self.assertEqual(len(lines), 1, 'The products in the sublocations are '
'not excluded with lots.')