Automatic order point (create_automatic_op)only applied to products you purchase

Bug #939790 reported by Don Kirkby
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Committed
Medium
OpenERP R&D Addons Team 2

Bug Description

As part of bug 627936, Dukai Gábor added filters to the minimum stock rule scheduler so that it will only look at products that are active and can be purchased. I agree with filtering on the active flag, but we turn off the "can be purchased" flag for products that we produce, because we will never create a purchase order for them. However, we still want to generate production orders for products that we produce when they drop below the minimum quantity.

Remember that minimum stock rules are used to generate production orders as well as purchase orders.

I'm running OpenERP version 5.0.16 on Ubuntu 10.04.

See comment #3 for the steps to reproduce the bug in 6.1. Here are the steps to reproduce the bug in 5.0.16:
1. Create a sample database with the manufacturing profile. Use the default settings for everything, except the chart of accounts should be None, and the extra modules should be mrp and mrp_jit.
2. Open product PC1, and check that supply method is produce. Clear the checkbox for can be purchased and save. This marks it as a product that we always produce and never purchase.
3. Compute all schedulers. Use the default settings.
4. Count the number of production orders. I see 11 in my sample database.
5. Check the virtual stock of PC1. I see six.
6. Check the minimum stock rule's minimum and maximum quantities for PC1. I see three and five.
7. Create a sales order to Agrolait with PC1. Set the quantity high enough to drop the virtual stock below the minimum quantity. I used four.
8. Confirm the sales order.
9. Check virtual stock is below minimum quantity. I see two.
10. Compute all schedulers with the default settings.
11. Check number of production orders.
Expected result: more production orders to bring PC1's quantity above the minimum.
Actual result: no change in the number of production orders. I see 11.
12. Check virtual stock of PC1.
Expected result: the maximum quantity from the minimum stock rule. I expected five.
Actual result: no change. I see two.

Related branches

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

Hello Don Kirkby,

I have checked your issue with latest trunk at my end, but all are working as expected.

So would you please check with the trunk version and notify us your issue is only effecting for 5.0.16 or trunk also.

Thanks and waiting for your reply!

Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Don Kirkby (donkirkby) wrote :

I tried my scenario on the trunk version, Amit, and the fix for bug 627936 was slightly more restricted there than in 5.0. It only added filters to the automatic orderpoint, not minimum stock rules. I think it's still a bug, though. Shouldn't automatic orderpoints generate manufacturing orders as well as purchase orders?

Make the following changes to my scenario for the trunk version:
- In step 1, install mrp and sale modules.
- In step 4, clear the Ready state filter on the Manufacturing Orders screen to see all manufacturing orders. I see nine.
- In step 5, I see quantity available of 14.
- In step 6, delete the minimum stock rule.
- In step 7, drop the quantity below zero. I used 15.
- In steps 3 and 10, check the automatic orderpoint checkbox.
- In step 12, I expect to see the quantity available back at zero, but there is no change.

Revision history for this message
Don Kirkby (donkirkby) wrote :

The relevant code in trunk is line 179 of addons/procurement/schedulers.py.

http://bazaar.launchpad.net/~openerp/openobject-addons/trunk/view/6645/procurement/schedulers.py#L179

Amit Parik (amit-parik)
summary: - Minimum stock rules only applied to products you purchase
+ Automatic order point (create_automatic_op)only applied to products you
+ purchase
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Don Kirkby,

Thanks for your quick response.

Now I have reproduce the same.

I have tried both of the scenario as follow.

1) My product's virtual stock gone < 0 i.e -1, product's supply method is buy and purchase_ok =True. Now I runs the scheduler with automatic order point. I have seen that the MO created for 1.00 qty and virtual stock=0.0. Which is correct.

2)Again my product's virtual stock gone < 0 i.e -1, product's supply method is buy and purchase_ok =False. Now I runs the scheduler with automatic order point. I have seen no MO for it and virtual stock is same -1. Which is wrong.

Thanks you!

Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
importance: Undecided → Medium
status: Incomplete → Confirmed
Revision history for this message
Don Kirkby (donkirkby) wrote :

Amit, I think you meant "supply method is produce" in your scenarios, right?

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

Hi Don,

You are absolutely right.. :-) . In my scenario "supply method" is produce.

Thanks

Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Mayur Maheshwari(OpenERP) (mma-openerp) wrote :

Hello Don,

Thanks for your contribution.
It has been fixed in lp:~openerp-dev/openobject-addons/trunk-bug-939790-mma With
Revision ID: <email address hidden>
Revision num: 6670.

It will be available in trunk soon.

Changed in openobject-addons:
status: In Progress → Fix Committed
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.