Tuesday, September 2, 2014

Chatelet

Continued on docs/tickets/121.

  • Enlevé le mode sommaire pour “Composition de ménage” (the chatelet version of Lino Welfare patches dd.AbstractTable.slave_grid_format of ml.households.SiblingsByPerson to "grid".
  • ml.households.SiblingsByPerson no longer ignores Member.end_date when looking for the active household. See test case below.
  • activated the “Client projects” (Demandes d’intervention) app for CPAS de Châtelet.
  • Removed the different specific UploadAreas in Lino Welfare. Only one area (as in the standard modlib app).
  • New model welfare.jobs.Status. New field jobs.Experience.status is a nullable ForeignKey to it. New field jobs.Experience.is_training.
  • New field jobs.Experience.regime, a ForeignKey to welfare.jobs.Regime.

Test case : a person with multiple household memberships

When a person has multiple household memberships, but only one of them has no end_date, SiblingsByPerson failed to determine the one and only current household. Now it works (the following is no longer tested. See the tested and maintained version in The Households module):

>>> from lino import startup
>>> startup('lino_book.projects.max.settings.doctests')
>>> from lino.api.shell import *
>>> Person = contacts.Person
>>> Member = households.Member
>>> Member.objects.filter(end_date__isnull=False)
[Member #5 ('Mr Paul Frisch (Head of household)'), Member #11 ('Mr Albert Adam (Head of household)'), Member #17 ('Mr Lars Braun (Head of household)'), Member #23 ('Mr Ilja Adam (Head of household)')]
>>> p = Person.objects.get(first_name="Lars", last_name="Braun")
>>> Member.objects.filter(person=p).count()
2
>>> rt.show(households.MembersByPerson, master_instance=p)
Mr Lars Braun is
`☐  <javascript:Lino.households.Members.set_primary(null,31,{  })>`__Head of household in *Lars & Melba Braun-Frisch*
`☐  <javascript:Lino.households.Members.set_primary(null,17,{  })>`__Head of household in *Lars & Pascale Braun-Adam*

Create a household : **Married couple** / **Divorced couple** / **Factual household** / **Legal cohabitation** / **Isolated** / **Other**
>>> rt.show(households.MembersByPerson, p, nosummary=True)
=========================== =================== ========= ============ ============
 Household                   Role                Primary   Start date   End date
--------------------------- ------------------- --------- ------------ ------------
 Lars & Melba Braun-Frisch   Head of household   No
 Lars & Pascale Braun-Adam   Head of household   No                     04/03/2002
=========================== =================== ========= ============ ============
>>> SiblingsByPerson = households.SiblingsByPerson
>>> rt.show(SiblingsByPerson, p)
================== =================== ============ ==========
 Person             Role                Start date   End date
------------------ ------------------- ------------ ----------
 Mr Lars Braun      Head of household
 Mrs Melba Frisch   Partner
================== =================== ============ ==========

(Above code is now part of the Specs about in The Households module.)

Miscellaneous

Fixed a bug in Renamed “Lino Faggio” to “Lino Voga” which caused “Unknown element u’lists.MembersByPerson’ referred in layout <MyPersonDetail on contacts.Persons>.”

The ml.cal.TakeEvent action did not always work as expected:

  • Basically you can now take any event, even if it is not assigned to you.
  • When answering to a callback, linoweb.js did not set the subst_user. Now it does.
  • I discovered why anonymous users in Lino Noi were allowed to edit things: simply because the “Anonymous” user profile created by the default lino.core.site.Site.setup_choicelists() was not readonly. I changed that to self.user_model is not None which means that on a site without user management it is False. The default Anonymous profile now also has UserLevel “user” for all groups.
  • Fixed a bug which caused e.g. ml.ledger.Situation to have a “save” button (dd.SubmitDetail).
  • Fixed a bug which caused e.g. an Internal Server Error “‘CreateCoachingVisit’ object has no attribute ‘get_choices_text’” when trying to select a user in the combobox of the parameter window of welfare.reception.CreateCoachingVisit.