Friday, March 27, 2020¶
I removed the
purchase_stories plugin attribute as setting this to False
was functionally equivalent of having
set to None. Side effect: the pierre demo project had no declaration plugin
and therefore no longer has purchase invoices, and consequently cannot serve as
example in ledger: General accounting. We use apc instead. Adapting the doctests
took some time…
Oops: inserting a task on a client in cal.TasksByProject doesn’t assign the task
to that client. Yes,
is “presto.Client”. That’s strange because e.g. for TicketsBySite it works.
That’s a ticket on its own: #3562.
Inserting in TasksByProject doesn’t set the project¶
When I insert in TicketsBySite, the mt and mk are included with the POST request. Aha, the problem comes only when using the insert button provided by the summary panel. The bug was in lino/core/actors.py:
ir = cls.insert_action.request_from(ar)
En passant I added a new method
lino.core.requests.BaseRequest.is_obvious_field() which is now used by
lino.mixins.ProjectRelated to add the project (between parantheses) in
lino.core.model.Model.summary_row(), except “when it is obvious”.
Especially for the tasks listed in TasksByProject you don’t want Lino to
repeat the client name for each task.
Until now this typical behaviour had to be implemented explicitly by the
application developer. Now is is “out of the box” at least for
lino.mixins.ProjectRelated, which can be considered an example of this
design pattern. TODO: rename this to get_row_description and write