This question has been flagged
1 Reply
4176 Views

Hi,

My customer has used "force availability" function to process some delivery order. Then he come back to me and told me the quantity on stock were now wrong.
I made some research on the odoo code and discover this : 

According to the comment of the def _quant_create in stock.py line 506:
'''Create a quant in the destination location and create a negative quant in the source location if it's an internal location.
'''
Then on the def you can notice the code:
        if move.location_id.usage == 'internal':
            #if we were trying to move something from an internal location and reach here (quant creation),
            #it means that a negative quant has to be created as well.
            ...
            negative_quant_id = self.create(cr, SUPERUSER_ID, negative_vals, context=context)

So : 

For a stock move from "stock" to "partenr" (a delivery order):
If we "force assignation" when the available quantity are set to 0,
By processing the delivery order the system will not create the negative stock in the source location.
This mean the available quantity will stay to 0 instead of beeing -1. 

Is it a correct behavior ? 

PS: this seems to be working if the product is set as "consommable" and not "stockable"... so what about the stockable ?

 

PS2 : Actually i didn't read correctly : if move.location_id.usage == 'internal':

The code is corrrectly writed. :)

 

 

Thanks in advance

Avatar
Discard
Best Answer

Hi,

Actually the odoo build in functionality is to do like that...

when u click "Check availability" if product available then it makes "deliver" button to view...

if not force availability is the only option...

but force availability takes the quantity from "quantity on hand". so on emergency purpose only we should use "force availability"... or else use "check availability"

Avatar
Discard