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>
This commit loosens 2 things:
1. A batch can now be deleted for all statuses except 'done'
2. Cancelled batches will now remove links to any pickings assigned to
it (so they can be more easily reassigned in barcode app)
closesodoo/odoo#68898
Task: 2486993
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Before this commit, suppose we have a scenario like below
Task-A:
Activity-1:
name: Email ( Today )
Assigned to: User-1
Task-B:
Activity-1:
name: Email ( Today )
assigned to: User-2
Activity-2:
name: Call ( Due in 3 Days )
assigned to: User-1
When User-1 goes through the systray 'Today' filter shortcut he gets both
Task-A and Task-B in the list instead of only Task-A. Indeed currently
activities are not filtered based on current user with its deadlines.
However purpose of systray is to indicate activities current user has to
perform instead of global activities.
After this commit activities will be filtered based on deadlines as well as the
current user. In order to achieve this behavior we needed to pass a domain like
[
('activity_ids.date_deadline','=', fields.Date.today()),
('activity_ids.user_id','=', 1)
]
And for that purpose we introduced a non-stored compute field with a search
method.
Task ID-2438822
COM PR odoo/odoo#72219
X-original-commit: f4eaf4d8fb2f97240201104dcd4fc7e2674bce02
As pickings can be moved from a batch into an another one, a batch can suddenly
be emptied or having no more active pickings.In such case, we cancel it.
This way, empty batches won't be displayed by default as there is a default
filter showing only draft or in progress batches.
If we manually remove all pickings from a batch or create a empty batch, we
consider it intentional, and won't cancel it automatically.
Task-2464457
PR #66600
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
batch
We already allowed the stock.picking.to.batch wizard to create batch
with pickings already in other batches. This commit will also allow you
select pickings that are already in other batches on the batch form.
Task-2464457
PR #66600
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#2326closesodoo/odoo#68409
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
When you want to validate a picking with a lot of products, the system notifies "You have not recorded done quantities yet, by clicking on apply Odoo will process all the quantities."
Nice and easy, except when you were not able to process all the quantities.
In that case you have to update all but the few lines manually.
Also added to batch pickings
task-2158092
closesodoo/odoo#58487
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
When using the route `/report/barcode/...` in a report, wkhtmltopdf
makes htpps requests on the server to retrieve the barcode image.
If a lot of barcodes have to be printed, this can overload the server
with too much requests and makes wkhtml crashes.
With this commit, the qweb barcode widget is used to include the barcode
as an img tag with inline barcode image as base64 data.
closesodoo/odoo#64211
Related: odoo/enterprise#15619
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
With this commit, all instances of errors being raised inside
`BaseModel.unlink` overrides are moved into methods decorated with
`api.ondelete` which is safer.
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
Decreases the move lines qty to process for the picking batch #1 in
order to make the demo flux quicker.
closesodoo/odoo#58909
X-original-commit: 15cede0cbef24f7a1ec3a205aee8155e908a2404
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Various attributes use state field to control display of nodes: like the
'states' (visibility), statusbar_visible (available status in status bar).
In this commit we fix various incorrect state values as those are either
typos, either references to dead or removed status.
An heuristic to detect invalid state for conditions will land soon in master.
As this commit targets a stable version only view fixes are provided.
Task ID-2329114
PR odoo/odoo#56946
X-original-commit: b4e1e9f3ae86e6b5e7015c0241791f733ee942f4
Change the demo data to create pickings/picking batchs about deliveries
instead of internal transfers.
Made this change because multi-location is disabled by default so it
doesn't make sense to work with internal transfer with this config.
Also, renames these data records reference to avoid migration issue as
the pickings/picking batches picking type was changed.
Adds a second picking in the batch picking BATCH/00001 because it
doesn't make sense to have a batch picking for only one picking.
X-original-commit: ff2d4d77019a137008a7af5b0742c9ababeb5df9
This commit makes it so when a stock_picking_batch report with 1+
SN/lot values assigned is printed, then the rows without a SN/lot value
will properly align the rest of its values afterwards (i.e. keep
product barcodes from printing in Lot/SN column).
Discovered during overall barcode improvement task.
Task: 1884520
Closes: odoo/odoo#55096
This commit sets up the logic and adds the button for "Put in Pack"
action that already exists in stock.picking. Reuse/extension of logic
from stock.picking reused where possible, including extension of pack
wizard to handle products with different destination.
Note that logic to handle "Delivery Packaging" wizard when "Delivery
Methods" is active was purposely not extended to work correctly in batch
pickings due to complexity of adding in a new module just to handle
conflicting carrier_ids across pickings in the same batch. It is
expected that this use case will not occur except in case of user error.
Additionally, stock.picking implementation of 'put_in_pack' method has
been renamed to 'action_put_in_pack' to have consistent naming (and
support enterprise level code).
Part of "1. Improve Batch Pickings" specification of overall barcode
improvements task.
Task: 1884520
Enterprise PR: odoo/enterprise#12086Closes: odoo/odoo#55096
This commit adds the source and destination package fields to the form
of batch stock pickings.
Part of "1. Improve Batch Pickings" specification of overall barcode
improvements task.
Task: 1884520
Related Enterprise PR: odoo/enterprise#12086Closes: odoo/odoo#55096
This commit adds a "Scheduled Date" field to the batch pickings. Logic
behind this date is a bit tricky:
1. If "Scheduled Date" is edited directly in batch then this date will
also be applied to all of its picking's "Schedule Date"s.
2. If "Scheduled Date" is not edited directly in the batch, then this
date will be the earliest date of its assigned pickings and pickings
will maintain their original scheduled date' including if picking
scheduled date is changed.
3. If "Scheduled Date" is not edited directly and all pickings are
removed or there are none then date will default to no date.
First cut of test for scheduled_date logic has also been added. Update
will be needed for testing onchange logic since it is currently not
supported by the tests.Form due to M2M widget used with O2M picking_ids
(M2M widget is used for when doing a "Add a Line" transfer to a batch
in backend).
Additionally this commit adds the 'scheduled_date' and 'operation_type' to
the kanban view.
Part of "1. Improve Batch Pickings" specification of overall barcode app
improvements task.
Task: 1884520
Enterprise PR: odoo/enterprise#12086
Upgrade PR: odoo/upgrade#1569Closes: odoo/odoo#55096
- MO/picking/PO/stock.move have now the "same" `priority` fields
(Boolean logic: Normal or Urgent).
These models are now sort by priority first. Note that the priority field of
stock move is a technical one.
- For MO and picking, the set of `priority` field change priority of
the related stock move. The prioriry field on stock move is
used by the scheduler for reservation ('Urgent' before 'Normal')
- The Stock Replenishment Report also take in account the priority
to be consistent with the reservation.
task-2246665
Replace wrong usages of any(list|recordset), by any(generator)
to speed up computations, avoiding list creations and/or looping twice on a recordset
for nothing.
any([generator]) => any(generator)
any(filtered) => any(generator)
closesodoo/odoo#55768
Related: odoo/enterprise#12360
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
1) Wrong use of self.batch_id in an api.model method.
2) Fix demo datas which didn't pass the sanity check (after the fix)
Avoid to put draft picking into non-draft batch picking and use batch's
actions instead of picking's actions for confirmation and reservation.
closesodoo/odoo#55254
X-original-commit: 9e9f50169ba4d4698ce64b0865db4cc6b4833b0e
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Co-authored-by: Steve Van Essche <svs@odoo.com>
1. Batch transfers: set demo data backgroud for Kanban & Tree
2. Packages: set demo data backgroud for Kanban & Tree, update the
helper message.
3. Lot/SN: improve helper message.
4. Stock inventory: use a scanner instead of the smilling face in the
helper.
5. Replenishment: Enable sample data and use new helper image.
6. mrp: Enable sample date and use new helper image for workorder.
Task 2253588
PR #54415closesodoo/odoo#54741
X-original-commit: 7c75ec9951f6d55121d6dc8cb4942e96641b4a66
Related: odoo/enterprise#11957
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>