As done with the "done" state, if a single picking in a batch is
cancelled while the other pickings aren't, this picking is removed from
the batch, as it would create inconsistencies between the states of the
pickings in a single batch.
closesodoo/odoo#90449
X-original-commit: 1f2813e59970cd2eb078b514cd7d563837f175a1
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
Steps to reproduce the bug:
- Create a batch transfer with several pickings
- Confirm it
- Delete all the pickings > save
Problem:
The batch does not cancel as it should’ve been
A batch without transfers cannot be confirmed, so it makes no sense to leave a confirmed batch without transfers
opw-2792471
closesodoo/odoo#90104
X-original-commit: dcbf08edbb3a1ec49e84f0828b8f49ac4f836c25
Signed-off-by: Steve Van Essche <svs@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
Current behavior:
All batch transfers are shown in the tree view. But only the one for the allowed companies should be in the list
Steps to reproduce:
- Be in a multicompany environnement
- Activate batch picking
- Go in Inventory/Batch transfers
opw-2752617
closesodoo/odoo#86531
X-original-commit: 8415b48cae06124911f08fe6c01b029ed80e6286
Signed-off-by: Tiffany Chang <tic@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
Steps to reproduce the bug:
- Create a batch transfer with moves from the same warehouse to several locations, e.g:
- Product A from `WH/stock` → `customer/stock1`
- Product B from `WH/stock` → `customer/stock2`
- Try to print the batch transfers
Problem:
Traceback is triggered because we do a loop only on location_from
Solution:
- We need to loop over location_from and location destination
- Remove useless use of mapped
opw-2768518
closesodoo/odoo#86082
X-original-commit: 6721d1dfe53fb8d301188f2fb4c21baa70c27b92
Signed-off-by: Steve Van Essche <svs@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
This commit modifies most of the usages of read_group and uses
_read_group instead. _read_group doesn't join automatically on the
many2one fields when no order_by is specified, making it more performant
when the "name" of the many2one is not relevant, which is the case for
most back-end cases
closesodoo/odoo#84908
Task-id: 2479334
Related: odoo/enterprise#24877
Signed-off-by: Raphael Collet <rco@odoo.com>
If a picking is in a batch, the point is to process it as a whole. Yet,
it is possible to validate a single picking (putting it in a 'done'
state), inside of an 'in_progress' batch. This raises inconsistencies
between the state of the batch as a whole and the state of some of it
pickings.
Therefore, when a single batched picking is validated in a batch that
still contains other non-done pickings, the picking is removed from the
batch.
closesodoo/odoo#85324
X-original-commit: e9602d6b28331f68a83b5ce8a06a2ffc8ac3453d
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
Usecase to reproduce:
- Product A 0 unit in stock
- Product B 10 unit in stock
- Create planned delivery with product A and B
- Do a wave transfer and selected reserved `stock.move.line` from
product B
Current behavior:
The whole picking is move into the batch
Desired behavior:
The picking is splitted and only the move for product B is in a new
batch
It happens because the add_to_wave function check if all the picking
`stock.move.line` are in the `stock.move.line` to batch. If it's the
case, it moves the picking in the new batch. However in our case,
some `stock.move` are not reserve and should not be move in the new
batch. Also check if all the quantity is reserve on the `stock.move`
if it's not the case split the move to only put the reserve quantity
in the wave picking
closesodoo/odoo#85038
X-original-commit: afe2a3a7f913459d88ef197e63bc897fda5f90f8
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Usecase to reproduce:
- Create an immediate transfer and enable detailed opeations on the
picking type
- Create 2 `stock.move.line` with qty_done = 5
- Add the picking to a new wave and select only one of the sml
Traceback
It happens because the move split is base on the reserved quantity.
However in the case of an immediate transfer, the reserved quantity is
zero and the split fail
X-original-commit: 709372b0160a93cb9c30d391c4b3fc6c07ea2f9a
Part-of: odoo/odoo#85038
Usecase to reproduce:
Create a transfer with 3 moves for 3 products:
A - qty 60 (2 move lines, each move line has a quantity of 30)
B - qty 40 (2 move lines, each move line has a quantity of 20)
C - qty 40 (2 move lines, each move line has a quantity of 20)
Create a new wave picking containing the first move lines of each product (3 move lines)
Traceback
The error is due since it take all the `stock.move.line` from the
picking instead of the `stock.move` that is browsed
Fix#83450
X-original-commit: 788d08bb64204a0cb1c696f89228f6b4ae8d9620
Part-of: odoo/odoo#85038
Usecase to reproduce:
- Create a batch picking from a new location to customer
- Put some `stock.move.line` in a wave
- Validate the remaining of the initial `stock.picking`
- Create a new `stock.move` with the same data and without `picking_id`
Current behavior
The stock.move is added to the existing wave. However the
stock.move.line created could not match the current wave specification
Expected behavior
A new picking is created and it could be merge in the wave picking if
wanted
closesodoo/odoo#84875
X-original-commit: 4ea418ed1cceff4aee916cf791011a1dc67c77a1
Signed-off-by: Arnold Moyaux <arm@odoo.com>
While the batch is currently visible on the tree view, there was no
current link to a picking's batch while in the form view.
Task-2670580
closesodoo/odoo#81533
Related: odoo/upgrade#3205
Related: odoo/enterprise#23484
Signed-off-by: Arnold Moyaux <arm@odoo.com>
When adding a selection of pickings from the list, select the 'create a
new batch' over 'add to existing batch' as it better reflects user's
usual flow.
Task-2670580
Part-of: odoo/odoo#81533
Allow confirmed pickings to be automatically put into batches that match the
group criterias defined in their picking_type.
The pickings can be grouped by :
- Contact
- Destination Country
- Source location
- Destination location
To avoid having batches too big then, some restrictions can be put over
the auto-batcher to restrict the size of a batch :
- Max moves per batch
- Max pickings per batch
Task-2670580
Part-of: odoo/odoo#81533
Before this commit we could print the product labels of a picking from a
picking, but we couldn't print only the lots/sns. This commit adds in
this ability. Because we want to be flexible with this label printing
(i.e. have the option to choose between printing zpl or pdf + 1 per
unit or per lot/sn), we include it in the general "Print Labels" button
with additional wizards.
Note that we assume:
1. If there are no lot_ids in the picking => default to only product
labels wizard (i.e. this also means if a picking that only creates
New Lots/SN, lots/sns will not be printable until picking is
validated.)
2. Lots/SN PDF labels will only be in the 4x12 label format
3. Batch pickings can also print lot/sn labels
Part of task: 2494740
Related ENT PR: odoo/enterprise#23323closesodoo/odoo#82389
Related: odoo/upgrade#3202
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Steps to reproduce the bug:
- Create two batches, one with picking and one without
- Try to compute their state together with an RPC call
Problem:
If the first has no picking, the second batch does not compute state because we use `”return”` instead of `”continue”`
opw-2725988
closesodoo/odoo#82671
X-original-commit: 0242fcee2618425bd87846d818cffcd368c25121
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
This commit rename product_uom_qty into reserved_uom_qty and product_qty
into reserved_qty on stock move line to stop mistake them with the stock
move quantities fields.
Task: 2648449
Part-of: odoo/odoo#80434
Add a "clear qty" button to revert the change by "set qty" button in
(batch) picking.
On the move, Whenever the qty_done != reserved, we consider it a
manual change from the user. "set/clear qty" buttons won't change the
line with manual change.
Show "set qty" button when there are moves with 0 qty_done and non-zero
reserved. Show "clear qty" button when we don't show "set qty" button
and there are moves with qty done == reserved but the number is not 0.
Task-2659233
closesodoo/odoo#78737
Signed-off-by: Steve Van Essche <svs@odoo.com>
Currently, the order of transfer lines makes no sense for a picker
(it's in the order of the creation of the line). We want to have the
lines of the detailed operation in the same order as the picker will be
picking the products, so we order by source location, destination
location, sequence, and then by id (i.e. creation time) respectively
instead.
Also the printing report of the batch transfer is on too many pages,
it's one page by location, but we always group on 'from location'.
So it would be better not to split by location and keep the report
on the least number of pages possible.
task-2496324
odoo/enterprise#21921closesodoo/odoo#79446
X-original-commit: 9b120caa2a5cd5e2487d663a180b486b5bdb201b
Related: odoo/enterprise#22144
Signed-off-by: Tiffany Chang <tic@odoo.com>
Simplify user workflow by not showing the "Allocation" button in the
(batch) picking form view if there is nothing to allocate (i.e. when
reception report is enabled).
Also:
- fix the location search condition for the outgoing moves that can
be allocated to (i.e. the same logic used in show_allocation field
compute logic is also used in reception report generation/auto-opening)
- replace ['stock.location'].search() with ._search() for better
performance.
Part of Task: 2632884
ENT PR (for barcode equivalent): odoo/enterprise#20805
X-original-commit: 11ffb85fe7398854e4aefa4f9d0cfbc3b88aad8a
Part-of: odoo/odoo#79408
In a lot of test class, we use `setUp` instead of
`setUpClass`. `setUp` is execute for each test method and `setUpClass`
will be execute only once by Class (and use savepoint + rollback).
Then change setUp into setUpClass reduce the time to make all tests
and avoid to repeat this error for the future.
closesodoo/odoo#78082
Related: odoo/enterprise#21563
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
The widget many2onebutton doesn't exist anymore. As the web client
fallbacked on the default many2one widget. The behavior was the intended
one but with a warning in the logs. This commit uses the proper widget
to avoid the unintentional warning
closesodoo/odoo#76882
X-original-commit: 4547cbff9f2850fcfcd536a574fd5c29c44ecdb5
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
Before this commit. The move splitting was not considering _split return
a list of values.
This commit also add a bunche of missing tests
Task : 2411102
closesodoo/odoo#76371
X-original-commit: 49164aa65f4eea0e46fff207c841beb94154f636
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
Commit 04f3cac527 makes picking_type_id compute on stock_move_line to
get the picking type of either the picking or the manufacturing order.
Right after, commit dd53f5323f set picking_type_id related of the
picking one to be able to search on it. (in this later scope,
manufacturing part was not needed, hence the related instead of compute.
This commit mix the two idea by having a new search function on the
computed fields to filter stock move line depending on their picking
type.
X-original-commit: d535108f96d62f217dda7cbb676f9d60b7477f4f
Part-of: odoo/odoo#76294
If a picking is totally empty (no move line with quantity recorded) in a
batch at validation. This one will be ignored by the immediate transfer
mechanism as well as the backorder creation. It is simply remove from
the batch.
closesodoo/odoo#63291
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
This commit adds a quick access to all the batches and waves of a picking
type (only transfers picking type) ready to be processed from the
Inventory dashboard.
Task : 2411102
Part-of: odoo/odoo#63291
This commit introduce Wave Pickings. This new object is a group of stock
move lines related to different pickings. The goal is to group stock
movements having similar characteristics like same source location, same
product category, ...
Wave pickings are created from stock move lines. Those are removed from
their picking to a copy of it. All the new picking are grouped together
in a new batch picking. This batch is the wave.
To differentiate the batch pickings and the wave pickings. This commit
introduces a new menu and a new sequence.
Task : 2411102
Part-of: odoo/odoo#63291
This commit removes the pdf and zpl reports for product templates and
variants. Instead, labels are printed via a new wizard allowing to
specify the label quantity, format and optional text.
There are a bunch of usual retail label sizes in pdf or zpl code
Task : 2501730
closesodoo/odoo#69690
Related: odoo/enterprise#20246
Related: odoo/upgrade#2542
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
New reception report added for non-outgoing transfers. This is intended
to support easier stock allocations by allowing dynamic MTO
assignment/unassignment, e.g. if we have an incoming transfer with
products we want to assign to an existing outgoing transfer, then we can
use the report to create a MTO link to the specific outgoing moves. To
support this assignment flow, the report also allows printing of labels
to place on the product so stock workers know which transfer/MO the
product has been assigned to.
Expected use case is when a product is purchased to fulfil a sale.
Demo data has been added so reception report can be immediately
seen/used for this flow.
Implementation Notes:
- Report has been made flexible to work with batch transfers.
- Only done moves can be assigned to moves that already have quants
reserved (prevents undesired behavior + this makes sense logically)
- Confirmed (+ Done and everything inbetween) moves can be assigned to
any confirmed moves that are not already assigned.
- Report does not affect quant reservation/unreservation at all. It
works only with linking moves (i.e. move_orig_id/move_dest_id) so
move/transfer linkage traceability is stored within db (i.e. this
isn't possible with quants)
Limitations: To keep code simple for now, this assignment flow will
break in certain cases:
1. Done amount of an assigned move is less than the Demand amount
(linked move will not autoreserve correctly when assigned move is
validated, same issue already occurs in multi-step transfer).
2. If a linked move is unreserved after its assigned move is
validated, then another move can reserve its quants and its
assignment link will not be accurate.
3. Already reserved SNs + assign move, may lead to mismatching SNs
between report and what's actually reserved.
4. Changing a linked move's Demand amount after a move is assigned to
it.
5. Potential moves to assign to are only checked for being in same
warehouse, not in a matching source location to destination location.
User is expected to make this match on their own.
Task: 2500844
ENT PR: odoo/enterprise#18268
Upgrade PR: odoo/upgrade#2731closesodoo/odoo#70669
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
The license is missing in most enterprise manifest so
the decision was taken to make it explicit in all cases.
When not defined, a warning will be triggered starting from
14.0 when falling back on the default LGPL-3.
closesodoo/odoo#74245
Related: odoo/design-themes#48
Related: odoo/enterprise#19862
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Define `data-hotkey` on most used action buttons.
For the modals, the following keys are dedicated for "special"
actions:
- Alt+G: add
- Alt+V: save
- Alt+Z: cancel
closesodoo/odoo#73275
Taskid: 2588233
Related: odoo/enterprise#19464
Signed-off-by: Kevin Baptiste <kba@odoo.com>