Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
How can I show a "Not enough product at hand" warning when trying to sell products with a forecasted inventory (incoming products)?
This is the scenario:
I have a product "hammer", which I have the following inventory (At hand: 7 units, Forecasted: 7 units).
So a client comes in asking for 5 hammers, the salesman makes the sales order and the client goes to the cashier and gets his invoice. He thens gets delivered his 5 hammers and leaves.
That transaction would leave my inventory as follows (At hand: 2 units, Forecasted: 2 Units).
Now Im gonna make a purchase order for 5 hammers. I confirm my purchase order and my supplier is going to send the products on 15 days.
That transaction would leave my inventory as follows (At hand: 2 units, Forecasted: 7 Units).
Then a new client walks in on a date previous to the arrival of my new batch of hammers and he tries to buy 5 hammers. When the salesman add the 5 hammers in the Sales Orders no warning shows up telling him he is trying to sell 5 hammers when he only has 2 at hand. But if I try to sell more than 7 hammers, which is my forecasted inventory, a warning does show up.
Is this a bug, or is it easily configurable so that the "not enough product at hand" warning shows up when trying to sell more products than the ones at hand and not the forecasted one.
Hi Arellano, We can block the sale (if quantity is not available) by following process:-
we can do some customizations in sale module to achive that change, For that you need to inherit the product_id_change_with_wh function and override to meet our new requirement.
In our function we have to give checking for quantity and block sale if quantity if not available. I have done this for one of my client. For any queries contact : email@example.com
In v7 the warning is controlled by the code in addons/sale_stock/sale_stock.py (line 622-629 or thereabout). It does compare the sold quantity with virtual_available attribute of the product which takes Forecasted quantity into account. If you want to change the warning, you need to inherit this method and change the logic.
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 1/6/15, 1:16 AM|
|Seen: 878 times|
|Last updated: 3/16/15, 8:10 AM|