Navigation

I wrote the customized template service_report.weasy.html for presto,
but it wasn’t being selected OOTB.
The lino_xl.lib.sales.SalesDocument mixin has a
get_excerpt_templates() method, but Lino still always uses the default template.

It took me some time to understand my own system of configuring print
templates. I believed that Lino didn’t find the right template, but in the end
it was just a pitfall of the Jinja templating.

Okay replacing the hack in
lino.core.choicelists.ChoiceList.add_item_lazy() was a good thing, but
that hack wasn’t guilty at all. Guilty was another bug, this time in
VoucherTypes.get_for_model which caused it to simply
return the first possible candidate. But in Welfare we have two voucher types
which use the same model PaymentOrder. For the demo journal ZKBC the result had
been okay so far, but when the voucher types were sorted, it returned the wrong
candidate. It is an error to call VoucherTypes.get_for_model (or
VoucherTypes.get_for_table) with a model (or a table) for
which we don’t have a unique voucher type. And it seems that last week I was so
sure about having found the bug that obviously I failed to test a last time…