Monday, June 15, 2015

I worked on lino.modlib.vat and lino.modlib.vatless to make them exemplarily well documented modules. Which raised the question whether these two plugins should be exclusive. My unconsious answer until now has been “yes”, but now I realized that actually there is no reason to have them mutually exclusive. A vat-subjected company might also use some system of internal invoices for which there is no concept of VAT.

So I added them both to lino.projects.docs.

Which unveiled a a name clash: the model name “Invoice” was used in both lino.modlib.vatless and lino.modlib.trading. I might have solved this by defining an explicit related_query_name on each voucher definition, but actually it seems preferrable to have unique model names for invoices.

So I did some model renames:

plugin

old name

new name

vat

AccountInvoice

VatAccountInvoice

vatless

Invoice

AccountInvoice

sales

Invoice

VatProductInvoice

Note that the names of the default tables remain Invoices, and the detail InvoiceDetail because there it is not necessary to use such long and difficult to remember model names.

The requirement that the voucher foreign key for all voucher items must have a related_name named ‘items’.