How to setup stock routes to Buy, only if MTO cannot cover demand? [Odoo v11]
I have been struggling for hours to setup routes and procurement rules to achieve the following.
I have 4 instances of a certain product in stock. I create a new sales order with a demand of 6 instances. I expect Odoo to reserve all 4 instances for delivery, and create a purchase order for 2 instances from a vendor. If I had 8 instances, only the instances from stock shall be used and no purchase order shall be created.
I used the Make To Order and Buy routes. However, instead of the expected behaviour above, purchase orders are created in any case, i.e. instances in stock are not honoured.
Has anybody an idea how to setup this workflow? I am using Odoo v11.
I have been up and down the whole internet, twice. The official documentation  suggests that Odoo is capable of doing this, but either I cannot get it to work somehow at my installation, or it's simply not documented well. Three years ago somebody mentioned that Odoo would be capable of doing this in the forums . There exist some addons that claim to solve this issue, but some skimming through the code of the stock addon suggests, that the functionality in fact is there. I have found a seemingly cumbersome workaround , which I haven't tried yet and which employs too much handiwork for a system that should be able to do this by itself.