:date: 2020-06-22 ===================== Monday, June 22, 2020 ===================== Worker has no field named 'purchase_account_id' =============================================== The lino_xl.lib.clients plugin (in its :meth:`pre_site_startup` method) adds a Shortcut ``id_document`` with ``"presto.Client"``` as `model_spec`:: def pre_site_startup(self, site): add = site.models.uploads.Shortcuts.add_item add(self.client_model, 'id_document', _("Identifying document"), target='uploads.UploadsByClient') self.client_model = site.models.resolve(self.client_model) super(Plugin, self).pre_site_startup(site) Presto doesn't use this shortcut but shouldn't get disturbed by it. But adding this shortcut seems to have a side effect. uploads.models defines a `pre_analyze` receiver that injects a virtual display field on the `model_spec` of every shortcut:: @dd.receiver(dd.pre_analyze) def before_analyze(sender, **kwargs): for i in Shortcuts.items(): ... vf = dd.VirtualField(dd.DisplayField(i.text), f) dd.inject_field(i.model_spec, i.name, vf) The pre_analyze signal is run long before pre_site_startup Maybe inject_field fails when it is called a second time on a model before the model is prepared? :: 20200622 Run /home/luc/work/lino/lino/modlib/users/models.py:305 for 20200622 Run /home/luc/work/xl/lino_xl/lib/countries/models.py:152 for 20200622 Run /home/luc/work/xl/lino_xl/lib/contacts/models.py:614 for 20200622 Run /home/luc/work/xl/lino_xl/lib/calview/models.py:49 for 20200622 Run /home/luc/work/presto/lino_presto/lib/contacts/models.py:173 for 20200622 Run /home/luc/work/lino/lino/modlib/checkdata/models.py:172 for 20200622 Run /home/luc/work/lino/lino/modlib/gfks/mixins.py:50 for 20200622 Run /home/luc/work/lino/lino/modlib/gfks/mixins.py:54 for 20200622 Run /home/luc/work/lino/lino/modlib/gfks/mixins.py:59 for 20200622 Run /home/luc/work/xl/lino_xl/lib/cal/mixins.py:750 for 20200622 Run /home/luc/work/xl/lino_xl/lib/cal/models.py:125 for 20200622 Run /home/luc/work/xl/lino_xl/lib/cal/models.py:127 for 20200622 Run /home/luc/work/xl/lino_xl/lib/cal/models.py:349 for 20200622 Run /home/luc/work/xl/lino_xl/lib/cal/models.py:915 for 20200622 Run /home/luc/work/xl/lino_xl/lib/cal/models.py:1120 for 20200622 Run /home/luc/work/xl/lino_xl/lib/cal/models.py:1127 for 20200622 Run /home/luc/work/xl/lino_xl/lib/cal/models.py:1137 for 20200622 Run /home/luc/work/xl/lino_xl/lib/cal/models.py:1148 for 20200622 Run /home/luc/work/xl/lino_xl/lib/cal/models.py:1157 for 20200622 Run /home/luc/work/xl/lino_xl/lib/cal/models.py:1167 for 20200622 Run /home/luc/work/presto/lino_presto/lib/cal/models.py:223 for 20200622 Run /home/luc/work/presto/lino_presto/lib/cal/models.py:224 for 20200622 Run /home/luc/work/presto/lino_presto/lib/cal/models.py:316 for 20200622 Run /home/luc/work/lino/lino/modlib/uploads/models.py:185 for 20200622 Defer /home/luc/work/xl/lino_xl/lib/ledger/ui.py:415 for ledger.Account 20200622 Run /home/luc/work/xl/lino_xl/lib/ledger/ui.py:434 for 20200622 Run /home/luc/work/xl/lino_xl/lib/ledger/models.py:1123 for 20200622 Run /home/luc/work/xl/lino_xl/lib/ledger/models.py:1123 for 20200622 Run /home/luc/work/xl/lino_xl/lib/ledger/models.py:1123 for 20200622 Run /home/luc/work/xl/lino_xl/lib/ledger/models.py:1123 for 20200622 Run /home/luc/work/xl/lino_xl/lib/ledger/models.py:1123 for 20200622 Run /home/luc/work/xl/lino_xl/lib/ledger/models.py:1123 for 20200622 Run /home/luc/work/xl/lino_xl/lib/ledger/models.py:1132 for 20200622 Run /home/luc/work/xl/lino_xl/lib/orders/models.py:352 for 20200622 Run /home/luc/work/xl/lino_xl/lib/orders/models.py:354 for 20200622 Run /home/luc/work/xl/lino_xl/lib/orders/models.py:409 for 20200622 Run /home/luc/work/xl/lino_xl/lib/trading/mixins.py:63 for 20200622 Run /home/luc/work/xl/lino_xl/lib/trading/mixins.py:64 for 20200622 Run /home/luc/work/xl/lino_xl/lib/trading/mixins.py:65 for 20200622 Run /home/luc/work/lino/lino/modlib/dashboard/models.py:44 for 20200622 Run /home/luc/work/xl/lino_xl/lib/clients/models.py:61 for 20200622 Run /home/luc/work/xl/lino_xl/lib/clients/models.py:67 for 20200622 Run /home/luc/work/xl/lino_xl/lib/households/models.py:525 for 20200622 Run /home/luc/work/xl/lino_xl/lib/excerpts/models.py:631 for 20200622 Run /home/luc/work/xl/lino_xl/lib/excerpts/models.py:633 for 20200622 Run /home/luc/work/xl/lino_xl/lib/vat/models.py:28 for 20200622 Run /home/luc/work/xl/lino_xl/lib/vat/models.py:29 for 20200622 Run /home/luc/work/xl/lino_xl/lib/vat/models.py:63 for 20200622 Run /home/luc/work/xl/lino_xl/lib/vat/models.py:79 for 20200622 Run /home/luc/work/xl/lino_xl/lib/vat/models.py:84 for 20200622 Run /home/luc/work/xl/lino_xl/lib/vat/models.py:87 for 20200622 Run /home/luc/work/xl/lino_xl/lib/vat/models.py:90 for 20200622 Run /home/luc/work/presto/lino_presto/lib/trading/models.py:65 for 20200622 Run /home/luc/work/presto/lino_presto/lib/trading/models.py:67 for 20200622 Run /home/luc/work/presto/lino_presto/lib/trading/models.py:69 for 20200622 Run /home/luc/work/xl/lino_xl/lib/invoicing/models.py:84 for 20200622 Run /home/luc/work/xl/lino_xl/lib/invoicing/models.py:510 for 20200622 Run /home/luc/work/xl/lino_xl/lib/invoicing/models.py:514 for 20200622 Run /home/luc/work/xl/lino_xl/lib/invoicing/models.py:517 for 20200622 Run /home/luc/work/xl/lino_xl/lib/invoicing/models.py:524 for 20200622 Run /home/luc/work/xl/lino_xl/lib/invoicing/models.py:530 for 20200622 Run /home/luc/work/xl/lino_xl/lib/invoicing/models.py:535 for 20200622 Run /home/luc/work/xl/lino_xl/lib/invoicing/models.py:549 for 20200622 Run /home/luc/work/xl/lino_xl/lib/sepa/models.py:114 for 20200622 Run /home/luc/work/xl/lino_xl/lib/notes/models.py:175 for 20200622 Run /home/luc/work/xl/lino_xl/lib/notes/models.py:177 for 20200622 Run /home/luc/work/xl/lino_xl/lib/notes/models.py:274 for 20200622 Run /home/luc/work/presto/lino_presto/lib/presto/models.py:156 for 20200622 Run /home/luc/work/presto/lino_presto/lib/presto/models.py:158 for 20200622 Run /home/luc/work/presto/lino_presto/lib/presto/models.py:159 for 20200622 Run /home/luc/work/lino/lino/modlib/users/models.py:318 for 20200622 Run /home/luc/work/xl/lino_xl/lib/vat/desktop.py:142 for vat.VatInvoices 20200622 Run /home/luc/work/lino/lino/modlib/uploads/models.py:447 for 20200622 Run /home/luc/work/xl/lino_xl/lib/ledger/choicelists.py:409 for 20200622 Run /home/luc/work/xl/lino_xl/lib/ledger/choicelists.py:414 for 20200622 Run /home/luc/work/xl/lino_xl/lib/ledger/choicelists.py:400 for 20200622 Run /home/luc/work/xl/lino_xl/lib/products/models.py:190 for 20200622 Run /home/luc/work/xl/lino_xl/lib/products/models.py:193 for Maybe I must run fix_field_cache also on all MTI children? Yes! This was the bug: - When using :func:`lino.core.inject.inject_field` on a model, Lino did not reset the field cache of the MTI children of that model. This turned out to be necessary in some sitations. Unrelated changes en passant: - get_installed_plugins of presto now yields :mod:`uploads` earlier. - :func:`lino.api.doctest.show_choicelists` now also shows the number of items in each choicelist. Configure mail server for avanti ================================ I am applying :ref:`admin.mail` for the new avanti server. I added an MX record:: mail.avanti.mylino.net. 10 avanti.mylino.net. I changed the Reverse DNS record for 51.178.46.165 from their default value "165.ip-51-178-46.eu" to "mail.avanti.mylino.net". Before:: $ dig -x 51.178.46.165 ; <<>> DiG 9.11.3-1ubuntu1.12-Ubuntu <<>> -x 51.178.46.165 ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 29163 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 65494 ;; QUESTION SECTION: ;165.46.178.51.in-addr.arpa. IN PTR ;; ANSWER SECTION: 165.46.178.51.in-addr.arpa. 7026 IN PTR 165.ip-51-178-46.eu. ;; Query time: 0 msec ;; SERVER: 127.0.0.53#53(127.0.0.53) ;; WHEN: Mon Jun 22 18:02:51 EEST 2020 ;; MSG SIZE rcvd: 88