Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
7348 Widoki

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. 

Awatar
Odrzuć
Autor

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

Najlepsza odpowiedź

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

 

Awatar
Odrzuć
Najlepsza odpowiedź

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.

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
2
cze 24
4899
1
lut 22
2631
2
maj 18
4687
0
lis 16
3507
1
lut 23
2486