Clinical Procedure not linking to material consumption

Hello, I raised same issue on github.

I created a Clinical Procedure template but the stock consumtion does not seem to work properly all the time. In some cases when I create a clinical procedure the stock consumption is properly populated based on the template, in other cases it does not get populated at all.

  • When I create a clinical procedure “from scratch” using the template the stock consumption items are not fetched
  • When I create a clinical procedure “from scratch” and add reference to an appointment it correctly fetches the Clinical Procedure Template from the appointment but does not fetch the stock consumption items from the template
  • When I create a clinical procedure from inside the appointment doctype then the stock consumption is fetched correctly

I would expect to always fetch stock consumption based on template.