This commit removes stock.inventory(.line) and moves its general functionality into stock.quant. Some features are lost during this switch as well. Feature Additions: - New single list view for inventory adjustments (no more multiple inventory adjustment records to keep track of!) - Improved cyclic counts (annual inventory day setting) + next inventory dates are immediately viewable in view (vs auto-generated inventories based only on location) - Specific quants (i.e. counts) can be assigned to users for more flexibility (vs only able to restrict by location + product combinations) - Counts can be requested (i.e. bulk assigned to user/for a specific inventory date) Feature Removals: - Can no longer look at previous inventory adjustments linked to a specific record. Each quant has a history button to show inventory related moves. [relevant account moves are also now harder to see via stock as well] Other changes: - Bulk of changes were for demo/test - Some changes were done to ensure "Update Quantity"/"Inventory Report" views still mainly function the same as before with the exception of a new column added to support updating quant quantities in these views. Task: 2440026 ENT PR: odoo/enterprise#17329 Upgrade PR: odoo/upgrade#2326 closes odoo/odoo#68409 Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
58 lines
2.0 KiB
Python
58 lines
2.0 KiB
Python
# -*- coding: utf-8 -*-
|
|
|
|
from odoo.addons.mail.tests.common import mail_new_test_user
|
|
from odoo.addons.product.tests import common
|
|
|
|
|
|
class TestStockCommon(common.TestProductCommon):
|
|
|
|
def _create_move(self, product, src_location, dst_location, **values):
|
|
# TDE FIXME: user as parameter
|
|
Move = self.env['stock.move'].with_user(self.user_stock_manager)
|
|
# simulate create + onchange
|
|
move = Move.new({'product_id': product.id, 'location_id': src_location.id, 'location_dest_id': dst_location.id})
|
|
move._onchange_product_id()
|
|
move_values = move._convert_to_write(move._cache)
|
|
move_values.update(**values)
|
|
return Move.create(move_values)
|
|
|
|
@classmethod
|
|
def setUpClass(cls):
|
|
super(TestStockCommon, cls).setUpClass()
|
|
|
|
# User Data: stock user and stock manager
|
|
cls.user_stock_user = mail_new_test_user(
|
|
cls.env,
|
|
name='Pauline Poivraisselle',
|
|
login='pauline',
|
|
email='p.p@example.com',
|
|
notification_type='inbox',
|
|
groups='stock.group_stock_user',
|
|
)
|
|
cls.user_stock_manager = mail_new_test_user(
|
|
cls.env,
|
|
name='Julie Tablier',
|
|
login='julie',
|
|
email='j.j@example.com',
|
|
notification_type='inbox',
|
|
groups='stock.group_stock_manager',
|
|
)
|
|
|
|
# Warehouses
|
|
cls.warehouse_1 = cls.env['stock.warehouse'].create({
|
|
'name': 'Base Warehouse',
|
|
'reception_steps': 'one_step',
|
|
'delivery_steps': 'ship_only',
|
|
'code': 'BWH'})
|
|
|
|
# Locations
|
|
cls.location_1 = cls.env['stock.location'].create({
|
|
'name': 'TestLocation1',
|
|
'posx': 3,
|
|
'location_id': cls.warehouse_1.lot_stock_id.id,
|
|
})
|
|
|
|
# Existing data
|
|
cls.existing_inventories = cls.env['stock.quant'].search([('inventory_quantity', '!=', 0.0)])
|
|
cls.existing_quants = cls.env['stock.quant'].search([])
|