Monday, January 12, 2015

Some fine-tuning in lino_welfare.modlib.reception.

Renamed CreateEventActionsByClient to lino_welfare.modlib.reception.models.FindDateByClientTable. Moved ButtonsTable to lino.core.tables.ButtonsTable.

We had the following ordering of buttons on pcsw.Client: Find date with, Read eID card, Create promt event. The button for Read eID card was “at the wrong place”: it must be either before or after the two other actions. This was because ShowSlaveTable did not yet (as it should) copy over the sort_index specified on the table to the sort_index. of the action. Yet another bug in the framework fixed!

The list of users to display in FindDateByClientTable must not include watch_tim. The selection criteria is now centralized in a function appointable_users.

Note that we cannot currently make that list depend on the client’s lino_welfare.modlib.pcsw.models.Client.client_state or the clerk’s user profile. That’s because choosers know neither the requesting user nor the master_instance of the query. A missing feature which might be useful to implement some day: ticket #56.

It is now possible to specify a master_field attribute to lino.utils.sendchanges.register(). Usage example:

def do_site_startup(self):

    super(Site, self).do_site_startup()

    from lino.utils.sendchanges import subscribe, register

    register('pcsw.Client',
             'first_name last_name birth_date national_id',
             'created_body.eml', 'updated_body.eml')

    from django.utils.translation import ugettext as _
    e = register('addresses.Address',
                 'street city street_no street_box region',
                 master_field='partner')
    e.update_subject = _("Updated: {obj.address_type} of {master}")