Commit Graph
25 Commits
Author SHA1 Message Date
William Henrotin 6a23b9bcd6 [REF] *stock*: rename model stock.production.lot into stock.lot
Task: 2648449
Part-of: odoo/odoo#80434
2021-12-07 16:20:05 +00:00
Martin Trigaux c7bac3dee0 [IMP] *: make ir.model.data helper private
No reason to interfact with them directly in RPC
2021-08-10 13:49:04 +02:00
Arnold Moyaux bdcb3d192b [REF] stock: move stock.inventory feature into stock.quant
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>
2021-04-02 11:51:38 +00:00
Tiffany Chang (tic) c7f53f770c [IMP] mrp, (purchase_)stock: improve move reservation
Currently stock moves are auto-assigned (i.e. reserve free stock) both
when the scheduler is run and when a corresponding stock move that can
assign a move is completed. This strictness was causing issues for
prioritization of moves to assign, for example a picking with a
scheduled_date far in the future could automatically reserve all stock
if it was created before another picking that an immediate
scheduled_date. To ease this, an extra setting has been added to
stock.picking.type to let users choose how reservations should occur for
moves assigned to that picking_type (or picking with that picking_type):

1. 'at_confirm' = automatically when:
   - stock is available when the move's associated picking/MO is
   confirmed,
   - when new stock becomes available,
   - when the scheduler is triggered (+ stock available).
2. 'manual' = user must always manually click "Check Availability"
   button (scheduler will no longer reserve).
3. 'by_date' = automatically when within the move's reservation_date
   and:
   - stock is available when the move's associated picking/MO is
   confirmed,
   - new stock becomes available when move is already confirmed, or
   - the scheduler is run (+ stock is available).

'by_date' has an extra option of # days before the move's scheduled
date that affects the move.reservation_date.

Task: 2359317
Upgrade PR: odoo/upgrade#1868
ENT PR: odoo/enterprise#15050
2020-11-30 16:28:47 +00:00
Raphael Collet 1398b6b44c [IMP] tests: deprecate SavepointCase
closes odoo/odoo#62031

Related: odoo/enterprise#14872
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-11-24 13:23:32 +00:00
Simon Lejeune 5c8342f9b5 [REF] stock: tests common
This class referenced demo data but even if they weren't installed, the
tests were passing. Remove the definition and usages.

closes odoo/odoo#35343

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-07-31 13:20:38 +00:00
Simon Lejeune c5ff803fcc [REF] stock: speedup tests
before on runbot:
odoo.addons.stock.tests.test_move tested in 31.79s, 63166 queries
odoo.addons.stock.tests.test_move2 tested in 33.69s, 68046 queries
odoo.addons.stock.tests.test_quant tested in 8.48s, 15351 queries
odoo.addons.stock.tests.test_stock_flow tested in 16.99s, 31506 queries
amounting to 90 seconds on a build page

after om runbot:
odoo.addons.stock.tests.test_move tested in 12.41s, 24197 queries
odoo.addons.stock.tests.test_move2 tested in 13.55s, 24254 queries
odoo.addons.stock.tests.test_stock_flow tested in 9.74s, 15795 queries
amounting to 37 seconds on a build page

Use savepoint case instead of transaction case.

We took the opportunity to rename the master data more appropriately,
which results now in a bigger diff in TestMove and TestQuant. In
TestQuant, the master data creation had to be moved in the setUpClass
too.

We removed test_shipment as test_backorder_1-4 in tet_move_2 covers the
same parts of the code.
2019-04-15 07:32:32 +00:00
Christophe Simonis b06af028e6 [MERGE] forward port branch saas-11.2 up to d112a163cd 2018-06-28 10:55:12 +02:00
Nicolas Martinelli a0173bbbce [FIX] stock: fix test setup 2018-06-28 08:35:23 +02:00
Christophe Simonis 9dcc32c304 [FIX] stock: avoid useless changes on UoM in tests setUp 2018-06-27 20:14:47 +02:00
jem-odoo e0ed50a724 [IMP] uom: unique reference UoM per category
Users can configure multiple references in a same
category. This might cause problems during conversion
and does not make sense.
Since this is a "late" constraint, we define it in
python to avoid conflict with existing data.
We allow user to have multiple unactive reference, but
force to have exactly one active. So when a new UoM
category is created, user have to encode the reference
unit first, and then the bigger/smaller ones.

This commit also update stock tests, since they were
redefining new reference UoM in the same category, and
finally, this commit provides some tests for this
uniqueness and custom UoM behavior.

Task #1820076
2018-04-09 10:13:18 +02:00
Simon Lejeune 79d1529c57 [FIX] stock: tests and inactive locations
`child_of` used to return inactive records, it doesn't anymore
2018-02-28 10:33:44 +01:00
XavierDo 2966d4faed [IMP] product: rename product.uom into uom.uom
Also rename product.uom.categ into uom.category to
 give it a decent name.
2018-02-26 14:27:26 +01:00
XavierDo 6a378e3839 [IMP] product: move uom in a new addon
Moves UoM models, test and data to a new addon in
order to be able to use uom without product.
A simple example is be to be able to use UoM for
timesheets.

This commit only move code, and adapt xml ids
without chaging any feature or functionnal
behavior.
Note: 'product' module now depends on new
'uom' module.
2018-02-26 14:27:26 +01:00
amoyaux b970bf865a [FIX] stock: unable to return SN in chained moves
Use case to reproduce the bug:
- Set multi location in settings
- Set warehouse's deliery method as pick/pack/ship
- Deliver a product to customer
- Process a return from customer to output.
- Create a return from output to pack ->
Unable to reserver product.

It happens because return moves where not linked together but have
the picking that created the return as origin.
Thus action_assign does not detect the return moves and can't
guess the real quantity available.

This commit add a behavior that will create links between
return move. It can be guess from parent move(the picking's move from which
the return is created) and its move dest/orig that have already
created other return. It also correct action assign because
the group by could retourn same line with return moves.
It add a test that check returns and links between them.
2017-08-17 17:49:09 +02:00
Simon Lejeune ddf2b21bdf [REF] stock: adapt to rename of stock.pack.operation into stock.mode.line 2017-07-14 17:08:22 +02:00
Christophe Simonis 3b2f4e244f [MERGE] forward port branch 9.0 up to 7ee09ed 2016-11-17 14:37:19 +01:00
Christophe Simonis 7ee09ed0c1 [MERGE] forward port branch saas-6 up to 6d8d7a5 2016-11-17 13:11:04 +01:00
Josse Colpaert 1de37862d6 [FIX] stock: when matching moves with pack operations through quants, it did not match the packages correctly. Courtesy of Pedro Baeza
Before, it did a search to see if the package existed,
but the only thing it needs to do is see if the package
on the pack operation corresponds to that of the quant.  (no need to check children also)

There is a test added:
A picking with 120 pieces incoming, 120 in pack 1, 80 in pack2
When we deliver those in a picking out, with product pack operations: (by taking them out of the pack)

120 from pack 1 and 80 from pack2,
we should only have 2 quants and links between moves in the end

And before, it generated 3 because it matched the wrong quants and made the wrong links.

opw 693760 closes #13836
2016-11-16 11:26:20 +01:00
Christophe Simonis f93bada93e [MERGE] forward port branch 9.0 up to fb763f3 2016-11-14 14:56:14 +01:00
Pierre Masereel e248420348 [ADD] stock: test put pack in pack
We add a test checking that we can put a pack in a another pack.
2016-11-09 15:15:30 +01:00
Pierre Masereel 0d33621ad3 [FIX] stock: tests on stockable product
The tests are running on consumable product, it means that there is no
resevation of quants and verification of reserved quants when you create
and assign moves. So the tests are not really usefull with consumable
products.

To make the tests efficients, we set the products as stockable. And we
use 'reserved_availability' instead of 'availability' in tests
'test_10_pickings_transfer_with_different_uom' and in
'test_00_picking_create_and_transfer_quantity' be cause the assert is
done after the move reservation.

In test 'test_00_picking_create_and_transfer_quantity' when we check the
move_lines state after the action assign, the first and last should be
only 'confirmed, because they are partially available. When product
were not stockable, all lines were assign, because there was no check of
the reserved quants.

In 'test_10_pickings_transfer_with_different_uom' we removed the call
'picking_out.action_confirm()' and 'picking_out.action_assign()',
because they already have been called before.
2016-11-09 15:15:30 +01:00
Thibault Delavallée c287ed4c34 [TESTS] stock: Reactivate and update new Py tests 2016-04-29 12:18:50 +02:00
Josse Colpaert 9d662e4798 [FIX] stock: add extra tests for lots and fix problem subtracting remaining qties
In this test, we set the incoming picking type not
to require any lots.  The outgoing picking requires lots
and should convert the stock without lot into stock with lot.
2015-09-29 15:09:00 +02:00
jir 6c23a9ca19 [ADD] Test cases of stock in new api. 2015-01-06 17:05:11 +01:00