Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: BAH-1169: Update instructions for Syncable Units Mapping

Bahmni provides addOns that enable and enhance sales, delivery, invoicing features of Odoo. e.g automatic quotation generation, pricing determinations for medications, delivery automation etc. In addition, Bahmni also tries to provide convenient features, optimizations etc, and tries to do so non-intrusively and without changing core Odoo process/workflows. 

Before you start registering sale, you should setup and configure your sales settings first.

Go to "Menu / Sales/ Configuration / Settings" and review configuration relevant for products, pricing, customer, sales, shipping etc. For example, you might want to enable "Allow discounts on sales order lines" for discounts settings. Bahmni feature relevant setups and configurations are described contextually below.  

Order Types

These reflect the different Order types from Bahmni Clinical Systems. Currently Bahmni supports syncing of the following Order Types

  • Drug Order
  • Lab Order
  • Radiology Order

Orders are processed for matching order types. If a matching order’s “Order type” is not found in Odoo, that particular order will be skipped. You can find out the order type names in OpenMRS database using the following query

Code Block
$ mysql -uroot -p<password> openmrs 
> select name from order_type;

Corresponding the Order Type names discovered above, you need to create corresponding Order Types in Odoo. To do that:

Go to "Menu / Sales / Configuration /Order Types", and create the Order Types if not already present.  

Note, the Order Type names must match exactly (casing, spaces etc) correspond to the Order Types defined in OpenMRS.


“Shops” help to specify stock locations by billing stations/counters, also so that the inventory can be managed well in Odoo, and also to define default payment terms and price list association. This is achieved by mapping stock login location to shops. The quotation gets created for the shop (e.g. OPD Billing) that is mapped to the stock location (OPD Pharmacy) from where the drug is delivered/dispensed from. 

To define shops, go to "Menu / Sales / Configuration / Shop"

For example, to create a OPD Billing Shop, create as shop as below: 

  1. Shop Name = OPD Billing. (Similarly consider creating other shops like “IPD Pharmacy” or “Special Billing” etc).
  2. Specify Warehouse = Main WH (Select the warehouse where your stocks are managed) 
  3. Location = WH/OPD Pharmacy (Select the Internal stock location wherefrom products will be delivered) 
  4. Default Payment Term : Immediate Payment (select from dropdown)
  5. Price = Select or a create price list applicable at this shop. If you specify a pricelist, then the pricelist will be associated and potentially form the basis for sale price, if products are associated with this pricelist.

Order Type - Shop Mapping

Once you have defined “Order Types” and "Shops", you should then go about configuring what types of orders are processed where and what stock location any drugs/consumables will be delivered from. This is done through Order Type & Shop mapping, and this mapping can be further associated with the orderer's location, i.e where a care provider orders from. 

Go to "Menu / Sales / Configuration / Order Type - Shop mapping".  

You should start from default mappings and then go about defining more specific maps corresponding to orderer's location. 

Add entries as below:

  • Order Type = select from dropdown
  • Shop = select from dropdown. 
  • Location Name = select stock location from drop down. This gets defaulted when you choose a shop and if that shop has an associated stock location, but you can mention a different stock location here. 
  • Order Location Name = type in the “order location” name.  Orderer's location corresponds to Login location in Bahmni Clinical.  

Suppose, you have 2 shops (stations or counters), "OPD Billing", "IPD BIlling" associated with stock locations "OPD Pharmacy", "IPD Pharmacy" respectively, you may want to start as follows. 

  • By default, all orders of all types be be processed at 'OPD Billing' where 'OPD Pharmacy' would be the default stock location for delivery.
  • If ordered from 'General Ward' or 'Labour Ward' or 'Operation Theatre' - to be processed at 'IPD Billing', where 'IPD Pharmacy' would be the default stock location for delivery.

You can even split the 'Order Types' to be processed by different shops and to be delivered from different locations. For example: You can setup a mapping such that “Drug Order” by a doctor from “Special OPD” login location,  should be processed at “Special Billing” shop and delivered from local stock room where “Doctor's Samples Stock”. (And while defining "Special Billing" shop, maybe you have associated a "Discounted Price List" - then a different pricing can be applied)

When a care provider orders drugs, lab tests or radiology tests or procedures,  corresponding orders are raised from OpenMRS. While these orders are processed, Bahmni tries to first an Order type matching 'Order Location Name' and 'Order Type', if not then it would identify the first matching mapping for the 'Order Type'. 

Syncable Units Mapping

This is mainly used for synchronizing “Dosing Units” relevant to medications/drugs. The setup should be according to the "dosing units" concept metadata set in OpenMRS. 

Go to “https://<bahmni-server>/openmrs/dictionary/index.htm

ordered quantity units from OpenMRS to Odoo.

In OpenMRS, verify the list of units available

Order quantity units are specified via the Dosing Units concept set in OpenMRS

  • Go to the OpenMRS concept dictionary and search for “Dosing Units”
  • Click the result entry, which would show the "Dosing Units" concepts and all its associated "Set Members"

Image Added

In Odoo, activate the extended support for Units

First the extended support units must be activated in Odoo by clicking the appropriate setting:

As a system developer role, go to "Menu / Sales / Configuration /

Syncable Units


, and create corresponding entries. Which may look like
  • Tablet
  • Tablet(s)
  • Capsule
  • Capsule(s)
  • Mg
  • IU
  • Drop
  • Tablespoon
  • Teaspoon
  • Puff
  • ml
  • Unit(s)

and tick: `Some products may be sold/purchased in different units of measure (advanced)`

Image Added

In Odoo, set the mappings between OpenMRS Units and Odoo Units

Go to "Menu / Sales / Configuration / Syncable Units Mapping".

Create entries that match the OpenMRS quantity units with exactly the concept FSN (in the default locale) and associate to it the equivalent found from Odoo. Create the Odoo unit if needed.

For instance:

Image Added

In Odoo, update the product units to match their stocking unit

Make sure to also update your products units to their stocking unit. Note that they do not have to exactly match the ordering units from OpenMRS, but they must be in the same Unit Of Measure Category, such as Volume, Length, Weight...

For instance:

Image Added

Sale Price for Products

Odoo provides multiple ways to define sale price(s) of a product. Even at specific product level, you can define different options. A comprehensive guide to pricing is beyond our scope, so only the essence is covered here. You should checkout Odoo webinars for pricing and sales. 

Go to “Menu / Sales / Configuration / Settings”, and check pricing options. 

Image RemovedImage Added

  • The first option is basically defining a Single Sale Price for the product. 
  • The 2,3 options enable more advanced “pricelist” concepts (you can see under “Menu / Sales / Configuration / Pricelists ”. Option 2, allow you a simplistic volume price list means (useful in a local price contexts). Option 3 - enable you to define pricing based on advanced formulas. 

In addition, Bahmni allows an addon with which you can define a markup percentage over cost price to arrive at sale price. This feature is applicable for products which have tracking enabled (lots/serial number). While receiving products, sale prices are calculated based on the markup percentage defined for product cost price. See "Price Markup" Section in "Odoo Purchase Configuration"If markup configuration is enabled, within a quotation/sale order, if you select a lot/serial for a product, the markup based sale price will be applied.  

Eventually the 'Unit price' that is applied at a line item in a Quotation/Sale order, is arrived in the following order, based on configuration and setup:

  1. Basic Product Single Sale Price
  2. Price list based Sale Price - if such a pricelist is applied on a quotation
  3. Cost Markup based Sale price - if “Determine sale price based on cost price markup” configuration is enabled. 


Validate delivery when sale is confirmed

By default, whenever a "sale order" is confirmed, Odoo will create “delivery orders” to be processed. Often, there are scenarios, where the dispension happens from the same place as 'billing' (e.g. a pharmacy in a small hospital) and if you would want to simplify and activate through a single workflow, you  may choose to enable automatic validation of delivery order.  

To do this, go to “Menu / Sale / Configuration / Settings” and enable the configuration element

If the “Validate delivery when order confirmed” is not enabled, then the default process of “Delivery Order” creation is followed, meaning then you will need to go to “Menu / Inventory / Delivery Orders” and manually validate the delivery order for the sale. 

Allowing Negative Stock

In the process above, delivery orders will not be automatically validated if there is not enough stock at the specified stock location mentioned in the “sale order”.  If you want to force negative stock in the process, you need to enable the confirmation “Allow negative stock” as shown in the screenshot above. Note, if the product is tracked in lots/Serial No, then on unavailability of stock, this would not be satisfied, and the delivery order will not be marked as 'Done' and will require manual intervention. 

Invoicing Option

Once a order is confirmed, you can click "Create Invoice" button, and Odoo default flow will show different invoicing options .

  • Invoiceable lines/Invoiceable lines (deduct down payments): Choose this option if you both want to invoice the lines and deduct any down payments you have received. This is the default option. 
  • Using Invoiceable lines without deducting down payments will simply ignore any of those payments when producing the invoice.
  • Down payment (percentage): You will be prompted to enter the percentage amount of the down payment.
  • Down payment (fixed amount): You will be prompted to enter a fixed amount for the down payment.

Once you choose an invoice option, you will have to go through the process of confirming the invoice, and registering payment. 

If your implementation does not have different multiple invoicing options like above, then it might make sense for you to skip the invoice options. You can do this by configuring a user level settings. 

Go to "Menu / Settings / Users /", edit an user from the list, and under "Technical Settings", check for

Once you have enabled this configuration for a user, then when the user confirms a sale, then it will automate the Invoice option and generation and validation process, and directly take the user to register the payment. 

  • User Confirms Sale Order.
  • Invoice will be created and validated automatically. The default is “invoiceable lines” (deduct down payments). 
  • Register Payment screen will appear in front of user so she can simply fill the amount.

Medication Dispensing Setup

This feature is useful when the care provider himself/herself dispenses medicine during consultation and wants the inventory and payments to be automated as well. This is useful in small or single doctor clinics, where the care provider dispenses medicines, receives payment after the consultation - while in the system automating sale, delivery, order, payment etc  

This feature works in conjunction with Bahmni order features in clinical apps, and in relevant for medications and consumables. Whenever a medication is marked as dispensed (e.g. D button against a medication order in Bahmni Clinical) by a provider, depending on configuration and settings, you may automate the following 

  1. Confirm sale order for the dispensed drugs/medications
  2. Validate delivery of product to customers, and inventory adjustments at dispensed stock locations
  3. Generate Invoice for the dispensed drugs/medications
  4. Register payment for the generated invoice

To do so, you need to enable the following configuration is “Menu / Sales / Configuration / Settings”

  • “Allow to automatically convert quotation to sale order if drug is dispensed from local shop”: will enable “Confirmation of Sale” and “Validation of Delivery of Product” (1 & 2) above. 
  • “Automatically register payment for dispensed order invoice”: will enable auto generation of invoice for the dispensed products and subsequently register payment (in cash) for the invoices.

Note, this feature does not auto validate delivery of medications if medication is tracked by Lots/Serial No. So such medications delivery orders will be in "Partially Available", "Available" status, and will require manual reconciliation. Also, there is no provision of partial dispense of medications for an order. 

titleOn this Page

Table of Contents

titleFeature Details

titleUsage Details

titleRelated Links

Odoo documentation - Product, Pricing