summaryrefslogtreecommitdiff
path: root/setup/package.py
diff options
context:
space:
mode:
authorDenis Ledoux <dle@odoo.com>2015-01-14 15:22:57 +0100
committerDenis Ledoux <dle@odoo.com>2015-01-14 15:37:27 +0100
commit30a7bea024195367a0d24ea2343e08edc36b3b3a (patch)
tree1fd79029bd4e50fe75ce79df2e6aca8631585848 /setup/package.py
parent70a51cd7610111d840ea8b2e8f7b609a1d983769 (diff)
[FIX] mrp: prevent creating production lines when testing if production is of product type
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
Diffstat (limited to 'setup/package.py')
0 files changed, 0 insertions, 0 deletions