mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[12.0][ADD] stock_request_submit
This commit is contained in:
1
stock_request_submit/tests/__init__.py
Normal file
1
stock_request_submit/tests/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import test_stock_request_submit
|
||||
41
stock_request_submit/tests/test_stock_request_submit.py
Normal file
41
stock_request_submit/tests/test_stock_request_submit.py
Normal file
@@ -0,0 +1,41 @@
|
||||
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
|
||||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl-3.0).
|
||||
from odoo import fields
|
||||
from odoo.addons.stock_request.tests import test_stock_request
|
||||
|
||||
|
||||
class TestStockRequestSubmit(test_stock_request.TestStockRequest):
|
||||
|
||||
def setUp(self):
|
||||
super(TestStockRequestSubmit, self).setUp()
|
||||
|
||||
def test_stock_request_submit(self):
|
||||
expected_date = fields.Date.today()
|
||||
vals = {
|
||||
'company_id': self.main_company.id,
|
||||
'warehouse_id': self.warehouse.id,
|
||||
'location_id': self.warehouse.lot_stock_id.id,
|
||||
'expected_date': expected_date,
|
||||
'stock_request_ids': [(0, 0, {
|
||||
'product_id': self.product.id,
|
||||
'product_uom_id': self.product.uom_id.id,
|
||||
'product_uom_qty': 5.0,
|
||||
'company_id': self.main_company.id,
|
||||
'warehouse_id': self.warehouse.id,
|
||||
'location_id': self.warehouse.lot_stock_id.id,
|
||||
'expected_date': expected_date,
|
||||
})]
|
||||
}
|
||||
|
||||
order = self.request_order.sudo(
|
||||
self.stock_request_user).create(vals)
|
||||
|
||||
stock_request = order.stock_request_ids
|
||||
|
||||
self.product.route_ids = [(6, 0, self.route.ids)]
|
||||
order.action_submit()
|
||||
self.assertEqual(order.state, 'submitted')
|
||||
self.assertEqual(stock_request.state, 'submitted')
|
||||
order.action_confirm()
|
||||
self.assertEqual(order.state, 'open')
|
||||
self.assertEqual(stock_request.state, 'open')
|
||||
Reference in New Issue
Block a user