Dispensing of Drug - (D) button => confirm delivery if “D” option is present. Should respect the other above configuration of #BAH-853
This scenario is used in cases - when the provider prescribes a drug, and dispenses drug from his/her location. (In many rural settings, the doctor/provider will dispense the drug right after the consultation). By default, the drug order would create a quotation, which the user would have to confirm sale in Odoo. Instead of doing that, the provider clicks the “D” button of the medication in clinical module. This has following expectations
The quotation needs to be automatically confirmed (sale confirmation)
The delivery order resulting out of confirmation of sale - should be validated automatically.
The stock location (source location of delivery) is identified by means of “Order Type - Shop mapping”. Meaning, if the provider location is “OPD-1”, then there must be a OrderType-Shop mapping for OPD-1.
If no such mapping relevant to the “order location” is found - the stock location is identified by looking up any “Drug Order” type mapping in the “OrderType-Shop map”.
Validation of delivery should respect the configuration settings in “sales / configruation/ settings”. mainly the 2 configurations below
“Validate delivery when order confirmed” - validation when this configuration is enabled.
If stock is not available at stock location (see b above for logic) - then validation of delivery with negative stock is allowed only if “Allow negative stock” is enabled.
Invoice needs to be generated with default option and payment registered by “cash”