summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHetashree Chauhan <hch@odoo.com>2019-06-19 06:45:46 +0000
committerHetashree Chauhan <hch@odoo.com>2019-07-11 13:12:09 +0000
commit0dff7da0b45a5f49941b88be38267483a49ec8e2 (patch)
treec52b012cf03ac4684cf461fd9500f00cfb51cadd
parent7c70fbe5b8411394704c5c78f3f6c8fdc384d63f (diff)
[IMP] stock: pass tests without demo data for file test_warehouse.
pass all test cases without any demo data. If a user has not installed any demo data, then also test cases must not be break. task-2024202 closes : https://github.com/odoo/odoo/pull/34258
-rw-r--r--addons/stock/tests/test_warehouse.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/addons/stock/tests/test_warehouse.py b/addons/stock/tests/test_warehouse.py
index 413f3d45d4c..8867f098761 100644
--- a/addons/stock/tests/test_warehouse.py
+++ b/addons/stock/tests/test_warehouse.py
@@ -6,6 +6,11 @@ from odoo.exceptions import AccessError
class TestWarehouse(TestStockCommon):
+
+ def setUp(self):
+ super(TestWarehouse, self).setUp()
+ self.partner = self.env['res.partner'].create({'name': 'Deco Addict'})
+
def test_inventory_product(self):
self.product_1.type = 'product'
product_1_quant = self.env['stock.quant'].with_context(inventory_mode=True).create({
@@ -90,7 +95,7 @@ class TestWarehouse(TestStockCommon):
product = self.product_3.with_user(self.user_stock_manager)
product.type = 'product'
picking_out = self.env['stock.picking'].create({
- 'partner_id': self.env.ref('base.res_partner_2').id,
+ 'partner_id': self.partner.id,
'picking_type_id': self.env.ref('stock.picking_type_out').id,
'location_id': self.warehouse_1.lot_stock_id.id,
'location_dest_id': self.env.ref('stock.stock_location_customers').id,
@@ -151,7 +156,7 @@ class TestWarehouse(TestStockCommon):
# Create a picking out and force availability
picking_out = self.env['stock.picking'].create({
- 'partner_id': self.env.ref('base.res_partner_2').id,
+ 'partner_id': self.partner.id,
'picking_type_id': self.env.ref('stock.picking_type_out').id,
'location_id': stock_location.id,
'location_dest_id': customer_location.id,
@@ -194,7 +199,7 @@ class TestWarehouse(TestStockCommon):
# Create a picking out and force availability
picking_out = self.env['stock.picking'].create({
- 'partner_id': self.env.ref('base.res_partner_2').id,
+ 'partner_id': self.partner.id,
'picking_type_id': self.env.ref('stock.picking_type_out').id,
'location_id': stock_location.id,
'location_dest_id': customer_location.id,
@@ -279,7 +284,7 @@ class TestWarehouse(TestStockCommon):
})
picking_out = self.env['stock.picking'].create({
- 'partner_id': self.env.ref('base.res_partner_2').id,
+ 'partner_id': self.partner.id,
'picking_type_id': self.env.ref('stock.picking_type_out').id,
'location_id': warehouse_shop.lot_stock_id.id,
'location_dest_id': self.env.ref('stock.stock_location_customers').id,
@@ -359,7 +364,7 @@ class TestWarehouse(TestStockCommon):
# Create the move for the shop Namur. Should create a resupply from
# distribution warehouse Namur.
picking_out_namur = self.env['stock.picking'].create({
- 'partner_id': self.env.ref('base.res_partner_2').id,
+ 'partner_id': self.partner.id,
'picking_type_id': self.env.ref('stock.picking_type_out').id,
'location_id': warehouse_shop_namur.lot_stock_id.id,
'location_dest_id': customer_location.id,
@@ -403,7 +408,7 @@ class TestWarehouse(TestStockCommon):
# Create the move for the shop Wavre. Should create a resupply from
# distribution warehouse Wavre.
picking_out_wavre = self.env['stock.picking'].create({
- 'partner_id': self.env.ref('base.res_partner_2').id,
+ 'partner_id': self.partner.id,
'picking_type_id': self.env.ref('stock.picking_type_out').id,
'location_id': warehouse_shop_wavre.lot_stock_id.id,
'location_dest_id': customer_location.id,