100 Commits
Author SHA1 Message Date
William Henrotin 96ac5c0770 [FIX] mrp: respect picking type option
The `use_create_components_lots` option of manufacturing picking type was never read
as the context to get the active production order was not always
specified.

Also, this field was not taken into account to display or not the
'generate serial' and import 'lot buttons'

closes odoo/odoo#162581

Related: odoo/enterprise#61137
Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
2024-04-22 13:39:49 +00:00
William Henrotin f06da8b3c1 [FIX] stock: update quant with quantity
In case a quant for a product tracked by lot/sn exists but without any
lot/sn set and have some quantity, `_action_done()` should update it
instead of a quant with the correct lot but without any quantity

closes odoo/odoo#162683

X-original-commit: 534220ee90da3e213ea99ec5da7ce6cc9eff4203
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2024-04-22 10:12:55 +00:00
William Henrotin 4a434f1282 [FIX] stock: search quant by 'pick from' name
This commit allows the user to search a specific quant in the detailed
operation view via the display name build from its characteristics

For instance, searching 'LOT1' will search for quant having
location or lot_id or package or owner equals to 'LOT1'.

closes odoo/odoo#141527

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2024-04-11 15:02:46 +00:00
William Henrotin 1a1c59095d [FIX] mrp_subcontracting_dropshipping: don't assign twice
The `stock.move:_action_done()` already reserve the next mto moves at
validation. Calling the reservation method after the validation again
may lead to unwanted results like calling `check_entire_pack()` and
messed up the result_package_id on the stock move lines.

Task : 3764822

closes odoo/odoo#161445

X-original-commit: 2551f735e24eb2549264b0a70b814be8d3c52922
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2024-04-11 11:22:46 +00:00
William Henrotin 8b3812eb38 [FIX] stock_account: reinforce search domain in test
The account move search was not enough specific to retreive only one
account move. The following `assert` sometimes failed because of this.

This commit reinforce to search to get only one account move

closes odoo/odoo#158327

Opw: runbot error 60338
X-original-commit: 78518f5dbf26680f678c6bbd950d60bb96eeedfe
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2024-03-20 19:56:41 +00:00
William Henrotin 08421efad4 [FIX] stock: restrict move orig in forecast report
Test the following flow:

Create 2 warehouses
create a stock rule (pull) and a route between the 2 stock location of those product
create a product having the route MTO and the new replenish route
create a delivery in the second warehouse
a transfer from the two warehouse should be created and linked to the
delivery

Open the forecast report for the warehouse that deliver the product
-> the delivery is marked as "Reserved from stock" instead of being
linked to the replenish transfer.

closes odoo/odoo#156821

X-original-commit: 776aa028cdb27047ebfb28d30fd79b6254fa362e
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
2024-03-07 09:53:49 +00:00
William Henrotin b718dbd744 [FIX] stock: create orderpoints faster
This commit changes the computation of product having a negative forecasted
quantity to create manual orderpoints. The issue was that each replenish
location needed multiple `_read_group` on `stock.quant` and `stock.move`
on all storable product.

This commit makes only 3 `_read_group`s for all products x locations and
post process the group and quantity sum by location in Python.

This method gives some performance gain in time as well as in memory
consumption

closes odoo/odoo#156507

Task: 3653272
X-original-commit: 1a061791e68a524480b4f230031af25411603606
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2024-03-05 19:21:37 +00:00
William Henrotin 022a8435de [FIX] stock: prevent creating lot based on picking type
Since 4da8c6ebca, the lot creation when filling a stock move line is
done via the stock quant "pick from" field. We thus don't have the
'active_picking_id' key that was set on lot_id field to check if the
user can create or not new stock lot for a particular picking.

This commit add this context key back on the stock move line one2many
for it to be available at the stock quant creation.

closes odoo/odoo#152915

Task: 3670447
X-original-commit: ce4f6f668cf8308b4b9af14ffc74f0df6428a771
Signed-off-by: Steve Van Essche <svs@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2024-02-16 13:51:53 +00:00
William Henrotin 49e55546c2 [FIX] stock, mrp_subcontracting: split origin moves
This commit corrects commit 7a78839ca6cf45ddec7adb59051da132e0ebceb4
that split the move_orig_ids for new stock moves created in backorder.
The issue is this should only happens in case of subcontracting, not for
every backorders

closes odoo/odoo#151179

X-original-commit: 79f85cba46df610372c740f971182cac8c0498c0
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2024-01-31 13:47:10 +00:00
William Henrotin 05fcc84734 [FIX] stock: allow multicompany push flow
This commit ensure a multi company flow made of push rules can be
triggered by a stock user having access to the first company only

      manual     push
Stock1 -> interco -> Stock2
(comp1)              (comp2)

Let a user working in company 1 confirming and validating a transfer
from Stock1 to the intercompany location. The push rule (defined in
company 2) will create and confirm the stock move to resupply Stock2

closes odoo/odoo#149492

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2024-01-16 09:55:29 +00:00
William Henrotin 875e15e1aa [FIX] mrp_subcontracting_purchase: verify ressuply + mto flow
This commit adds a test on the following flow:
A subcontracted product has its component having the three route
 - ressuply on order
 - buy
 - MTO

Receiving the subcontracted product will create a delivery for the
component to the subcontractor, then a purchase order to buy it.
Confirming this very PO should create a receipt stock move linked to
this delivery.

closes odoo/odoo#147344

X-original-commit: 0044fd8bb6966011bd3943bff0bd58bcd111338f
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2024-01-15 11:11:23 +00:00
William Henrotin a394d39332 [FIX] mrp: compute lead days in multi warehouse flow
Since 461d311b73, the manufacture rule lead time is taken into
account in the date computation for the procurement. The issue comes
from the fact we assume there is only one warehouse related to the stock
rules chain.

closes odoo/odoo#147261

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2024-01-08 21:58:28 +00:00
William Henrotin 9cad1f3293 [FIX] {purchase_}stock{_account}: do not apply tax twice
Since commit [1], at the creation of a bill, if a part of the quantity
to invoice is already out, we compute the value to impact the stock
valuation accounts. The issue was in this case the included price taxes
was applied 2 times. Once as we make the computation with
`price_subtotal` field, the second time because commit [1] forgets to
remove the extra `compute_all`.

[1]: 8444f5aae8b83c113e1cd2864ec11e92d836780a

closes odoo/odoo#145493

X-original-commit: 55be6781e514c34c1d2b7b9911aebe9f17bd3d12
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-12-08 09:53:41 +00:00
William Henrotin 1e39c7b448 [FIX] stock: remove check company on route_ids
Creating a stock move chain through `action_confirm()` + `run_*()`
sometimes needs to carry data from move to move to specify the future
documents to be created. For instance the supplier to choose to create
purchase order or stock route to filter stock rule to be triggered . The
field `route_ids` on `stock.move` has exactly this meaning. Forcing the
route to have the same company than the stock move may be too strict for
some intercompany flows inside which the route to choose are just saved
for future stock move creation.

Task 3527727

closes odoo/odoo#145384

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-12-08 08:35:21 +00:00
William Henrotin 27c95fa2c0 [FIX] stock: remove 'set' and 'clear' quantities buttons
Thanks to ref https://github.com/odoo/odoo/pull/137864, the quantity on
stock move can be emptied or fill with the unreserve/reserve mechanism.
Those two buttons becomes useless

closes odoo/odoo#140116

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-10-30 12:05:28 +00:00
William Henrotin b05b4f3f7a [FIX] web: mock barcode service
Some Qunit tests (in stock_barcode module) need to mock the barcode
service in order to be executed correctly.
This commit adds a new helper function that simulate the barcode service bus.

closes odoo/odoo#136236

Related: odoo/enterprise#48054
Signed-off-by: Steve Van Essche <svs@odoo.com>
2023-10-10 12:34:59 +00:00
William Henrotin 2bfe5e9722 [IMP] stock, barcode: search pickings from lot/serial number
Give the ability to filter pickings base on lot/serial number set on
stock move lines.

Part-of: odoo/odoo#136236
2023-10-10 12:34:59 +00:00
William Henrotin b9955b5088 [FIX] stock: prevent creating negative move line
Choosing a negative quant to create a new move line in the detailled
operation should not take the negative quantity.
This commit set 0 instead.

closes odoo/odoo#137407

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-10-04 19:40:23 +00:00
William Henrotin 513a65cf3e [FIX] stock: rename stock move title
Opening the stock move form view in a picking will display the
technical name of `move_ids_without_package`. This commit change it to
be more accurate.

closes odoo/odoo#136067

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-09-27 09:11:48 +00:00
William Henrotin c03768487d [FIX] stock: missing field in form views
The field `move_line_nosuggest_ids` was missing on the stock move form
view. Depending on the `show_reserved` setting on the picking type, we
should show either `move_line_ids` or `move_line_nosuggest_ids`.
Displaying the wrong field will trigger the wrong computes

Part-of: odoo/odoo#136067
2023-09-27 09:11:48 +00:00
William Henrotin 7ff5e1b590 [FIX] stock: remove py3.9 function
`removeprefix` string function has been introduce in Python 3.9 but we
still support Python 3.7

This commit replaces it by an hand crafted one

Part-of: odoo/odoo#136067
2023-09-27 09:11:48 +00:00
William Henrotin 0bd5512ad3 [FIX] stock, mrp: show detailled operation button in MO
Commit 4da8c6ebca change the way the
detailled operation of a stock move is openned. This has been done only
for the picking. This commit adapts the
MrpProductionComponentsX2ManyField widget to act also as the stock move
widget used in the stock pickings.

Part-of: odoo/odoo#136067
2023-09-27 09:11:48 +00:00
William Henrotin a366ccdf3d [FIX] stock: do not restrict name to saved record
The 'pick from' display name would give a name to the dummy quant only
in case of existing stock move line. It's an issue in case of delivery
with the use_create_lot setting as we could generate serial number on
the fly and thus showing a quant on virtual move line

Part-of: odoo/odoo#136067
2023-09-27 09:11:48 +00:00
William Henrotin 120d69ef4c [FIX] stock: create line in readonly mode
This commit creates the stock move line in readonly to be able to focus
out the move_line_ids one2many widget without having to confirm the
values of all the move line with a <Enter> key

Part-of: odoo/odoo#136067
2023-09-27 09:11:48 +00:00
William Henrotin 03e80c13d6 [IMP] stock: 'pick from' quants reservation
Choosing a quant to populate a new stock move line set the quantity done
and the reserve quantity to ensure it stay available to this particular
stock move and not empty by another picking

closes odoo/odoo#124409

Task: 3256447
Related: odoo/upgrade#5139
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-09-20 10:02:05 +00:00
William Henrotin fc326082c8 [FIX] stock: hide reset to draft button when no needed
Only immediate transfers should have the ability to reset the state to
draft. Also rewording it as "Plan" as the goal of this button is to left
the stock move to be done later and impact the forecast

Task: 3256447
Part-of: odoo/odoo#124409
2023-09-20 10:02:05 +00:00
William Henrotin fc716160d2 [FIX] stock: check availability in immediate transfer
Show "Check availability" in immediate transfer too to prefill the stock
move lines

Task: 3256447
Part-of: odoo/odoo#124409
2023-09-20 10:02:05 +00:00
William Henrotin 501274f0b3 [IMP] stock: generate serial popup
In order to reduce the amount of RPCs in the detailed operation view.
The two wizards to populate the stock move line one2many with lot/serial
number to create are replaced with twos Owl dialogs.
only one RPCs is done to generate the stock move lines values from
either a serial number + a count or a list of lots name

Task : 3256447

Part-of: odoo/odoo#124409
2023-09-20 10:02:05 +00:00
William Henrotin bcad62e049 [IMP] stock: remove compute move without packages
The move without package as computed field bring some issue with the "no
save detailed operation" feature. Creating a stock move and directly add
some move lines without saving do not call
`set_move_ids_without_package`

Task: 3256447
Part-of: odoo/odoo#124409
2023-09-20 10:02:05 +00:00
William Henrotin 4da8c6ebca [IMP] stock,mrp: detailed operation without RPCs
This commit replaces the opening of the stock moves detailed operation
wizard by the one2Many record preview. This means creating a move in a
picking is still done via a new line but the edition is done via the
`fa-list` button that open the record in the web client. The goal is to
reduce the RPCs call as much as possible. The stock move lines data are
stored in the stock move record until the picking save.

Additionally, this commit change a bit the immediate transfers flows.
The stock move show only initial demand (`product_uom_qty`) but the
column wording is still "Done". In the detailed operation view, the
stock move line `qty_done` is displayed as "Reserved".
At picking validation, the user is expected to enter the same quantity
in `product_uom_qty` and `quantity_done`. If `product_uom_qty` is equals
to 0, the done quantity is used as actual transfer quantity. If
`product_uom_qty` is different than 0 but small than the done quantity,
an error is raised.

Task: 3256447
Part-of: odoo/odoo#124409
2023-09-20 10:02:05 +00:00
William Henrotin 3186133064 [FIX] mrp: force readonly=False on compute
Commit 167c51b1f9 makes `use_create_lots`
and 'use_exisitng_lots` computed fields in MRP module but did not mark
them as `readonly=False`. Thus, they were readonly by default for any
picking types.

Also, make sure new reception picking type have their `use_create_lots`
set to True and delivery picking type their `use_existing_lots` set to
True.

closes odoo/odoo#135900

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-09-19 17:44:33 +00:00
William Henrotin 9a3dde222a [FIX] {sale_}purchase{_stock}: select sellers depending on date
Commit 72a17bafba6e7 force the PO `date_order` to be >= at ` today() to
ensure the select_seller method take the right seller price. This
introduces an error in the MPS module that may need to create PO in the
past.

Instead, this commit patch the call to `_select_seller` to take at least
`today()`

closes odoo/odoo#134217

Opw: 3167094
X-original-commit: a9cbd2a2ae2e21f1ba14379aecd908c44497b8ab
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-09-05 07:19:48 +00:00
William Henrotin 743f174a63 [ADD] mrp: complete demo data
closes odoo/odoo#132366

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-08-19 07:58:50 +02:00
William Henrotin 6f0348ba62 [FIX] stock: block quant creation from move Lines
The `quant_id` field on stock move line is a technical one to show
available quants to pick in the detailled operation view. It's not a
real field in database thus is not intended to create quant from it.

This commit adds the `{'no_create': True}` option in the view

Task : 3430500

closes odoo/odoo#131789

X-original-commit: 24041891811bb9805246115f99908a51ffa3697a
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-08-16 10:24:35 +02:00
William Henrotin d7ce5553c7 [FIX] stock: write on item instead of iterable
The stock.quant `_compute_display_name` overide was writing the name on
the recordset `self` instead of the current loop element making the
quant name all the same.

This commit also remove the ' - no data -' fallback by displaying at
least the location.

closes odoo/odoo#128375

Signed-off-by: Steve Van Essche <svs@odoo.com>
2023-07-13 18:18:03 +02:00
William Henrotin 4ae28ba747 [FIX] stock: recompute move state for reservation
Creating a move line with some reserved quantity should make its stock
move recompute its state as this noew reservation quantity could make it
assigned.

closes odoo/odoo#126069

Task: 3371590
X-original-commit: ca4cf35b3450ad3246e57a34aa8f3fe7c4f187af
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-06-23 16:35:22 +02:00
William Henrotin 955a5fecc8 [FIX] stock: hide quants for consumable
do not create stock move line from quant for consumable products

Task: 3256447
X-original-commit: b327825de0b50de9cdb81fc9e8384c503351d6d7
Part-of: odoo/odoo#126069
2023-06-23 16:35:22 +02:00
William Henrotin aede5c595a [FIX] stock: always show the detailed operation button
We want be able to click on the button right at the stock move creation

Task: 3256447
X-original-commit: d8926ec8f4a2d8f7840ea4c0ddd8393a74e57d90
Part-of: odoo/odoo#126069
2023-06-23 16:35:21 +02:00
William Henrotin 16d5e43996 [FIX] point_of_sale: apply cogs on delivery picking only
Commit 1e82e27 adds cogs account move lines for 'ship later'
config at the picking validation. The issue appears if the delivery flow
is in multiple steps. The account move lines will be created for each
pickings.

This commit ensure the last one actually create the aml only

closes odoo/odoo#125850

Opw: 3324972
X-original-commit: 3a987253dc81da1f2b4f746ff446bbf8fc008e98
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-06-21 11:50:19 +02:00
William Henrotin 7df2c48d5d [FIX] point_of_sale: use correct account in ship later pickings
Commit 1e82e27 makes ship later option create additionnal account
move line for Cogs at delivery validation. The issue is the accounts was
not correct. The desire result should be the following for a product of
cost 10, sale price 11 and 15% taxes.

 At PoS Closing                             | Debit | Credit
-------------------------------------------------------------
215000 Taxes 15%                            |  0.00 |   1.50
200000 Pos account                          |  0.00 |  11.00
600000 Expenses                             |  0.00 |   0.00
101200 Account Receivable                   | 11.50 |   0.00
110300 Stock interim (delivered)            |  0.00 |   0.00
-------------------------------------------------------------
                                            |       |
 At delivery validation (manually created)  |       |
-------------------------------------------------------------
110300 Stock interim (delivered)            |  0.00 |  10.00
600000 Expenses                             | 10.00 |   0.00
-------------------------------------------------------------
                                            |       |
 At delivery validation (from stock layers) |       |
-------------------------------------------------------------
110100 Stock valuation                      |  0.00 |  10.00
110300 Stock interim (delivered)            | 10.00 |   0.00

Opw: 3324972
X-original-commit: 471e4c6e9c9aa396060a29725aca88360e781960
Part-of: odoo/odoo#125850
2023-06-21 11:50:19 +02:00
William Henrotin 6e23e879f9 [FIX] stock: hide detailed operation in draft
The draft state should only allows setting the initial demand
This commit also allow editing the reserve quantity at the move line
creation

closes odoo/odoo#122445

Task: 3256447
Related: odoo/enterprise#41548
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-05-30 13:03:20 +02:00
William Henrotin 71711f864e [FIX] stock: adds package and owner in quant display name
In case package and consignment settings are activated, choosing a
quant to create a move line is easier if the package/owner is in the
quant name.

Task: 3256447
Part-of: odoo/odoo#122445
2023-05-30 13:03:20 +02:00
William Henrotin 4d904c0dc4 [FIX] stock: hide quants for consumable
In the detailled operation view, hide the `quant_id` column for
consumable products as they have no quant

Task: 3256447
Part-of: odoo/odoo#122445
2023-05-30 13:03:19 +02:00
William Henrotin 8ca098480a [FIX] stock: display quant with no data
Give a proper string to quant with no data to display

Task: 3256447
Part-of: odoo/odoo#122445
2023-05-30 13:03:19 +02:00
William Henrotin fddf06f5a3 [FIX] stock: autofill quantity
Creating a stock move line from a stock quant should prefill the
quantity done up to the initial demand

Task: 3256447
Part-of: odoo/odoo#122445
2023-05-30 13:03:19 +02:00
William Henrotin 233ebddef7 [FIX] stock: open stock quant form view to create move Lines
If no stock quant are founded in the list when adding a new move line in
the detailed operation. The `new` button opened a form view on
stock.move.line model instead of stock quant.

Task: 3256447
Part-of: odoo/odoo#122445
2023-05-30 13:03:19 +02:00
William Henrotin 1a61dc03d9 [FIX] stock: use simplified quant list view
This commit change the quant list view displayed in the detailed
operation view to remove unecessary buttons

Task: 3256447
Part-of: odoo/odoo#122445
2023-05-30 13:03:18 +02:00
William Henrotin 7e65ab7199 [REM] mrp_subcontracting: dead code
closes odoo/odoo#117513

Related: odoo/upgrade#4682
Related: odoo/enterprise#41111
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-05-17 13:37:48 +02:00
William Henrotin 97a9f842f0 [IMP] stock: import and generate serial buttons
This replace the generate serial numbers mechanism on stock move by two
new buttons in the detailed operation wizard. One for generate serial
numbers from a sequence and one to import serial/lot names.

Created lots will create the stock move lines automatically as well.

Task: 3256447
Part-of: odoo/odoo#117513
2023-05-17 13:37:47 +02:00
William Henrotin d45f6ab226 [IMP] stock: create stock move lines from quants
In a flow where the reservation is used (internal transfers, deliveries,
...) adding a new stock move line is now made from the quantities
available in stock. The 'add a line' button in the show detail wizard
trigger the quant list view to directly pick the wanted lot or location
where the stock is available. Only the quantity done is needed to be
updated before the validation.

This commit remove the 'quant reserve wizard' as the behaviour is an
extension of it.

Task: 3256447
Part-of: odoo/odoo#117513
2023-05-17 13:37:47 +02:00
William Henrotin 5e5d92ef79 [IMP] stock: picking flow reworked
This commit changes the process flow of stock pickings. A new picking will
always be created in immediate transfer mode and 'ready' state. From
their, it can be validated directly or 'reset to draft'. This second action
switch the immediate mode to planned mode and reset the state as draft.
From their the classical workflow is processed
confirm -> (assigned ->) validated

Task: 3256447
Part-of: odoo/odoo#117513
2023-05-17 13:37:47 +02:00
William Henrotin d9972ddec4 [FIX] mrp: clear finished moves
The finished move of a production order should be deleted if we change
the product to avoid having draft stock move detached from any business
documents

closes odoo/odoo#118957

Task: 3172098
X-original-commit: 4478560d7769a8a795a94aead875e02d1394dd71
Signed-off-by: Adrien Widart <awt@odoo.com>
2023-04-24 16:57:41 +02:00
William Henrotin 008f758536 [IMP] mrp: (de)activate workorder demo data
Some demo data bill of material have workorder operation. Trying to use
them without the workorder setting activated will give an error on some
fields not instantiated.

This commit activate/deactivate the operations depending on the
workorder setting.

opw - 3229621

closes odoo/odoo#119254

X-original-commit: aaba4eb4deb3f9e10fd611924c5a24680d633537
Related: odoo/enterprise#40092
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-04-24 10:20:20 +02:00
William Henrotin b056deb7ab [FIX] stock_picking_batch: do not confirm multiple times
Commit 324298967cb6 fix the call to _find_auto_batch() by calling
_action_confirm() of the picking _after_ the assignation.

This implies to confirming 2 times the pickings. Which is an issue in
case an automatic orderpoint is searched and triggered. to fullfill the
need in the source location.

This commit change the call to action_confirm() to a call to
_find_auto_batch() only

closes odoo/odoo#117100

X-original-commit: eb6da7009a525665d4608243e260a2d07093abcc
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-31 11:58:52 +02:00
William Henrotin 18e920831b [FIX] product_expiry: don't cast datetime in date
The `date` widget, when used with a datetime value, doesn't offset the
value relative to the session timezone. This can lead to strange issue
like this following one

date1 = 12/03/2023 05:34:12
date2 = 12/03/2023 18:34:12
in the deliveryslip report, the datetime are casted as date, they become

date1 = 12/03/2023
date2 = 13/03/2023

closes odoo/odoo#114983

Opw: 3199862
X-original-commit: b6757daac6272092c37024ac2bdd49747177d2bc
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-13 09:45:59 +01:00
William Henrotin 92a49e8aea [FIX] purchase: long product description
- Create a product with a very long product description
- Add in a PO and print the RFQ

The description overlaps with the table header on the second page.

This is a known issue of wkhtmltopdf (see issues 1770 and 1524 for
example), and there is no known workaround. It can be avoided by
preventing the repetition of the header.

closes odoo/odoo#114916

Opw: 3208347
X-original-commit: cc5be8a907b2c3f33c6a62c5693726d757ffd113
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-10 14:38:45 +01:00
William Henrotin 0c301855ea [FIX] stock: prevent updating picking locations with move lines
Since #91640, the locations on stock picking are editable except in `done` state. This can leads to misunderstanding if some stock move lines
are already created. The locations on stock picking act as default
values for stock move/ stock move lines. Validating a picking will
always use the location set on stock move lines even if those ones
differ from the picking. This commit adds a simple error message in
to address this situation.

Close #113486
opw-3148993

closes odoo/odoo#114868

X-original-commit: 3eeab703f4e36723eae6005cf4b966f20f1e62dd
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-10 10:18:20 +01:00
William Henrotin ef4b80c408 [FIX] mrp_subcontracting: merge quantity changes in PO
Before this commit, updating a purchase quantity of subcontracting
product will try to not merge the new and old move to keep the two chain
separated as much is possible and avoid side effects (receipt move,
subcontracting moves, resupply moves). Some were merged, some cancelled,
...

This had two issues:
First, not merging the quantity was not guarantied
as you can specify you don't want to merge them with others but it's not
possible for a stock move to say to any other move do not merge with me.

Second, by not merging the receipt moves, we duplicate every other
object on the chain. This pollute the database uselessly.

opw-3147446

closes odoo/odoo#114739

X-original-commit: 0b1bcfacb13c7de480f30015b91db11ed03f2dfe
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-03-09 10:51:43 +01:00
William HenrotinandAdrien Widart c05003a2c2 [FIX] stock_account: compensate rounding error
To reproduce the issue:
1. Create a product:
   - Type: Storable
   - Category:
     - Costing Method: AVCO
2. IN 1000 @ 0.17
3. IN 800 @ 0.23
4. OUT 1000
5. OUT 800
6. Open the inventory valuation of the product

Error: the total value is $-6.00, it should be zero

Once all products received, the standard price is $0.20. Its value
has been rounded because the real value is
`(1000 * .17 + 800 * .23) / 1800 = 0,196666667`
The standard price will create a difference when using the products,
because:
`(1800 * .20 = 360) != (1000 * .17 + 800 * .23 = 354)`
That's the reason why a feature tries to compensate such rounding
errors. So, step 4, when preparing the values of the out-SVL, we
check if there is a rounding error, and we find a difference of $6,
which is correct. However, the difference is above the treshold, so
we will not consider it as a rounding error:
https://github.com/odoo/odoo/blob/3ff51daa93a1d670b8f67f79418d4dd48e94875f/addons/stock_account/models/product.py#L197-L200

Here is the issue: the threshold is based on the outgoing quantity
(1000) while the value difference is based on the whole quantity
(1800). This difference should also be proportional to the outgoing
quantity.

Note: The fix will still not work with a small quantity. The only and
best solution is to change the type of the SVL unit cost into a
float.

OPW-3101374

X-original-commit: 35d8b4c2a223970520961bf8bfc574bb309af090
Part-of: odoo/odoo#114525
Co-authored-by: Adrien Widart (awt) <awt@odoo.com>
2023-03-07 16:56:21 +01:00
William Henrotin ddee7db9a9 [FIX] sale_stock_margin: create currency rate once
On January first, the test test_so_and_multicurrency fails because it
creates a new currency rate on EUR. There is already a currency rate
created in the demo data (base/data/res_currency_rate_demo.xml) for the
01-01.

This commit removes all currency rate before the test to make sure we
avoid duplicates.

closes odoo/odoo#110488

X-original-commit: 6de19caf6aa38e040aaf4cb50b17dee894c20984
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-01-20 09:41:00 +01:00
William Henrotin a26db9a3a7 [FIX] stock,mrp: kanban-menu specific to picking type
Since 5b68871097, the scrollable menu of
the picking type kanban card (`kanban-menu`) is the mrp one even for
stock picking type. The inherited view replace the template without
testing the picking type code as it was done before.

This commit adds a `t-if` for stock picking types and another for mrp
one to makes sure the two template are mutually exclusives

closes odoo/odoo#110412

X-original-commit: c7f49d1381ab1bf3dd7ed42436d0c881d7bab27d
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-01-19 17:49:20 +01:00
William Henrotin c1ff654875 [FIX] mrp: print “BOM structure & cost” with dynamic variants
Steps to reproduce the bug:
- Create an attribute with "Variant Creation Mode" = Dynamically
- In a product template, add the attributes and some values
- Create a new BoM for this product
- Click on "Stucture&Cost" smart button

Problem:
A traceback is raise, because the `_match_all_variant_values` function
is called but without the product, while it takes at least one:
https://github.com/odoo/odoo/blob/15.0/addons/mrp/models/mrp_bom.py# L456
https://github.com/odoo/odoo/blob/15.0/addons/mrp/models/product.py#L286

As the variant creation mode is set “dynamically”, the object must be a
`product.template` model and not `product.product` so the first
condition should be `True` and return a `false` value:
https://github.com/odoo/odoo/blob/5c16aa22c70f8a0a377a55b912307ab07222c643/addons/mrp/models/mrp_bom.py#L453-L454

Therefore, if the product has no variant, we have to use the
`product_template` and set it in the `_get_bom` function, but from this
commit:
odoo@ca3dfec

If there is no variant product, the template is no longer set:
odoo@ca3dfec#diff-e8f576a790cd7f3f0976358b9b07f63cee0c6f05b0ba6203fc7bcf91af3ad283L107

The change in this commit from line 107 to line 118 is useless because
it does not change any behavior and does not improve the code, the only
change is that the product_template is no longer set. So it makes sense
to revert this part of change

opw-3008838

closes odoo/odoo#110341

X-original-commit: 1d830b5080e4d05dc1ac6fbd4c435af532443f88
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-01-19 12:31:03 +01:00
William Henrotin 0149a26c62 [FIX] mrp: byproducts follow putaway rules
Before this commit, the byproduct and putaway feature do not work
together. More specifically, changing the quantity to produce on a
manufacturing order will create automatically a byproduct move line (or
update the existing one with the new quantity) but never look for a
putaway rule to apply.

This commit makes use of `_set_quantity_done()` method on `stock.move`
that *do* call the putaway strategy mechanism

X-original-commit: d4a968412e68cc9da3ec2d9725caa90830287c48
Part-of: odoo/odoo#109669
2023-01-12 08:02:48 +01:00
William Henrotin 2e8dcad061 [FIX] stock: domain optimization
'State' field on stock move is indexed. Some domains on stock move state
are expressed like (state, not in, ('a', 'b', 'c')) instead of (state,
in, ('d', 'e', 'f', NULL)). The 'not in' domain won't the index and thus
will be relatively slower

closes odoo/odoo#109201

X-original-commit: 96f8321e894a9b7284cca8f201e5a2877b0b3a76
Signed-off-by: Rémy Voet <ryv@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-01-06 12:29:38 +01:00
William Henrotin 5eba1ff07e [FIX] mrp: add index on created_production_id
in sale_mrp module, the method `get_sale_order_count` get all stock move
with created_production_id = the current production order. Without
index, this request is significantly slow.

X-original-commit: 4c17020fb452f639d9395dccdd5fcefee109ed01
Part-of: odoo/odoo#109201
2023-01-06 12:29:38 +01:00
William Henrotin 859c24528e [FIX] mrp: do not recompute duration expected
Since 2515482d5a70, the duration expected of a workorder was always set
to the real duration at the validation of the workorder. This commit
ensure the duration expected is left unchanged even if the
date_planned_finished is updated.

closes odoo/odoo#108233

X-original-commit: 46e1ae4d9918de1aaf6b4a7565dba422b03fcb36
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-12-19 10:31:00 +01:00
William Henrotin 9ee9be3f4d [PERF] mrp,stock,purchase: sql improvement
First correction: replace call to `read_group` to `_read_group` in order
to avoid useless joints on table product_template and ir_translation
when the grouping key is a Many2One.

Second correction: add an index on workorder's `state` field. The
get_conflicted_workorder_ids() method search for ready workorders that
are in conflict relate to their planning. The state value is searched to
many times to not index it

closes odoo/odoo#106582

Task: 2852423
X-original-commit: b5019eec76845316e554f2dd11a6d8bbf6fea433
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-11-25 18:56:02 +01:00
William Henrotin b39f37153c [FIX] stock_account: open layer form from list
Since e4988b70ab, the record openned from the stock valuation layer
list view will depend on the stock move parent's document. If, the move
has a picking_id set, the record will be the stock picking.

This implies in some cases (a stock move linked to a picking or a
manufacturing order) we cannot access the stock valuation form view and
thus the accounting entries are not reachable from there.

This commit adds a button in the list view to open the layer form view.

closes odoo/odoo#106398

X-original-commit: d5162f814f4d1181e2063f788b7933ce84a32b7c
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2022-11-24 15:31:55 +01:00
William Henrotin cefb805273 [FIX] mrp: change dependency of related field
Fields `product_qty_available` and `product_virtual_available` on
stock_move are related on quantities fields of move's product_id. On
large database, those two fields will slow down every transactions that
updates stock move state (confirmation, validation, ...).

`state` on stock.move is a dependent field of computed field `qty_available` on
product.product which is dependent field of related field
`product_virtual_available` on stock move. This relation tree implies
that updating the state on one particular stock move will mark its
product (qty_available) as 'to be recomputed' and thus **every** stock
moves (product_virtual_available) of this product as to be recomputed.
On database will 100k+ stock move per product. Fetching all stock move
of some products take 90% of a manufacturing order validation time. This
is problematic knowing those two quantity fields are only used in the
stock move tree form so computed anyway at the view rendering.

This commit change the `depends` of those two related field to mark them
as to be recomputed only if the product_id change.

closes odoo/odoo#106070

Opw: 3047017
X-original-commit: 189e825e567e4c633d721ce9f0fee906535edf06
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-11-21 09:51:19 +01:00
William Henrotin 36158fe17a [FIX] mrp: force context in computes
Computed stored fields should not be depending on context. In this
particular case, compute_bom_id will make a 'search' on mrp_bom table
with sometimes 'active_test=False' in the context sometimes not.

This commit force the context to exclude archive records to ensure we do
not set an archived bom on a production order.
In a futur versionm it would be nive to have the ORM ignoring the
context in such case.

closes odoo/odoo#103055

Task: 2991906
X-original-commit: 6274f23a673fe073157d0f975adcb2b0c917b02f
Related: odoo/enterprise#32700
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-10-26 15:06:51 +02:00
William Henrotin b71d3fa1c1 [FIX] mrp: ui improvement
- set monetary widget to align foat field with other monetary fields
  - use default production order in the list view to have the same order
    everywhere.

Task: 2991906
X-original-commit: 38b82230b75f972a7da5d4c53ea1a4c7359cd913
Part-of: odoo/odoo#103055
2022-10-26 15:06:51 +02:00
William Henrotin 38ad682388 [FIX] stock_account: show avco valuation
This commit display the valuation button action on AVCO products in
addition to the FIFO ones.

The view is slightly different to not show `remaining_value` and
remaining_qty` columns

closes odoo/odoo#102317

Task: 2985735
X-original-commit: dc78108fa8dc48a8f4bcb143e7e5a4a14c11dd41
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-10-26 14:05:31 +02:00
William Henrotin 50dddf3aa0 [FIX] mrp: show slides in readonly
Ensure the google slide are displayed in both readonly and editable
mode. The slides should be hidden only if the url is wrong or empty.

closes odoo/odoo#103872

Task: 2991906
X-original-commit: bbf4f1e7b9cb456f2930c270f7e2b2c35cc9e80d
Related: odoo/enterprise#33100
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-10-24 09:16:55 +02:00
William Henrotin 3bc9d3dabe [FIX] mrp: make the timer editable
This commit makes the ongoing timer editable

Task: 2991906
X-original-commit: b2ce5adeead3255de765a6136116ffc7f36ea49e
Part-of: odoo/odoo#103872
2022-10-24 09:16:55 +02:00
William Henrotin 1ed423a181 [FIX] web: make pdf viewer expands on notebook
Similar to the html field widget, this commit add the display: block
class to the pdf viewer widget in order to make it use the whole area of
a notebook zone:

Task: 2991906
X-original-commit: a1407975c2fafedef5f5eb7d4597cfcd88117e49
Part-of: odoo/odoo#103872
2022-10-24 09:16:55 +02:00
William Henrotin c9ed5212d7 [FIX] stock_picking_batch: ensure the wave has a picking_type
If a stock picking wave is created from move lines. It may happen no
picking type is set on the wave. If an entire stock move or an entire
picking represented by the move lines 'to wave'. a picking type is
correctly set.

This commit ensure a picking type is set directly from the move lines

closes odoo/odoo#103348

X-original-commit: 86a1f2219904a19166155555da873b1772efa620
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-10-18 17:11:56 +02:00
William Henrotin 8d30502e1b [FIX] mrp: convert the Google Slides viewer in Owl
closes odoo/odoo#102398

Task: 2991906
X-original-commit: ba593c742c62db9cf9b310eaf5e104802821dad3
Related: odoo/enterprise#32383
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-10-06 18:01:09 +02:00
William Henrotin 9dc5f5f60f [FIX] mrp_workorder: fix status badge on kanban card
The status badge on workorder kanban card was hidden behind a dropdown
widget because of a wrongly used class.

X-original-commit: 491546a5c3ce6203763a7d829b44107e66ff3f42
Part-of: odoo/odoo#102398
2022-10-06 18:01:09 +02:00
William Henrotin 2a3ff43ff1 [ADD] mrp_workorder_hr_account: analytic accounting for employee in MRP
Create analytic accounting entries for employee times logs on workorder.
Compute BoM costs based on employee hourly cost and employee number
required on mrp operations.

closes odoo/odoo#91565

Task: 2427466
Related: odoo/enterprise#23032
Related: odoo/upgrade#3556
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2022-09-13 10:30:00 +02:00
William Henrotin 2c65e916fc [IMP] mrp: workorders redesign
This patch is part of a complete rework of the workorder tablet view and general
work order processing experience. It's mainly done in the Enterprise
repo. In community: the changes are the follows:

 - The workorder kanban view remodeled
 - Prepare workorder productivity timer to work with employee

Task: 2427466
Part-of: odoo/odoo#91565
2022-09-13 10:30:00 +02:00
William Henrotin 2c91ad3ae8 [FIX] mrp: remove onchange in import hack
Since d7716f071d, the onchanges to create the stock moves in mrp
production have been replaced by computes.
There was a hack in the create() method to trigger the onchanges in case
of import. As those onchanges do not exist anymore, this hack needs to
be remove too.
The compute methods are called naturally in imports.

closes odoo/odoo#99434

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2022-09-01 19:17:36 +02:00
William Henrotin 360924b4b7 [FIX] mrp: do not compute unit_factor at mrp install
Installing mrp on a large database will take lots of time computing the
unit_factor of stock_moves created in stock. As this value is only
needed in mrp, this commit bypass the computation for moves that have
been generated before the mrp installation

closes odoo/odoo#97750

Task: 2918852
X-original-commit: a2f064446b1e232efc3e6924879f63b79e0bc986
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-08-11 17:56:48 +02:00
William Henrotin 63d068e94d [FIX] stock,mrp: render control panel components
Since 362f6b6d5b, the control panel of an
action can be rendered only the first time the dom is mounted. Any
further remount won't rerenders do anything. The bom report needs to add
some buttons and a searchView. Previously, those widgets was mounted in
the set_html _after_ the first mount of the controlPanel. This report is
an extend of the stock traceability which also adds some buttons. In
this case the buttons are rendered correctly because they are added
_before_ the first controlPanel mount.

This commit makes the extra widgets to be rendered in the control panel
generated in a new specific method overridable in the bom report file

closes odoo/odoo#93245

X-original-commit: 39306370a3a7c5767a29bba216ffe61ab8c69544
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-06-10 09:28:09 +02:00
William HenrotinandAdrien Widart 7ef48801bb [FIX] mrp_subcontracting_account: read price unit at validation
In a subcontracting flow, the extra_cost on the subcontracted production
is read on the purchase line (via _get_price_unit() ) at the production
creation. In case the price unit on this purchase line change before the
validation, the stock valuation layer linked to the production will not
take this new value into account.

This commit ensures the price unit is the right one at validation

Note: the first version of the current fix broke a use case. The test
`test_tracked_compo_and_backorder` has been added to protect that use
case.

closes odoo/odoo#87817

X-original-commit: 1ff1b4a9a2b9ab27b29fdcac93731fa053c77cc7
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
Co-authored-by: William Henrotin (whe) <whe@odoo.com>
Co-authored-by: Adrien Widart <awt@odoo.com>
2022-04-08 10:37:56 +02:00
William Henrotin db8f9967c5 [FIX] mrp_{subcontracting_}account: read price unit at validation
In a subcontracting flow, the extra_cost on the subcontracted production
is read on the purchase line (via _get_price_unit() ) at the production
creation. In case the price unit on this purchase line change before the
validation, the stock valuation layer linked to the production will not
take this new value into account.

This commit ensures the price unit is the right one at validation

closes odoo/odoo#87726

Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-04-05 12:23:50 +02:00
William Henrotin 2b003b8d39 [FIX] mrp: always confirm empty production
Before this commit, production created via `_run_manufacture()` without
bom or with a bom without component, will not be confirmed because of b4fd050e20c1

closes odoo/odoo#87412

Task: 2802652
X-original-commit: 27a651f01fa5868295d2dafa7d4e03ce896e64c9
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-03-29 11:59:56 +02:00
William Henrotin 9bb5c31a92 [IMP] stock,mrp: add indexes on picking type
This commit adds an index on picking_type_id for models stock.picking
and mrp.production.

Filtering on picking_type_id is often done via the Inventory Overview.
This should speed up the list render in case of many object.

Task : 2648449

closes odoo/odoo#80434

Related: odoo/upgrade#3068
Related: odoo/enterprise#22535
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2021-12-07 16:20:07 +00:00
William Henrotin 56e7bcf0cb [REF] *{stock,mrp}*: rename reserved fields
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
2021-12-07 16:20:06 +00:00
William Henrotin cd9833e4ad [REF] *stock*: rename location destination fields
The stock convention on location name is always to name the destination
`location_dest_id`. It was not the
case on the stock rule model

Task: 2648449
Part-of: odoo/odoo#80434
2021-12-07 16:20:06 +00:00
William Henrotin c146c7d16f [REF] *stock*: rename model stock.location.route into stock.route
Task: 2648449
Part-of: odoo/odoo#80434
2021-12-07 16:20:06 +00:00
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
William Henrotin 71489e8fb6 [REF] mrp: remove unnecessary access
As mrp users are by definition stock users too, there is no to redefine
the same access rules on stock objects

Task : 2648449

Part-of: odoo/odoo#80434
2021-12-07 16:20:05 +00:00
William Henrotin 71f737fa12 [FIX] sale_purchase: change deprecated method
The currency.compute method is deprecated. We use _convert instead

closes odoo/odoo#80416

X-original-commit: 8fa0312d4a59198757a0daab68927e75fa1bab23
Related: odoo/enterprise#22527
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2021-11-26 10:31:56 +00:00
William Henrotin 9a19583700 [FIX] purchase_stock: create and confirm the same day
Testing purchase order creation assumes the whole test is done the same
day. The assert could failed if the test is run right before midnight
and end the day after.

This commit ensure the time is frozen during all the tests about
purchase order creation.

closes odoo/odoo#80264

X-original-commit: 438e47cdc87fc0f13c61a1ede29a190120dea117
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2021-11-23 17:06:47 +00:00
William Henrotin 8fdd6f095d [FIX] purchase_stock: relax the location constrains
The constrains on orderpoint location being related to the warehouse view
location was too restrictive especially in a complex subcontracting flow
with dropship.

This commit change the constrains to only be triggered if the two
location to be compared have both a warehouse.

closes odoo/odoo#79593

X-original-commit: 871cd6ad2d986ee1c28804aeeee63a001156154a
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2021-11-10 10:43:22 +00:00
William Henrotin 3a1473c75c [REF] *stock*: rename move_lines into move_ids in stock.picking
closes odoo/odoo#78732

Task: 2673000
Related: odoo/enterprise#21815
Related: odoo/upgrade#2956
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2021-10-27 15:48:51 +00:00
William Henrotin f3fe2d50d9 [REF] *: rename name into partner_id on supplierinfo
Task: 2673000
Part-of: odoo/odoo#78732
2021-10-27 15:48:51 +00:00
William Henrotin 2c37be22b8 [FIX] stock: speed up lot creation
Creating lots of production lot can take a huge amount of time if the
mail message follower is added on each chatter.

This commit removes this functionality to speed up the creation as
there is no real need to have the lot creator as follower of it.

closes odoo/odoo#78547

X-original-commit: 9b0e669216948da2710e2e16007f03e47fb7e704
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-10-18 12:45:58 +00:00
William Henrotin 13010c5d3d [IMP] stock: break the stock move line search
Searching the stock move line candidate to update at reservation can be
shorten by breaking the loop once one is found

X-original-commit: 93df2568914bee307209e1e739912976c23e1f1d
Part-of: odoo/odoo#78547
2021-10-18 12:45:57 +00:00
William Henrotin 5330dca7be [IMP] stock: create stock move lines in batch
X-original-commit: 8220234642c7c5fada4a882ba67cdb2ca5e7aaf2
Part-of: odoo/odoo#78547
2021-10-18 12:45:57 +00:00