[6.0.3][6.1.rc1] Infinite loop in procurement run by scheduler

Bug #918288 reported by Yann Papouin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Invalid
Undecided
Unassigned

Bug Description

Steps to reproduce:

- Create new database with demonstration data
- Log in as Administrator
- Install [SALES], [PURCHASE], [WAREHOUSE], [MRP]

[SALES]
Create a new product "Product A" and set:
- Product Type: Stockable Product
- Procurement Method: Make to Order
- Supply method : Produce

[MANUFACTURING]
Create a new BOM for "Product A" and set:
- BoM Type: Sets / Phantom
- Add component [SIDEPAN] Side Panel with quantity of 1.0

 (our objective is to link the component SIDEPAN to "Product A" without generating a production order)

[SALES]
Create a new quotation for partner "Ecole de Commerce de Liege"
- Add a line for "Product A"
- Confirm Quotation to create a sale order

[WAREHOUSE]
Run schedulers manually with "Compute Schedulers"
- Compute
- Go to "Procurement Exceptions" and uncheck "To fix" in order to view everything

=== USER POINT OF VIEW ===

Results:
You can see "Product A" is locked in "Confirmed" state

=== SERVER POINT OF VIEW ===

Results:
A new python thread is stuck in an infinite loop "while True" in _procure_confirm (schedulers.py), if you debug the process you will see that:
- "offset" is never increased
- "report_total" is constantly increased

description: updated
Revision history for this message
Yann Papouin (yann-papouin) wrote :

Can be reproduced on [6.1.rc1]:
------------------------------------
Follow same steps, but you will notice that both user and server point of view are fixed in this version with this use case but a manual procurement shows off the problem again

To reproduce, go to:

[SALES]
- Open "Product A" form view
- In actions, launch a "Procurement Request" with default settings

[WAREHOUSE]
Run schedulers manually with "Compute Schedulers"
- Compute
- Go to "Procurement Exceptions" and uncheck "To fix" in order to view everything

=== USER POINT OF VIEW ===

Results:
You can see "Product A" is locked in "Confirmed" state

=== SERVER POINT OF VIEW ===

Results:
A new python thread is stuck in an infinite loop

summary: - [6.0.3] Infinite loop in procurement run by scheduler
+ [6.0.3][6.1.rc1] Infinite loop in procurement run by scheduler
Revision history for this message
Yann Papouin (yann-papouin) wrote :

In both case, I can notice that even the "Run procurement" button does nothing (and that's what the _procure_confirm method also does with "wf_service.trg_validate(uid, 'procurement.order', proc.id, 'button_check', cr)").

So it seems that it's related to a workflow missing step.
Thread-48 - pid17141_seq12
 get_phantom_bom_id [procurement.py:51]
 function_proxy [orm.py:366]
 <module> [server:1]
 safe_eval [safe_eval.py:296]
 _eval_expr [wkf_expr.py:58]
 check [wkf_expr.py:81]
 _split_test [workitem.py:158]
 process [workitem.py:61]
 validate [instance.py:48]
 trg_validate [wkf_service.py:124]
 _procure_confirm [schedulers.py:82]
 run_scheduler [schedulers.py:39]
 _procure_calculation_all [schedulers_all.py:52]
 run [threading.py:484]
 __bootstrap_inner [threading.py:532]
 __bootstrap [threading.py:504]

Revision history for this message
Yann Papouin (yann-papouin) wrote :
Revision history for this message
Yann Papouin (yann-papouin) wrote :
Revision history for this message
Yann Papouin (yann-papouin) wrote :

step1.ogv reproduce all steps of the original bug description, but as described in comment #1 it seems that the 6.0.3 bug has been removed in the 6.1.rc1.

step2.ovg is the sequel described in comment #1, you will see in this part the procurement bug that exists in 6.0.3 and 6.1.rc1.

Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Yann,

I have checked your issue but I think you have missed something.

Here the side panel product 's configuration is (Make to stock-> buy) and our real stock is 0.0.
Whenever we run the scheduler it will going to create a MO for product A(as per your scenario) but here we don't have real stock of side panel as well as we don't have create a 'Minimum' Stock Rule' that's why our stock do not assigned for MO. So finally our product A's procurement goes into 'waiting' state because we doesn't have required 'virtual' stock.

So would you please create a 'Minimum' Stock Rule' for side panel or assigned the real stock for this product. Would you please try after this then notify us where you have faced the problem.

Thanks and waiting for your reply!

Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for OpenERP Addons because there has been no activity for 60 days.]

Changed in openobject-addons:
status: Incomplete → Expired
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Yann,

Would you please try as per my comment#6.

Currently I am closing this issue, If you still faced the problem then you can reopen this with more info.

Thank you!

Changed in openobject-addons:
status: Expired → Invalid
Revision history for this message
Yann Papouin (yann-papouin) wrote :

Sorry but I'm bored to always have to re explain all my bug reports ... procurement method is "On order".

Revision history for this message
Nicolas Réau (kolia) wrote :

Ah, looks like I entered the infinite loop... Procurements locked in Confirmed state here too.

Yann: When I enter the procurement form and click "Run procurement", it generates the MO. But the scheduler indeed won't do that.

Do you experience this too?

Revision history for this message
Nicolas Réau (kolia) wrote :

Yann: Just reread your comment #2,, so apparently you were not in that case, at least in 6.1RC1. What about now in 6.1?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.