=========================
Tuesday, February 3, 2015
=========================

Recurrent polls
===============

Wow. I finished a first proof of concept for the
:ref:`welfare.specs.polls` as the users in Chatelet want them.

Especially :meth:`AnswersByResponse.answer_buttons
<lino.modlib.polls.models.AnswersByResponse.answer_buttons>` and
:meth:`AnswersByResponse.get_slave_summary
<lino.modlib.polls.models.AnswersByResponse.get_slave_summary>` were a
challenge.

I invented some new API methods for working with action requests.
:attr:`lino.core.actors.Actor.actions` is now part of the public API.
Started to write documentation (but yes, there is much to do):

- :lino:`/dev/ar`
- :lino:`/dev/html`
- :lino:`/dev/custom_actions`


Cannot create humanlinks.Links when working as Alicia
=====================================================

Created, reproduced and fixed :ticket:`88`.

.. currentmodule:: lino.modlib.humanlinks

The quick solution was simply to replace ``sar = ar.spawn(Links,
...)`` by ``sar = ar.spawn(self, ...)`` in
:meth:`LinksByPerson.get_slave_summary`.

But why was the button there, although the insert action was not
available?  This shows that :meth:`insert_button
<lino.core.requests.BaseRequest.insert_button>` is not a good API.


Code cleanup en passant: I removed `quick_upload_buttons` method from
:class:`lino.modlib.extjs.ext_renderer.ExtRenderer`, and the three
deprecated fields `residence_permit` `work_permit` and
`driving_license` from
:class:`lino_welfare.modlib.pcsw.models.Client.`

Show all appointable users in `create_visit`
============================================

.. currentmodule:: lino_welfare.modlib.reception.models

The user field of :class:`CreateClientVisit`, the "manual" dialog
action for creating a prompt meeting, now shows all appointable users,
not only those whose `newcomer_consultations` checkbox is checked.


Fehlermeldung nach "Neuzugang zuweisen"
=======================================

Ticket :ticket:`87` was a tough one. But it seems that I got it.

I observed that the Save button sends a PUT to
`/api/newcomers/NewClients/121`, but this PUT returns with
:attr:`detail_handler_name
<lino.core.requests.ValidActionResponses.detail_handler_name>` set to
"pcsw.Clients.detail". This is wrong. And BTW it opens a second Detail
window: if you click now the window's "Close" button, you see the
"same" detail a second time. The `newcomers.NewClients` and
`pcsw.Clients` tables share the same `detail_layout`, but they have
different `parameters`.

The mystery lied in the collaboration of :meth:`ar.goto_instance
<lino.core.requests.ActorRequest.goto_instance>` and
:meth:`obj.get_detail_action
<lino.core.model.Model.get_detail_action>`.
If the action requests's actor can be used for the object instance, then it must have priority over the object's default table.