20120927

Started first implementations of “Client workflow”: refusing a request to become client, marking a client “former”.

ChoiceList.before_state_change ChoiceList.after_state_change Model.set_ch

Understood that we don’t need “action parameters” but ar.dialog() Started lino.core.dialogs and a first application code snippet to demonstrate the planned usage:

class RefuseNewClient(dd.Dialog):
    title = _("Refuse new client")
    reason = models.CharField(max_length=200,verbose_name=_("Reason"))

class ClientStates(ChoiceList):

    @classmethod
    def before_state_change(cls,obj,ar,kw,oldstate,newstate):

        if newstate.name == 'refused':
            dlg = ar.dialog(RefuseNewClient)
            obj.set_change_summary(dlg.reason)

    ...