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'
closesodoo/odoo#162581
Related: odoo/enterprise#61137
Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
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
closesodoo/odoo#162683
X-original-commit: 534220ee90da3e213ea99ec5da7ce6cc9eff4203
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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'.
closesodoo/odoo#141527
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
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
closesodoo/odoo#161445
X-original-commit: 2551f735e24eb2549264b0a70b814be8d3c52922
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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
closesodoo/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>
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.
closesodoo/odoo#156821
X-original-commit: 776aa028cdb27047ebfb28d30fd79b6254fa362e
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
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
closesodoo/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>
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.
closesodoo/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>
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
closesodoo/odoo#151179
X-original-commit: 79f85cba46df610372c740f971182cac8c0498c0
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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
closesodoo/odoo#149492
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
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.
closesodoo/odoo#147344
X-original-commit: 0044fd8bb6966011bd3943bff0bd58bcd111338f
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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.
closesodoo/odoo#147261
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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
closesodoo/odoo#145493
X-original-commit: 55be6781e514c34c1d2b7b9911aebe9f17bd3d12
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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
closesodoo/odoo#145384
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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.
closesodoo/odoo#136236
Related: odoo/enterprise#48054
Signed-off-by: Steve Van Essche <svs@odoo.com>
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.
closesodoo/odoo#137407
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
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.
closesodoo/odoo#136067
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
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
`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
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
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
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
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
closesodoo/odoo#124409
Task: 3256447
Related: odoo/upgrade#5139
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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
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
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
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
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.
closesodoo/odoo#135900
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
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()`
closesodoo/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>
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
closesodoo/odoo#131789
X-original-commit: 24041891811bb9805246115f99908a51ffa3697a
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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.
closesodoo/odoo#128375
Signed-off-by: Steve Van Essche <svs@odoo.com>
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.
closesodoo/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>
do not create stock move line from quant for consumable products
Task: 3256447
X-original-commit: b327825de0b50de9cdb81fc9e8384c503351d6d7
Part-of: odoo/odoo#126069
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
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
closesodoo/odoo#125850
Opw: 3324972
X-original-commit: 3a987253dc81da1f2b4f746ff446bbf8fc008e98
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
The draft state should only allows setting the initial demand
This commit also allow editing the reserve quantity at the move line
creation
closesodoo/odoo#122445
Task: 3256447
Related: odoo/enterprise#41548
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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
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
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
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
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
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
closesodoo/odoo#118957
Task: 3172098
X-original-commit: 4478560d7769a8a795a94aead875e02d1394dd71
Signed-off-by: Adrien Widart <awt@odoo.com>
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
closesodoo/odoo#119254
X-original-commit: aaba4eb4deb3f9e10fd611924c5a24680d633537
Related: odoo/enterprise#40092
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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
closesodoo/odoo#117100
X-original-commit: eb6da7009a525665d4608243e260a2d07093abcc
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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
closesodoo/odoo#114983
Opw: 3199862
X-original-commit: b6757daac6272092c37024ac2bdd49747177d2bc
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
- 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.
closesodoo/odoo#114916
Opw: 3208347
X-original-commit: cc5be8a907b2c3f33c6a62c5693726d757ffd113
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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
closesodoo/odoo#114868
X-original-commit: 3eeab703f4e36723eae6005cf4b966f20f1e62dd
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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
closesodoo/odoo#114739
X-original-commit: 0b1bcfacb13c7de480f30015b91db11ed03f2dfe
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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>
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.
closesodoo/odoo#110488
X-original-commit: 6de19caf6aa38e040aaf4cb50b17dee894c20984
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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
closesodoo/odoo#110412
X-original-commit: c7f49d1381ab1bf3dd7ed42436d0c881d7bab27d
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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
closesodoo/odoo#110341
X-original-commit: 1d830b5080e4d05dc1ac6fbd4c435af532443f88
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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
'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
closesodoo/odoo#109201
X-original-commit: 96f8321e894a9b7284cca8f201e5a2877b0b3a76
Signed-off-by: Rémy Voet <ryv@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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
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.
closesodoo/odoo#108233
X-original-commit: 46e1ae4d9918de1aaf6b4a7565dba422b03fcb36
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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
closesodoo/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>
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.
closesodoo/odoo#106398
X-original-commit: d5162f814f4d1181e2063f788b7933ce84a32b7c
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
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.
closesodoo/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>
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.
closesodoo/odoo#103055
Task: 2991906
X-original-commit: 6274f23a673fe073157d0f975adcb2b0c917b02f
Related: odoo/enterprise#32700
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
- 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
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
closesodoo/odoo#102317
Task: 2985735
X-original-commit: dc78108fa8dc48a8f4bcb143e7e5a4a14c11dd41
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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.
closesodoo/odoo#103872
Task: 2991906
X-original-commit: bbf4f1e7b9cb456f2930c270f7e2b2c35cc9e80d
Related: odoo/enterprise#33100
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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
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
closesodoo/odoo#103348
X-original-commit: 86a1f2219904a19166155555da873b1772efa620
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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
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.
closesodoo/odoo#91565
Task: 2427466
Related: odoo/enterprise#23032
Related: odoo/upgrade#3556
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
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
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.
closesodoo/odoo#99434
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
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
closesodoo/odoo#97750
Task: 2918852
X-original-commit: a2f064446b1e232efc3e6924879f63b79e0bc986
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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
closesodoo/odoo#93245
X-original-commit: 39306370a3a7c5767a29bba216ffe61ab8c69544
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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.
closesodoo/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>
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
closesodoo/odoo#87726
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Before this commit, production created via `_run_manufacture()` without
bom or with a bom without component, will not be confirmed because of b4fd050e20c1
closesodoo/odoo#87412
Task: 2802652
X-original-commit: 27a651f01fa5868295d2dafa7d4e03ce896e64c9
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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
closesodoo/odoo#80434
Related: odoo/upgrade#3068
Related: odoo/enterprise#22535
Signed-off-by: William Henrotin (whe) <whe@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
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
The currency.compute method is deprecated. We use _convert instead
closesodoo/odoo#80416
X-original-commit: 8fa0312d4a59198757a0daab68927e75fa1bab23
Related: odoo/enterprise#22527
Signed-off-by: Arnold Moyaux <arm@odoo.com>
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.
closesodoo/odoo#80264
X-original-commit: 438e47cdc87fc0f13c61a1ede29a190120dea117
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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.
closesodoo/odoo#79593
X-original-commit: 871cd6ad2d986ee1c28804aeeee63a001156154a
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
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.
closesodoo/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>
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