=============================
Wednesday, September 23, 2015
=============================
I am working to repair the :ref:`welfare` test suite after :ticket:`520`.
Exception: Invalid endtag. Expected , found
===================================================
I encountered a problem :ticket:`535`, actually caused by
:ticket:`473`. The easisest way to reproduce it is to `cd` to
:mod:`lino_welfare.projects.std` and to run `initdb_tmp` script there.
Here is a traceback::
INFO Loading /lino/lino/modlib/excerpts/fixtures/demo2.py...
INFO appy.pod render /welfare/lino_welfare/modlib/immersion/config/immersion/Contract/StageForem.odt -> /lino_cache/welfare_std/media/userdocs/appyodt/immersion.Contract-1.odt (language='en',params={'raiseOnError': True, 'ooPort': 8100, 'pythonWithUnoPath': '/usr/bin/python3'}
Traceback (most recent call last):
...
File "/lino/lino/modlib/excerpts/fixtures/demo2.py", line 31, in objects
rv = ses.run(obj.do_print)
...
File "/appy/pod/actions.py", line 149, in evaluateBuffer
self.manageError(result, context, msg, e)
File "/appy/pod/actions.py", line 83, in manageError
raise EvaluationError(originalError, errorMessage)
appy.pod.actions.EvaluationError: Problem installing fixture '/lino/lino/modlib/excerpts/fixtures/demo2.py': Error while evaluating the expression "html(body)" defined in the "from" part of a statement. Exception: Invalid endtag. Expected , found
The solution is to install HTML Tidy::
$ sudo aptitude install tidy
See :mod:`lino.utils.html2xhtml`.
Adapt Welfare test suite to #505
================================
The specs page in :ref:`welfare.specs.eupen` reveals that we cannot
just show the statements and movements imported for managed client
accounts to every :class:`ContactsUser
`. This information must be
visible to social agents only. Not e.g. for reception clerks. But a
reception clerk must see the accounts of a partner.
Thus we need new user roles in :mod:`lino_xl.lib.sepa.roles`. And
:mod:`lino_welfare.modlib.welfare.roles` distributes them to user
profiles.
Note that reception clerks must be able to create accounts on a
partner.
Commit and push Lino, Cosi and Welfare at 11.24 since the test suites
now pass.
Manual tests revealed some problems that were not covered by the test
suite:
- Reception clerks did not see AccountsByPartner at all. Because I had
been setting :attr:`required_roles
` to::
dd.login_required(ContactsUser, SepaUser)
instead of::
dd.login_required((ContactsUser, SepaUser))
- Added an :attr:`insert_layout ` to
`Accounts` and `AccountsByPartner`.
- Actually reception clerks should even not see any *detail* window
per account. But that's less easy. To implement this, we must
extend Lino to support :attr:`required_roles
` on a *layout*.
Ticket :ticket:`539`.
As a workaround I set :attr:`stay_in_grid
` to `True` so that they don't
get it when creating an account.
- Note that instead of writing::
class AccountsDetail(dd.FormLayout):
main = "general"
general = dd.Panel("""
partner:30 iban:40 bic:20 remark:15
sepa.StatementsByAccount
""", label=_("Account"))
class Accounts(dd.Table):
detail_layout = AccountsDetail()
it is equivalent but shorter to write::
class AccountsDetail(dd.FormLayout):
main = """
partner:30 iban:40 bic:20 remark:15
sepa.StatementsByAccount
"""
class Accounts(dd.Table):
detail_layout = AccountsDetail()
and even shorter::
class Accounts(dd.Table):
detail_layout = """
partner:30 iban:40 bic:20 remark:15
sepa.StatementsByAccount
"""
**Exercise for Hamza** After committing and pushing, I saw that one
test in :ref:`cosi` (file :file:`docs/tested/general.rst`) is still
failing. The site admin (username "rolf") no longer sees three menu
items in Explorer menu. It is because the user profiles defined in
:mod:`lino_cosi.lib.cosi.roles` do not yet include the new roles from
:mod:`lino_xl.lib.sepa.roles`. Try to fix it and to write a pull
request!
Moved `tickets` and `clocking` from Lino to Lino Noi
====================================================
As with :ticket:`520` I moved two plugins from the central Lino
repository to :ref:`noi`: The `tickets` and `clocking` plugins are now
in :mod:`lino_noi.lib` and no longer in :mod:`lino.modlib`.
Memo markup in ticket descriptions
==================================
Just an idea that had been haunting me for a few weeks already:
:ticket:`541`. The :attr:`description
` of a ticket can now
contain "memo markup". This is a general new feature of
:mod:`lino.modlib.bootstrap3`. To be documented.
For example::
[url http://www.example.com]
[url http://www.example.com example]
[ticket 1]
Memo markup is being "executed" when the ticket is rendered by the
:mod:`lino.modlib.bootstrap3` user interface.
And it works :-) The description of :ticket:`541` is entered as::
Example: we can now link to [ticket 1] and to external URL
[url http://luc.lino-framework.org/blog/2015/0923.html blog].
To be observed. This is admittedly less intuitive than automatically
replacing every ``#`` followed by a sequence of digits, and every
chunk of text starting with ``http://`` by a link.