1. 18 Jan, 2019 1 commit
    • ZODB Components: Optimize find_load_module() from b45914fa ExternalMethod optimization. · 8044598c
      This method is used to import ZODB Components when fallback on filesystem is needed
      and used when loading Document and Extension Components.
      
      1,000,000 executions:
        * Before:
          timeit("erp5.component.extension.find_load_module(module_name)",
                 setup="import erp5.component.extension; module_name='Hoge'")
          59.073
          59.324
        * b45914fa ExternalMethod optimization:
          timeit("__import__('erp5.component.extension.' + module_name, fromlist='*', level=0)",
                 setup="module_name='Hoge'")
          1.754
          1.845
        * This commit:
          timeit("import_module('erp5.component.extension.' + module_name)",
                 setup="from importlib import import_module; module_name='Hoge'")
          1.346
          1.311
          => Faster because import_module() calls __import__() without fromlist (not
             needed as it returns module from sys.modules after this) and level
             parameters.
          => Introduced in python3 and backported to python2.7. Recommended over
             __import__ in Python documentation for non-internal usage and when
             getting the module itself and not its top-level one.
      Arnaud Fontaine committed
  2. 17 Jan, 2019 2 commits
    • discussion: remove temporary hidden input added for click · 7aa5fb76
      When clicking "Reply" on a discussion post, this script adds a hidden input to mark which post we are replying to.
      This cause problem  when ctrl+clicking reply to reply in a new tab, because it leaves the page with the extra hidden input, which cause problems, like clicking reply again cause `Error Value: You are not allowed to access '['1', '1']`' in this context , or clicking change page will reply.
      
      This is a minimal effort fix, just remove the added element after click.
      
      /reviewed-on !823
      Jérome Perrin committed
    • Revert "Show Id of template." · b3c56f2b
      This reverts commit b7d9590c.
      
      Users are not supposed to edit templates because documents are not in
      their "normal" context, if user edit templates some unexpected things
      might happen. We don't want user to change state or do some actions that
      may cause interactions on other documents from a template. This was
      never strongly enforced, but there was not supposed to be an easy way
      for users to access the template document.
      
      With old versions of ERP5 (before the rework of isIndexable /
      isSubTreeIndexable ), users could also add lines inside the template
      document and these lines where indexable.
      
      Note that the way of editing templates is:
       * make a "real" document from the template
       * modify this document
       * use "Make Template" again - this will replace the document with the
      same title.
      
      /reviewed-on !822
      Jérome Perrin committed
  3. 16 Jan, 2019 6 commits
  4. 13 Jan, 2019 1 commit
    • Fix reindexing with custom grouping using 'group_id' · 707058d7
      This fixes:
      
        Traceback (innermost last):
          Module Products.CMFActivity.ActivityTool, line 1373, in invokeGroup
            traverse(method_id)(expanded_object_list)
          Module Products.ERP5Catalog.CatalogTool, line 946, in catalogObjectList
            super(CatalogTool, self).catalogObjectList(tmp_object_list, **m.kw)
          Module Products.ZSQLCatalog.ZSQLCatalog, line 813, in catalogObjectList
            **kw
        TypeError: catalogObjectList() got an unexpected keyword argument 'group_id'
      Julien Muchembled committed
  5. 08 Jan, 2019 3 commits
  6. 07 Jan, 2019 2 commits
    • CMFActivity: better date ordering by using micro-precision · b82f3ba1
      Originally, uids somehow sorted messages by date of insertion, in particular
      for those that were created within the same second. But since random uids,
      such messages became validated or processed in random order.
      
      Note however that by default, messages created in the same transaction all have
      exactly the same date, so commit a42da4de
      ("CMFActivity: Do not use offset for scanning messages to validate.")
      forces us to keep the ordering on uids (in addition to priority/date).
      
      Existing instances will upgrade automatically, using the already existing code
      to upgrade tables in a generic way. You should see the following logs:
      
          INFO CMFActivity 'message_queue' table upgraded
          ALTER TABLE message_queue
            MODIFY COLUMN date datetime(6) NOT NULL AFTER uid,
            MODIFY COLUMN processing_date datetime(6) DEFAULT NULL AFTER processing
          INFO CMFActivity 'message_job' table upgraded
          ALTER TABLE message_job
            MODIFY COLUMN date datetime(6) NOT NULL AFTER uid,
            MODIFY COLUMN processing_date datetime(6) DEFAULT NULL AFTER processing
          INFO CMFActivity 'message' table upgraded
          ALTER TABLE message
            MODIFY COLUMN date datetime(6) NOT NULL AFTER uid,
            MODIFY COLUMN processing_date datetime(6) DEFAULT NULL AFTER processing
      
      
      /reviewed-on !820
      Julien Muchembled committed
  7. 02 Jan, 2019 1 commit
  8. 31 Dec, 2018 1 commit
  9. 21 Dec, 2018 2 commits
  10. 20 Dec, 2018 2 commits
  11. 17 Dec, 2018 4 commits
  12. 14 Dec, 2018 2 commits
  13. 13 Dec, 2018 1 commit
  14. 12 Dec, 2018 1 commit
    • accounting: restrict restarting accounting period to Assignor · 366a760e
      This workflow involved an Assignee who can open, close, re-open and an
      Assignor who can close definitively.
      This is usually configured so that accountants are Assignee and CFO is
      Assignor.
      
      We realized that re-opening a Period that was previously closed is
      something we don't want the accountants to do without CFO's approval.
      
      To support this configuration, we only allow Assignor to re-open.
      
      Now Assignee can open and close temporarily and Assignor can re-open and
      close definitively.
      
      /reviewed-on !813
      Jérome Perrin committed
  15. 11 Dec, 2018 4 commits
  16. 10 Dec, 2018 5 commits
  17. 07 Dec, 2018 2 commits
    • [erp5_core] Follow guidelines for Actions on portal types Catalog and Catalog To… · 0b649664
      …ol by adding dialog before executing
      
      Also, Cleanup useless actions and functions
      
      /reviewed-on !811
      Ayush Tiwari committed
    • Configurator and workflow cleanups · a29bb541
      * Assorted small fixes so that form comply to conventions
      * Minimal fixes of invalid html
      * make `mixin` usable in type definition 
      
      The context is I was working on a custom configurator involving some matrixboxs, so I needed a simple business configuration item just to store the matrix result. This was possible with mixin, I just made a portal type based on Item class, enabling mxins for `Matrix` and `BusinessConfiguratorItem` and I did not have to define a class ( not sure this is really better ).
      
      Then the matrixbox was not rendering properly, because browser was confused by the broken html and build a "different DOM" and selectors did not apply. This is what `configurator: fix (a bit) invalid HTML` addresses.
      
      While doing this, fix some minor problems found with forms.
      
      /reviewed-on !814
      Jérome Perrin committed