mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[FIX] stock_move_location: Bug on onchange origin location
This commit is contained in:
committed by
Alex Cuellar
parent
34285e7711
commit
b5085845cd
@@ -114,6 +114,7 @@ Contributors
|
||||
* João Marques
|
||||
* Jacques-Etienne Baudoux <je@bcim.be>
|
||||
* Iryna Vyshnevska <i.vyshnevska@mobilunity.com>
|
||||
* Alexei Rivera <arivera@archeti.com>
|
||||
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
|
||||
@@ -10,3 +10,4 @@
|
||||
* João Marques
|
||||
* Jacques-Etienne Baudoux <je@bcim.be>
|
||||
* Iryna Vyshnevska <i.vyshnevska@mobilunity.com>
|
||||
* Alexei Rivera <arivera@archeti.com>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<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.15.1: http://docutils.sourceforge.net/" />
|
||||
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
|
||||
<title>Move Stock Location</title>
|
||||
<style type="text/css">
|
||||
|
||||
@@ -461,6 +461,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
|
||||
</li>
|
||||
<li>Jacques-Etienne Baudoux <<a class="reference external" href="mailto:je@bcim.be">je@bcim.be</a>></li>
|
||||
<li>Iryna Vyshnevska <<a class="reference external" href="mailto:i.vyshnevska@mobilunity.com">i.vyshnevska@mobilunity.com</a>></li>
|
||||
<li>Alexei Rivera <<a class="reference external" href="mailto:arivera@archeti.com">arivera@archeti.com</a>></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="section" id="maintainers">
|
||||
|
||||
@@ -64,6 +64,30 @@ class TestMoveLocation(TestsCommon):
|
||||
wizard._onchange_origin_location_id()
|
||||
self.assertEqual(len(wizard.stock_move_location_line_ids), 0)
|
||||
|
||||
def test_wizard_onchange_origin_location(self):
|
||||
"""Test a product that have existing quants with undefined quantity."""
|
||||
|
||||
product_not_available = self.env["product.product"].create(
|
||||
{"name": "Mango", "type": "product", "tracking": "none"}
|
||||
)
|
||||
self.quant_obj.create(
|
||||
{
|
||||
"product_id": product_not_available.id,
|
||||
"location_id": self.internal_loc_1.id,
|
||||
}
|
||||
)
|
||||
wizard = self._create_wizard(self.internal_loc_1, self.internal_loc_2)
|
||||
wizard.onchange_origin_location()
|
||||
# we check there is no line for product_not_available
|
||||
self.assertEqual(
|
||||
len(
|
||||
wizard.stock_move_location_line_ids.filtered(
|
||||
lambda x: x.product_id.id == product_not_available.id
|
||||
)
|
||||
),
|
||||
0,
|
||||
)
|
||||
|
||||
def test_planned_transfer(self):
|
||||
"""Test planned transfer."""
|
||||
wizard = self._create_wizard(self.internal_loc_1, self.internal_loc_2)
|
||||
|
||||
@@ -292,8 +292,8 @@ class StockMoveLocationWizard(models.TransientModel):
|
||||
product_data.append(
|
||||
{
|
||||
"product_id": product.id,
|
||||
"move_quantity": group.get("quantity"),
|
||||
"max_quantity": group.get("quantity"),
|
||||
"move_quantity": group.get("quantity") or 0,
|
||||
"max_quantity": group.get("quantity") or 0,
|
||||
"reserved_quantity": group.get("reserved_quantity"),
|
||||
"origin_location_id": self.origin_location_id.id,
|
||||
"destination_location_id": location_dest_id,
|
||||
|
||||
Reference in New Issue
Block a user