-Test the function _bom_find to check that it searches the bom corresponding
to the properties passed or takes the bom with the smallest sequence.
For this commit: d357667df4279070b51af58cad55ef314688d69f
- Test the function _bom_explode to check that it only takes the lines with the
right properties.
For this commit: 6b6e71a3e0c86aa8a9b8c4f20eaa61b17c64ce7b
Now it's possible to put a property on a bom line.
For example, the bom for an apple pie and for an apricot pie can be made
in a single bom.
Three lines are necessary in the bom of the product "pie":
- First line with product " dough" without property
- Second line, with product "apple" with property "apple" if you want an apple pie
- Third line, with product "apricot" with property "apricot" if you want an apricot pie
The type of this bom pie must be "set" to allow the customer to assemblate
his favorite pie by himself.
Now to sell an apple pie, you must create a SO with the product "pie" and
the property "apple".
In that way, the delivery order consists of two lines:
- dough
- apple
The bom related to the product in a sale line order must be
filtered by the function _bom_find. If two boms can be applied
on a product, the bom with the smallest sequence is applied.
opw:632558
The action_confirm function losses the context when called by a workflow.
To have the right translation, the lang of the user must be written in the context.
opw:632873
Relax the constraint on BoM to allow to have two different lines with the same
product. As the error message says, the purpose of the constraint was to forbid
having the manufactured product as one of the components but had this side
effect.
Such scenario of the same product twice makes sense when using the date
attributes on the lines (e.g. changing quantities)
opw 621468
Actions button on the work order lines can change the state of the manufacturing
order. As for the product lines, reload the form after actions.
opw 625424
In BOM, when performing an advanced search
on "BOM Lines" contains "a name"
all lines were returned, whatever the lines content.
This was due to the simple fact no field 'name'
was set on the mrp.bom.line model.
We set "product_id" as _rec_name, it seems the more
logical choice.
opw-631335
It is very cumbersome to define routes which have 2 step in on production for certain products with
procurement rules (e.g. Stock > Raw Materials Location > Production), when the
products are MTS elsewhere. That is why we add the possibility, which might be elaborated in the future,
to define rules e.g. from Stock > Production, which you can put on the product / product categories. These
rules will only define the procure_method for now.
ORM will show lines in production.move_lines even if done (which the domain should avoid)
when processing the production (as they are probably still in cache). We explicitly skip those lines.
When producing more with lots in consumed and produced, we added the consumed_for link as
the lot tracking requires to have this link between the consumed and produced moves.
The extra move of the produced goods should also be confirmed and not created as confirmed immediately.
That way it can still apply the push rules. (Gabriel Demmerle)
In manufacturing bom lines, digits_compute is set
to the precision 'Product Unit of Measure'.
It should be the case as well in the produce wizard,
otherwise you won't be able to change the quantity
within this wizard to the according product quantity precision
opw-629657
BOM Lines are ordered by a sequence field,
the "handle" widget makes even possible the lines reordering.
The order was respected within the mrp.production
(in o2m products to consume and consumed products)
but not within the mrp.product.produce wizard
opw-629629
When comparing a float value to 0.0,
it can happen the float value is very near to 0.0,
but not exactly 0. This is the point to use float_compare,
```float_compare(qty, 0, self.pool['decimal.precision'].precision_get(cr, uid, 'Product Unit of Measure'))´´´
will compare qty to 0, with the product unit of measure precision (0.01 by default).
So, if qty is equal to 0.00001, this means the qty is regarded as equal to 0.0.
(float_compare will return 1).
Debian does not allow fetching data from external website at runtime.
This fixes the privacy-breach-generic lintian warnings for Debian packaging.
The removed youtube url was a dead link...
Upstream traceability on produced goods (serial number on finished product) was
broken due to wrong values in cache for production.move_lines2 after production.
Refresh the value of production after each action_consume to make such the state
of the cache is correct. opw 609450
Similar fix for manufactruing order not going in done state in some specific
configrations (e.g. some components being phantom BOM).
Again due to wrong cache state after consumption. opw 610515
Fixes#1296
The method test_if_product, used in the workflow to test that the mrp production is for a product (!= service), used to call the method _action_compute_lines in order to compute the production lines and determine from them the production type.
The thing is, the method _action_compute_lines, despite the fact it returns the lines of the production, actually creates the lines. So, just to test if the production was of product type, the productin lines were created, in database.
This rev. introduces a _prepare_lines method, which returns the computed production lines, without actually creating them in database, so the test_if_product method can test if the production is of product type without creating the production lines.
Therefore, production lines are now computed and created during the action_compute method, instead of computing them when the production was tested to get the production type.
Computing the lines before the action_compute has as side effect to not set the scheduled date of the work orders in module mrp_operations, at MO confirmation (as, on confirmation, the action_compute method is called only for productions for which the lines are not yet computed, and mrp_operations overide action_compute to set the scheduled date)
opw-620189
Pass group_id information when a manufacturing order is created from
a procurement to keep a better traceability and know the reason of stock.move
creation.
Fixes#4019
if the bom is phantom and has no line, we attempt to find a new bom with the default product uom
This is possible that we find the same bom that the current one
In such a case, we must not explode, to avoid recursion.
This rev. 7307227 ensured to not (re-)set the state 'confirmed' to exploded moves with a more advanced state (for instance, 'assigned')
Nevertheless, the location chaining is performed on the move confirmation, through the action_confirm method of the stock.move model. Besides, the resulting moves of the _action_explode method had the state 'confirmed' on creation, the 'confirmed' state wasn't set by the method 'action_confirm', meaning that the moves were confirmed without having the location chaining done. Allowing moves to go through the action_confirm method even if the state was 'confirmed' or further triggered the location chaining.
Preventing already confirmed moves to go through the action_confirm method prevented the location chaining, thus.
We now create the resulting moves with the 'draft' state, and then confirm them through the procurement workflow signal 'button_confirm'. Thus, the resulting moves are confirmed by going through the action_confirm method, writing the confirmed state and triggering the location chaining at the same time. We then write the 'assigned' state if necessary.
opw-617235