20120703

Zu den gestern entdeckten offenen Problemen:

  • Wenn man über “Meine Tx25-Anfragen” eine neue Anfrage erstellt, füllt Lino die NR-Nr. nicht ein, nachdem man den Klienten ausgewählt hat.

–> Das ist nicht nur nicht einfach, sondern auch nicht sinnvoll. Der komplette KBSS-Baum aus dem “Mein Menü” kommt raus, fertig.

  • Kann Fenster mit ungültigen Angaben nicht schließen, weil auto_save fälschlicherweise auch beim close button zuschlägt und den Record dann jedesmal zu speichern versucht (was jedesmal fehlschlägt).

–> New attribute lino.core.actions.Action.auto_save.

Customization functions

Another little problem occured which is worth some principal thoughts.

In lino.apps.pcsw, since models.Note has become a ProjectRelated, the internal name of the ForeignKey to the Person has changed from person to project. And the field company became an application-specific field, injected in lino.apps.pcsw.models. We wanted it like this because it makes the lino.modlib.notes module available for usage in other applications.

But then we discovered that the appy template for printing a CV no longer works. Of course: it contains references to the person field. Solution is easy: make an application-specific property person:

def get_person(self):
    return self.project
Note.person = property(get_person)

This code sits in lino.apps.pcsw.models, more precisely in the customize_notes function of that module.

Formulated the new concept of “customization functions”, and lino.apps.pcsw.models defines six of them:

  • customize_siteconfig

  • customize_notes

  • customize_contacts

  • customize_sqlite

  • customize_user_groups

  • customize_user_profiles

Miscellaneous

Some free changes (not asked by any user):

  • The CreatePostings, CreateMail and SendMail, actions were (wrongly) callable from an insert window.

  • Wow! lino.apps.pcsw.models.site_setup() now adds an insert_template for notes.Note. Creating a Note is now much more intuitive.

  • Creating an E-Mail on a Note whose NoteType specifies “Mail as attachment” is now disabled as long as the Note hasn’t been printed.

  • outbox.Mail objects are now readonly after they have been sent.

  • The outbox.Mail.user field is now labelled “Sender” instead of “User”.

Fixed a bug reported by Gerd:

  • “Wenn ich eine Notiz eines Kollegen per E-Mail verschicke, steht als Sender der Kollege.”

This was because UserAuthored had the following method:

def update_owned_instance(self,other):
    other.user = self.user
    super(UserAuthored,self).update_owned_instance(other)

Removed that method because we cannot generally say that this is a wanted behaviour. Don’t even remember where it is useful. (If it was, then these cases will pop up as bug reports… sorry).

Solved another bug reported by Gerd:

  • “Empfängerart wird erst sichtbar, wenn man auch einen Empfänger eingegeben hat.”

This is not truly fixed, but I moved the Recipient.type column to the right so that the user first selects the Partner. IMHO that’s enough.

  • Übersetzung Label für “Create”: “Erstellen”

InsertLayout cannot inherit from a DetailLayout

Also added a separate insert_template for cal.Events. But there I understood a subtle design problem: having InsertLayout and DetailLayout two different classes made it impossible to define an insert_layout that inherits from a detail_layout. The detail_layout of cal.Events defines two panels start and end, and we were not able to reuse them for the insert_layout. Internal changes to make this possible: reduced InsertLayout and DetailLayout to a single class FormLayout.

Miscellaneous