1. 11 Jul, 2024 40 commits
    • Romain Courteaud's avatar
    • Romain Courteaud's avatar
    • Romain Courteaud's avatar
      erp5_core: propagate the portal type during jump · 5e57f0aa
      Romain Courteaud authored
      It is needed if a module contains multiple object's portal types.
      5e57f0aa
    • Roque's avatar
      Revert "erp5_web_renderjs_ui: add onclick property on listbox rows links rendering" · 111c2a3d
      Roque authored
      - this reverts commit d8119beb.
      - risk of allowing JS injection
      111c2a3d
    • Kazuhiko Shiozaki's avatar
      Localizer: support python3 and polib 1.2.0 · 4f460203
      Kazuhiko Shiozaki authored
      Fix po_import behavior in Python 2.
      
      Newer versions of polib accept only unicode strings in the
      `pofile` function (because they check if they start by the decoded
      version of the BOM).
      I changed the `data` that is passed to `pofile` to be a unicode
      string in Python 2 too. This seems to work locally in my old
      version of polib, so that at least the old behavior should be
      kept the same.
      Co-authored-by: Carlos Ramos Carreño's avatarCarlos Ramos Carreño <carlos.ramos@nexedi.com>
      Co-authored-by: Jérome Perrin's avatarJérome Perrin <jerome@nexedi.com>
      4f460203
    • Jérome Perrin's avatar
      1704da3a
    • Jérome Perrin's avatar
      oauth_google_login: reimplement with oauthlib/requests · c9f5ef85
      Jérome Perrin authored
      Because the librairies used here were never ported to python3.
      
      Notable changes:
      
        - ERP5Site_createGoogleUserToOAuth is dropped
        - internal API changed radically, so customizations made by overriding
          scripts are broken.
        - the core logic is now implemented in a connector class (still in
          portal_oauth for simplicity, but it would be simpler to move it to
          portal_web_services)
      
      No changes required in the google console, the redirect uri is still
      ERP5Site_receiveGoogleCallback
      c9f5ef85
    • Kazuhiko Shiozaki's avatar
    • Jérome Perrin's avatar
      xhtml_style: fix form_dialog using a different condition for <legend> · 9948e469
      Jérome Perrin authored
      form_dialog was different from form_render (that is used in form_view
      and form_list) regarding the <legend> element for form groups:
      
       - the element was unconditionally present, unlike form_render where it
       is only displayed if non empty
       - the text was not translated
      9948e469
    • Jérome Perrin's avatar
      */form_render: update an outdated comment · d8a658ba
      Jérome Perrin authored
      There is no fallback on group id, if no group title, no legend is
      displayed
      d8a658ba
    • Jérome Perrin's avatar
      ERP5JS: display form groups legends · ac92635a
      Jérome Perrin authored
      This is same as "xhtml_style: display form groups legends", but applied
      to ERP5JS.
      
      The returned type of `group_list` changed in the API, it use to be a
      list of lists with 2 elements: group id (str) and field list (list),
      it is now a list with 3 elements: group id (str), field list (list)
      and group title (str).
      
      There's now a new `legend` element in the DOM, only when the group has a
      title.
      ac92635a
    • Jérome Perrin's avatar
      xhtml_style: display form groups legends · 80962da1
      Jérome Perrin authored
      For erp5_web it is possible to define form groups following a naming
      rule "group_id (Group Title)" and "Group Title" is displayed in a legend,
      according to this comment in form_render.zpt:
      
      > It is possible to specify a group id and a group title by naming a group following the
      >   "group id (Group Title)" pattern. In this case the group id will be used as fieldset css
      >   class and as tag id. The group title will be used as a legend for the fieldset. If no group
      >   title is found, we use group id as title.
      
      For historical reasons, the legend was hidden, this feature was only
      used in erp5_web, but this does not seem bad to enable it in
      erp5_xhtml_style as well.
      
      At the moment, this is not used much, this script
      
      ```py
      for sf in context.getPortalObject().portal_skins.objectValues():
        for f in sf.objectValues():
          if not hasattr(f, 'get_groups'):
            continue
          for group in f.get_groups():
            if '(' in group:
              print('/'.join(f.getPhysicalPath()[1:]), group)
      
      return printed
      ```
      
      when running on a site with many business template installed yields
      
      ```
      erp5/portal_skins/erp5_base/EmbeddedFile_view left (Document Reference)
      erp5/portal_skins/erp5_base/EmbeddedFile_view right (Publication Information)
      erp5/portal_skins/erp5_base/NotificationMessage_viewEditor left (Page Properties)
      erp5/portal_skins/erp5_knowledge_pad/Base_viewKnowledgePadFieldLibrary right column (Toolbox)
      erp5/portal_skins/erp5_web/StaticWebSite_viewRedirectAssistConfiguration left (Style)
      erp5/portal_skins/erp5_web/WebPage_view left (Page Properties)
      erp5/portal_skins/erp5_web/WebPage_view right (Publication)
      erp5/portal_skins/erp5_web/WebPage_view bottom (Content)
      erp5/portal_skins/erp5_web/WebPage_viewEditor left (Page Properties)
      erp5/portal_skins/erp5_web/WebPage_viewFieldLibrary left (Page Properties)
      erp5/portal_skins/erp5_web/WebPage_viewFieldLibrary right (Publication)
      erp5/portal_skins/erp5_web/WebPage_viewFieldLibrary bottom (Content)
      erp5/portal_skins/erp5_web/WebSection_view left (Content)
      erp5/portal_skins/erp5_web/WebSection_view right (Layout)
      erp5/portal_skins/erp5_web/WebSection_view center (Description)
      erp5/portal_skins/erp5_web/WebSection_view bottom (Subsections)
      erp5/portal_skins/erp5_web/WebSection_viewDefaultThemeConfiguration left (Style)
      erp5/portal_skins/erp5_web/WebSection_viewDefaultThemeConfiguration right (Widgets)
      erp5/portal_skins/erp5_web/WebSite_view left (Content)
      erp5/portal_skins/erp5_web/WebSite_view right (Layout)
      erp5/portal_skins/erp5_web/WebSite_view center (Description)
      erp5/portal_skins/erp5_web/WebSite_view bottom (Subsections)
      erp5/portal_skins/erp5_web/WebSite_viewRegistrationDialog left (User Login)
      erp5/portal_skins/erp5_web/WebSite_viewRegistrationDialog right (User Identity)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_content_layout left column transparent (Logo)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_content_layout left column (Navigation)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_content_layout left column (Sections)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_content_layout left column (Contents)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_content_layout left column (Search)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_content_layout left column (Debug)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_content_layout right column (News)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_content_layout right column (Toolbox)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_content_layout right column (Highlight)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_layout left column transparent (Logo)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_layout left column (Navigation)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_layout left column (Sections)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_layout left column (Contents)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_layout left column (Search)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_layout left column (Debug)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_layout right column (News)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_layout right column (Toolbox)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_layout right column (Highlight)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_layout right column (Action)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_section_layout left column transparent (Logo)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_section_layout left column (Navigation)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_section_layout left column (Sections)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_section_layout left column (Contents)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_section_layout left column (Search)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_section_layout left column (Debug)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_section_layout right column (News)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_section_layout right column (Toolbox)
      erp5/portal_skins/erp5_web_minimal_theme/erp5_web_section_layout right column (Highlight)
      erp5/portal_skins/erp5_dms/Document_viewFieldLibrary left (Document Reference)
      erp5/portal_skins/erp5_dms/Document_viewFieldLibrary right (Publication Information)
      erp5/portal_skins/erp5_dms/ExternalSource_view left (Document Reference)
      erp5/portal_skins/erp5_dms/ExternalSource_view right (Publication Information)
      erp5/portal_skins/erp5_dms/OOoDocument_view left (Document Reference)
      erp5/portal_skins/erp5_dms/OOoDocument_view right (Publication Information)
      erp5/portal_skins/erp5_dms_base/File_view left (Document Reference)
      erp5/portal_skins/erp5_dms_base/File_view right (Publication Information)
      erp5/portal_skins/erp5_dms_base/Image_view left (Document Reference)
      erp5/portal_skins/erp5_dms_base/Image_view right (Publication Information)
      erp5/portal_skins/erp5_dms_web/WebIllustration_view left (Document Reference)
      erp5/portal_skins/erp5_dms_web/WebIllustration_view right (Publication Information)
      erp5/portal_skins/erp5_dms_web/WebIllustration_view bottom (Preview)
      erp5/portal_skins/erp5_dms_web/WebPage_view left (Document Reference)
      erp5/portal_skins/erp5_dms_web/WebPage_view right (Publication Information)
      erp5/portal_skins/erp5_dms_web/WebPage_view bottom (Preview)
      erp5/portal_skins/erp5_multimedia/Sound_view left (Document Reference)
      erp5/portal_skins/erp5_multimedia/Sound_view right (Publication Information)
      erp5/portal_skins/erp5_run_my_doc/Review_view left (Document Reference)
      erp5/portal_skins/erp5_run_my_doc/Review_view right (Publication Information)
      erp5/portal_skins/erp5_run_my_doc/TestPage_view left (Document Reference)
      erp5/portal_skins/erp5_run_my_doc/TestPage_view right (Publication Information)
      erp5/portal_skins/erp5_run_my_doc/TestPage_view bottom (Preview)
      erp5/portal_skins/erp5_run_my_doc/TestPage_viewFieldLibrary left (Page Properties)
      erp5/portal_skins/erp5_run_my_doc/TestPage_viewFieldLibrary right (Publication)
      erp5/portal_skins/erp5_run_my_doc/TestPage_viewFieldLibrary bottom (Content)
      erp5/portal_skins/erp5_run_my_doc/TestPage_viewTestReport bottom (Content)
      erp5/portal_skins/erp5_officejs_slideshow_editor/WebPage_viewForSlideshowEditor bottom (Preview)
      erp5/portal_skins/erp5_credential/CredentialRequest_view left (Personal Information)
      erp5/portal_skins/erp5_credential/CredentialRequest_view left (Organisation Information)
      erp5/portal_skins/erp5_credential/CredentialRequest_view right (Login Information)
      erp5/portal_skins/erp5_credential/CredentialUpdate_view left (Personal Information)
      erp5/portal_skins/erp5_credential/CredentialUpdate_view left (Organisation Information)
      erp5/portal_skins/erp5_credential/CredentialUpdate_view right (Login Information)
      erp5/portal_skins/erp5_km/WebSection_viewKMMinimalThemeConfiguration left (Colors)
      erp5/portal_skins/erp5_km/WebSection_viewKMMinimalThemeConfiguration right (Static Content)
      erp5/portal_skins/erp5_km/WebSection_viewKMMinimalThemeConfiguration left (Navigation)
      erp5/portal_skins/erp5_km/WebSection_viewKMMinimalThemeConfiguration right (Gadgets)
      erp5/portal_skins/erp5_km_theme/Base_viewKMFieldLibrary right column (Toolbox)
      erp5/portal_skins/erp5_km_theme/WebSection_viewMinimalKMWidgetFieldLibrary bottom gadget (Bottom Gadget)
      erp5/portal_skins/erp5_km_theme/WebSection_viewMinimalKMWidgetFieldLibrary right column gadget (Right Gadget)
      erp5/portal_skins/erp5_km_theme/erp5_km_minimal_content_layout bottom gadget (Bottom Gadget)
      erp5/portal_skins/erp5_km_theme/erp5_km_minimal_content_layout right column gadget (Right Gadget)
      erp5/portal_skins/erp5_km_theme/erp5_km_minimal_layout bottom gadget (Bottom Gadget)
      erp5/portal_skins/erp5_km_theme/erp5_km_minimal_layout right column gadget (Right Gadget)
      erp5/portal_skins/erp5_km_theme/login_form left registration (Login)
      erp5/portal_skins/erp5_km_theme/login_form right registration (New User Registration)
      ```
      
      and this does not look bad when viewing the forms.
      80962da1
    • Jérome Perrin's avatar
    • Jérome Perrin's avatar
      4f29beeb
    • Jérome Perrin's avatar
    • Jérome Perrin's avatar
      coverage_report: give up downloading before testnode restarts us · 65befb55
      Jérome Perrin authored
      to make sure test terminates in case of problems with webdav server
      65befb55
    • Jérome Perrin's avatar
      ui_test: update more cases of users created in the test · 66d21fb7
      Jérome Perrin authored
      When a test needs to login as manager again, the best way is to use
      ${manager_username} and ${manager_password} set in cookies before
      running tests.
      
      This is continuation of 445e8fa8 (ERP5TypeTestCase: rework default
      manager password generation, 2024-05-27)
      66d21fb7
    • Titouan Soulard's avatar
    • Georgios Dagkakis's avatar
    • Georgios Dagkakis's avatar
      sqltest: decode strings (to the specified encoding ot 'utf-8') only in Python3 · 268a64a6
      Georgios Dagkakis authored
      as it is done in other places of this file
      268a64a6
    • Georgios Dagkakis's avatar
      ActivityTool: decode path and method_id when we try to get transaction's note · f02e7d62
      Georgios Dagkakis authored
      Otherwise, we may get error if we have special characters
      f02e7d62
    • Kazuhiko Shiozaki's avatar
    • Kazuhiko Shiozaki's avatar
    • Titouan Soulard's avatar
      erp5_xhtml_style: CKEditor – Fix duplicate image on paste · 9e486f06
      Titouan Soulard authored
      When pasting an image in CKEditor, the image was displayed twice.
      This behaviour is due to the new paste-as-base64 feature implemented in CKE,
      which conflict with existing plugins implementing the same feature.
      
      To solve it, add `clipboard_handleImages` option to the CKE configuration object,
      which disables its own image-pasting feature.
      
      See https://github.com/ckeditor/ckeditor4/issues/4874 for the corresponding issue on CKEditor’s repository.
      
      /cc @jerome @romain @tomo
      /reviewed-by @jerome
      /reviewed-on nexedi/erp5!1951
      9e486f06
    • Kazuhiko Shiozaki's avatar
    • Kazuhiko Shiozaki's avatar
    • Kazuhiko Shiozaki's avatar
      fixup! ERP5Workflow: DC Workflows are now ERP5 objects (!1378). · 215be608
      Kazuhiko Shiozaki authored
      fix convertToERP5Workflow() for the case where permission_roles is not yet configured.
      215be608
    • Kazuhiko Shiozaki's avatar
      fixup! ERP5Workflow: DC Workflows are now ERP5 objects (!1378). · 8ece59e2
      Kazuhiko Shiozaki authored
      if acquire_permission is not yet set in a Workflow State, we should consider it as 'acquire all permissions', like DCWorkflow implementation.
      8ece59e2
    • Kazuhiko Shiozaki's avatar
      fixup! ERP5Workflow: DC Workflows are now ERP5 objects (!1378). · 8309c79e
      Kazuhiko Shiozaki authored
      If state_permission_role_list_dict is not yet set in a Workflow State, the UI displays permission/role table with all unchecked.
      Once we save it in Permissions tab without checking anything, state_permission_role_list_dict will become like
        {'Access contents information': (),
         'Add portal content': (),
         'Modify portal content': (),
         'View': ()}
      This commit will make the behaviour same for these 'before save' and 'after save' cases as the UI displays exactly same.
      8309c79e
    • Jérome Perrin's avatar
      base: fix lxml usage in ImageUtil · a9ed421c
      Jérome Perrin authored
      a9ed421c
    • Jérome Perrin's avatar
      hal_json_style: remove useless log in Base_callDialogMethod · 2875e859
      Jérome Perrin authored
      for same reason as the xhtml_style version, there is no problem with
      having more than one listbox, see d2dedca3 (core: remove useless log
      in Base_callDialogMethod, 2020-07-03)
      2875e859
    • Jérome Perrin's avatar
      3085c41b
    • Jérome Perrin's avatar
      ods_style: provide a default input_order · 4f768cbd
      Jérome Perrin authored
      If preferences are not set, this causes a non existant style to be used
      4f768cbd
    • Jérome Perrin's avatar
      administration,core: wrong location when reporting pylint errors · e54a99c7
      Jérome Perrin authored
      In Check Source Code report on business template and CodingStyle tests,
      the lines were off by 1 and column off by 2 for python scripts.
      e54a99c7
    • Jérome Perrin's avatar
      ERP5TypeTestCase: rework default manager password generation · 66b5b9cd
      Jérome Perrin authored
      The default manager user (ERP5TypeTestCase) now have a random password
      generated at the beginning of test. The password is stored as a class
      attribute of the test case instance.
      Many tests have been updated to not generate manager user and use the
      existing one instead. When tests need to create users (for example
      users in the root acl_users), we try to give them a random password and
      to delete the users afterward.
      
      For functional tests, the approach is that ERP5TypeFunctionalTestCase
      sets cookies with manager username and password before running zelenium
      tests, so that in case tests want to log in again as manager, they can
      read the username and password from cookies.
      
      Another significant changes is that we no longer have the same user in
      ERP5/acl_users and /acl_users, some tests were logging in as the root
      user in ways that never seemed intentional.
      
      This also revealed (through test_manager_actions_on_portal from
      testERP5Core) that some tests were running with a user without all the
      expected permissions and the "Manager Components" actions was not
      visible for the default manager user. Fixing this also revealed that
      two actions ("Manage Components" and "Manage Callables") had the same
      priority, so the later was modified to use a different priority.
      66b5b9cd
    • Jérome Perrin's avatar
      ERP5Security/ERP5KeyAuthPlugin: replace pycrypto by cryptography · 56f6dbb1
      Jérome Perrin authored
      pycrypto is unmaintained and the python3 version no longer work with
      buildout 3 (it uses a tricky way to run 2to3 in setup.py that no longer
      happens with pip based buildout3)
      
      Also make the rest of this file python3 compatible.
      56f6dbb1
    • Jérome Perrin's avatar
      ERP5Form/ListBox: display error wrapper for editable fields with link · 3a936e46
      Jérome Perrin authored
      only the case without an URL column was properly handled
      3a936e46
    • Roque's avatar
      erp5_officejs: fix notebook action configuration · 36f020f2
      Roque authored
      36f020f2
    • Gabriel Monnerat's avatar
      erp5_oauth2_authorisation: Supports external login and erp5_credential if installed. · c23dd8e9
      Gabriel Monnerat authored
      If erp5_credential is installed in ERP5, we will use the dialog from erp5_credential instead of accessing portal_password directly.
      c23dd8e9
    • Roque's avatar
      erp5_web_monitoring: fix landing page, tests & minor fixes · d2423e79
      Roque authored
      - setting configurator header link
      - allow auto_sync when adding opml
      - update form title
      - fix landing page
      - fix dispatch
      - fix form naming
      - fix form and fields naming (coding style tests)
      d2423e79