Web view only shows standard but not default

We have the following issue:
When a doctype is sent by mail, it conatins a link “view in browser”. We have defined a default print template different than the standard, and this works well in the normal preview. However, when opening the web view from the mail, it always opens the original/standard view.

Can someone confirm this? In my opinion, it should be the default print view that should be used…

Steps to reproduce:

  • create a new print template for sales order
  • make the new sales order template the default print template for sales orders
  • create a sales order
  • send it by mail
  • compare the attached pdf with the “view in browser”

Expected behaviour:

  • web browser should show selected default template

Actual behaviour (ERPNext: v8.7.0 (master))

  • web browser shows the initial template

Please open a github issue with the details

In one instance, we found this to work correctly (ERPNext: v8.5.2). The link appears to contain the target format. However, on another instance, opning that link leads to a dialog “Not permitted”

URL is something like https://[hostname]/Sales Order/SO-00014?format=Auftragsbest%C3%A4tigung&key=4560ebcc6d65f408936f28cbacae6c4d39b9b0f3023ebc28aad2e9

The error “Not permitted” remains even if one is logged in (with System Manager level access).

I have not yet raised a GitHub issue, because on one system it works. Any ideas?