Odoo Help

Welcome!

This community 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.

0

How can I show a "Not enough product at hand" warning when trying to sell products with a forecasted inventory (incoming products)?

By
Fermin Arellano
on 1/6/15, 1:16 AM 740 views

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. 

I forgot to mention that we are a brick and mortar store, we dont sell anything online.

Fermin Arellano
on 1/15/15, 2:44 PM
1

Baiju

--Baiju--
3154
| 5 4 8
Kochi, India
--Baiju--
ODOO technical and functional

        I like learning new thing, especially technical thing. I am a quick learner, I can learn technical things very fast. I have good logical skill,  I have immense interest in programming.

e-mail id : baijuks@hotmail.com

Baiju
On 1/6/15, 3:10 AM

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 : baijuks@hotmail.com

 

0

Ivan

--Ivan--
3210
| 5 3 6
Jakarta, Indonesia
--Ivan--
Ivan
On 1/6/15, 3:00 AM

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.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 1/6/15, 1:16 AM
Seen: 740 times
Last updated: 3/16/15, 8:10 AM