Wednesday, July 1, 2015

Testing the fields of form panels

I added a new chapter Lino Welfare à la Eupen to the functional specs. Which required a new function lino.utils.diag.py2rst().

How to specify an “or” operation for required_roles

I noticed that the test for demo user Theresia (reception clerk) was being skipped. This made me discover a new trick: how to specify an “or” operation for the required_roles.

The roles and are exclusive: normal users want either one or the other, but not both.

For example, a reception clerk is an office operator, not an office user. Which means that she does not want to see menu commands like “My events” or “My visitors”. The social agents are office users, not office operators. They want to see what’s happening at the reception, but not everything. For example they don’t want to see the Reception ‣ Clients command because they have their specific commands for that (Integration ‣ Clients or Debts ‣ Clients or PCSW ‣ Clients).

But then the reception module has certain commands which both operators and users want to have: for example the global list of Reception ‣ Waiting visitors. Actually all reception commands based on lino.modlib.reception.models.Visitors.

See also the source code of lino_welfare.projects.std.roles.