Refactor resource calendar and resource mixin:
- add a required timezone field on models 'resource.calendar' and 'resource.resource';
- resource calendar attendances are now computed in the timezone of the resource
or the calendar;
- improve API of 'resource.calendar' and 'resource.mixin';
- avoid other modules from using the implementation methods of 'resource.calendar';
- refactor implementation of 'resource.calendar' to make it more efficient.
Purpose is to limit the uninstallation of modules without being clearly
notified of it. In MRP ticking repair / maintenance install and uninstall
modules like stock, sale_management, mrp_workorder, ...
We therefore decided to remove those options from settings to prevent
users from uninstalling it.
This commit is related to task ID 1841221.
- Create the following BOM structure:
```
Prod 1 (Manufacture)
|
--- Prod 2
Prod 3 (Kit)
|
--- Prod 4
Prod 5
```
- The BOMs for Prod 1 & 3 must have a routing set, to generate
workorders
- Create a MO for 1 unit of Prod 1, process to the end
2 units of Prod 1 are created instead of 1.
This is due to the WO for Prod 3 not having a `next_work_order_id`.
Therefore, `record_production` adds an extra quantity at:
```
production_move.quantity_done += self.qty_producing
```
To prevent this, we set as `next_work_order_id` of the BOM of Prod 3 the
WO of Prod 1.
Closes#19527
opw-1817398
- Create a Finished Product tracked by SN
- Add a BoM with routing (in several steps) to that product: component A
should be consumed in 1st step and component B in 2nd step
- Create a MO, plan it, go on the first WO and produce the finished
product with SN 0001
- Then go on the second WO and produce the finished product with SN 0002
- Back on your MO, you'll see that
Finished Product = SN 0002
Component A has been consumed for SN 0001
Component B has been consumed for SN 0002
- Mark the MO as done
No blocking error is raised so I'm consuming a product for a finished
product I'm not really producing. Traceability report will be wrong too.
We raise a blocking error to avoid this use case.
opw-1832098
Co-authored-by: Nicolas Martinelli <nim@odoo.com>
* [FIX] mrp: negative workorder issues
- In the onchange of the qty_producing in the wo,
we need to add the date to the stock.move.line as
it is a required field.
- When starting a workorder, check first if it has
not already been done.
At the creation of a manufacturing order, the default values for product_qty
and uom is respectively 1 and the product's one. We now use the the values
given by the bom
The field quantity_done_store had the same label as the field product_uom_qty
on model "stock.move" and there were confusions in the pivot view of
"stock.move".
opw:1841097
Use case to reproduce:
- Create a BOM with a byproduct tracked and a routing
- Mark the last workorder as done
- by products move line are not created
With the wizard produce (MO without routing) move lines
are created. Thus there is an inconsistency.
It happpens because workorders and produce button do not use
the same function. commit 1a09bcc622
already fix it for production wizard however it forgets workorders
process.
opw-1838707
Do not try to keep the reservation when creating a backorder for two
reasons:
1) it doesn't make sense since the backordered move will only be
confirmed while it got some reserved move lines
2) with badly configured uom's rounding, it is possible that the
initial demand of the backorder is inferior to the now reserved
quantity
We also fix another "cannot unreserve more than available" cause that
could happen in the second case ; let's imagine in the second case that
the backordered quantity is 0.999, `_update_reserved_qty` will reserve
0.999 on the quants but do not create a move line as range (0, 0.999)
will not return anything.
We remove `test_split_1` as it tested a behavior we removed and add a
new test showing a new flow with what we fixed.
Please note that setting the rounding of unit to 1.0 would have
prevented all the issues here.
The reified view on the res users will be dropped in the following commit.
The previous commit adds support to define each group as a computed field on the res users.
This commit defines:
- A boolean field for each 'isolated' res.group, i.e. a group in the hidden category.
- A selection field for each 'Application' res.group, i.e. a group in a application category.
Example:
- The group to manage pricelist in sales becomes a boolean field
- The groups project user/manager become a selection field
- Create a MO for Product A with quantity to produce of 2
- Produce 1
- Open the associated BOM, and add a line to the bom
- Go back to the MO and try to update the qty to produce to 1
Traceback: division by 0
opw-1838006
When producing a byproduct in a BoM, the quantity for the byproduct was
increased by twice its produced quantity.
This is essentially a revert of commit d7fdb636b8
which was erroneously forward-ported to 11.0,
where byproducts were already correctly counted.
opw:1834226
There was a filter 'Bom Components', that didn't filter anything. So we
make it work to show the products/product templates that are used as
components in BOM.
We've also added a filter 'Manufactured Products' that show the
products/product templates that have at least one BOM
TASK-54350
- Display correct bom count for product, before this commit it was
not displaying the bom count when we have bom for template without variant.
task-39561
Purpose
=======
Compute cost of product(s) based on it's BoM
Specification
=============
real_time: not with FIFO otherwise open the
wizard with the bom price as default new value
periodic: directly set the cost on the form view
Add a server action in order to directly set the price
on selected product.
When getting price from a bom with a sub-bom it will take the
cost of the sub bom except if the sub-bom is set with the bom
itself in the server action (in this case the sub bom cost will
be used).
Capacity is not used for this functionality
task-39561
Use case to reproduce:
- Create a picking containing 2 moves that have a quantity_done greater than reserved quantity
- Validate the picking with or without backorder
Traceback due to a record that do not exist anymore.
It happens due to 2 functionality that have a wrong behavior when used together:
- merge_move function that will try to merge moves with same characteristics inside a same picking.
- action_done functionality that will create an extra move if the quantity done for a move is greater
than reserved quantity. (the extra move is used in order to propagate changes)
With our usecase:
- MOVE A, reserved_qty: 10, qty_done: 20
- MOVE B, reserved_qty: 10, qty_done: 15
action_done on move A will create a new move thus we will have
- MOVE A, reserved_qty: 10, qty_done: 20
- A bis, reserved_qty: 10, qty_done: 0
- MOVE B, reserved_qty: 10, qty_done: 15
then merge move will not only merge move A and A bis but will also merge B
which result with inconsenstencies and traceback since system will try to
process move B after A
- MOVE A,A',B reserved_qty:30, qty_done:35 (the 5 extra qty is not propagated)
This commit adds a kwarg in action_confirm that is propagated to merge_move
this kwargs is a record set taht will limit the moves that can be used for the merge
in order to merge extra move in original move
opw-1825264
- Create a Product A with attribute color and attribute values white and
black.
- Create 3 products (Components 1, 2 and 3)
- Create a BOM for A like:
Component 1, Variant column is empty
Component 2, Variant white
Component 3, Variant black
- Go to Inventory > Master Data > Product Variants, and open one of the
2 variants of Product A
The BOM count is zero, while it should be 1.
The current implementation of `bom_count` doesn't take into account
attributes that can be set on the BOM line.
opw-1814973