1. 02 Feb, 2022 7 commits
    • Cédric Le Ninivin's avatar
      erp5_api_style: Introduce ERP5 APi Style · 66d2350b
      Cédric Le Ninivin authored
      erp5_api_style: Use default module for object creation
      
      erp5_api_style: jIOStyle fix error handling for post
      
      erp5_api_style: Start improving error feedback
      
      erp5_api_style: Add error record module and portal type
      
      erp5_api_style: Fix error output as jIO Style
      
      erp5_api_style: Introduce jIO Web Section
      
      erp5_api_style: catch value Error when error text is not a json
      
      erp5_api_style: Add generic way to handle errors
      
      erp5_api_style: Fix Web Section Portal Type for api style
      
      erp5_api_style: Fix jIO Api Style
      
      * use self.REQUEST instead of parameter in jIO Web Section
      * Use List error in allDocs
      
      erp5_api_style: API error return http error code 400
      
      erp5_api_style: Display actions title in jio web section configuration listbox
      
      erp5_api_style: allDocs return indented result
      
      erp5_api_style: Add response schema to jIO Style. Object creation return 201 http code
      
      erp5_api_style: Post set status to 201 only if status is not yet defined
      
      erp5_api_style: action list is now sorted by float index
      
      erp5_api_style: all docs return error dict like post
      
      erp5_api_style: error can return error name and error link
      
      erp5_api_style: improve error handling in jIO Style
      
      * Give name to errors
      * Error Name is stored in error record title
      
      erp5_api_style: Add views for error records
      
      erp5_api_style: add script to provide JSON API Hyperschema
      
      erp5_api_style: fixup not found document return 404 error
      
      erp5_api_style: api is in charge of JSON decoding and provide utf 8 data
      66d2350b
    • Cédric Le Ninivin's avatar
      erp5_json_form: Introduce JSON Form · c6e762a4
      Cédric Le Ninivin authored
      erp5_json_form: Improve error feedback
      
      erp5_json_form: Add missing property sheet JSON Form
      
      erp5_json_form: Add response Schema to JSON Form
      
      erp5_json_form: Add Init Script on JSON Form
      
      * Useful to set content type to "application/json"
      
      erp5_json_form: Cleanup JSON Form document
      c6e762a4
    • Cédric Le Ninivin's avatar
    • Cédric Le Ninivin's avatar
    • Cédric Le Ninivin's avatar
      3cb2f783
    • Cédric Le Ninivin's avatar
    • Cédric Le Ninivin's avatar
      erp5_json_type: Add improvements to json type · a2b42906
      Cédric Le Ninivin authored
      * Add basic property sheets
      * Add init script to set Constraint and Type
      * Validator can return the list of errors
      * Provide field library
      a2b42906
  2. 01 Feb, 2022 1 commit
  3. 31 Jan, 2022 1 commit
    • Vincent Pelletier's avatar
      Products.ERP5Type.Core.Predicate: Obey isEmptyCriterionValid . · 57463f30
      Vincent Pelletier authored
      When EmptyCriterionValid property is true, this method is expected to
      return a query which does not match any document. This only happens when
      query_list is empty, but because of category membership checking,
      query_list is never empty: it at least contains two ComplexQueries which
      themselves may contain an empty query list, and which match all documents.
      Calling getCategoryParameterDict with an empty list is dubious, but
      changing its behaviour in ZSQLCatalog may affect more than just predicates,
      so change the behaviour in Predicate class directly by checking whether
      there is any category being matched to begin with.
      57463f30
  4. 28 Jan, 2022 1 commit
  5. 27 Jan, 2022 1 commit
  6. 26 Jan, 2022 4 commits
  7. 24 Jan, 2022 3 commits
    • Vincent Pelletier's avatar
    • Jérome Perrin's avatar
      pdm: support defining function on supply lines · 622b2b80
      Jérome Perrin authored
      We make it possible to define function the same way it's currently
      possible to define accounts. The idea is similar: to be able to use this
      information in accounting generation rules.
      
      The typical accounting generation configuration using this will use the
      function defined on the supply line if any is defined and with a fallback
      to the function defined on business process' trade model path.
      
      For now we don't introduce such configuration by default, but this may
      become part of  the configuration generated by configurator some day.
      622b2b80
    • Jérome Perrin's avatar
      accounting: show a column for items on accounting transactions views · 0ac9d669
      Jérome Perrin authored
      The view of accounting transactions have dynamic columns so that all the
      information that matters the most is displayed directly on the "main"
      view. This extends the columns to add a column for all the items attached
      to accounting movements.
      0ac9d669
  8. 21 Jan, 2022 1 commit
    • Jérome Perrin's avatar
      property_sheets: generate value accessors for source/destination accounts on default supply · 5ad2b222
      Jérome Perrin authored
      Without these accessors, we have to use constructs like:
      
          resource.edit(
              default_purchase_supply_line_destination_account='account_module/123'
          )
      
      with the accessors, we can use:
      
          resource.edit(
              default_purchase_supply_line_destination_account_value=account,
          )
      
      The former is a bit error prone, because typos in the property name
      silently create a local propery and typos in the relative URL make a
      "broken" relation.
      5ad2b222
  9. 20 Jan, 2022 1 commit
  10. 18 Jan, 2022 1 commit
    • Jérome Perrin's avatar
      dms: rename print actions not to conflict with erp5_odt_style · ea4debfe
      Jérome Perrin authored
      odt_style comes with "Print" global actions which allows getting the
      default form as ODT and convert it to selected format and DMS comes with
      "Print" actions which return a PDF of the document content.
      
      As a result, when user try to use Print, they have the same action twice
      with no way to know which one is which.
      
      This is detected by CodingStyleTestCase.test_DuplicateActions, but only
      for configurations where both erp5_odt_style and erp5_dms are installed,
      which is not the case in coding style test suite which only install the
      miminmal dependent business templates.
      ea4debfe
  11. 17 Jan, 2022 3 commits
  12. 14 Jan, 2022 6 commits
    • Jérome Perrin's avatar
      Workflow: don't change REQUEST when passing transition · 91af570a
      Jérome Perrin authored
      The new workflow implementation from df85ef46 (ERP5Workflow: DC Workflows
      are now ERP5 objects (!1378)., 2020-11-18) had a different behavior in
      the implementation of _executeTransition, it was setting all kwargs
      from the transition in REQUEST. The reasons for this are unclear, it
      seem to come from the first Workflow implementation, 81784db4 (Initial
      Import of ERP5Workflow porduct., 2010-10-15)
      
      The side effects are that calling a workflow method, for example:
      
        document.edit(key=value)
      
      would also alter the global request to set key=value in REQUEST, for the
      rest of the current request.
      
      It was causing subtle issues, especially in tests where the REQUEST
      lifetime is long.
      91af570a
    • Jérome Perrin's avatar
      workflow: fix Update Security Roles action on workflow · 55049a0c
      Jérome Perrin authored
      This was redirecting with the full list of updated documents URLs,
      causing too long URLs.
      
      This also simplifies code a bit, change the wording of messages and
      use translation.
      55049a0c
    • Yusei Tahara's avatar
      b092cb06
    • Jérome Perrin's avatar
      ERP5Type: make TempBase use TemporaryDocumentMixin · 86951172
      Jérome Perrin authored
      Now that TemporaryDocumentMixin and TempBase implementation details have
      been made consistent, there's no reason to duplicate code.
      
      This also make TempBase uses TemporaryDocumentMixin of __setstate__, so
      TempBase have more sane behaviour when being pickled.
      86951172
    • Jérome Perrin's avatar
      ERP5Type: Normalize the implementations of TemporaryDocumentMixin and TempBase · b2e03135
      Jérome Perrin authored
      Products.ERP5Type.mixin.temporary.TemporaryDocumentMixin and
      Products.ERP5Type.Base.TempBase implementations were a bit different:
      
       - getTitle was acquiring title in TemporaryDocumentMixin, although this
       was probably never acquiring in practice because most documents have
       a title.
       - isIndexable was an int and not a PropertyConstantGetter like it is
       supposed to be.
      
      Change TemporaryDocumentMixin to behave like TempBase here.
      
      =
      b2e03135
    • Jérome Perrin's avatar
      core: support storing collections of ERP5 documents in session · 490a56ba
      Jérome Perrin authored
      Before f359f267 (Use Distributed Cache for Session, 2021-07-19)
      when we were using RAM cache for sessions, it was possible to store
      collections (eg. dicts or lists) with reference to ERP5 documents in
      session, but after this change, using such collections was refused
      with error:
      
          TypeError: Can't pickle objects in acquisition wrappers.
      
      This change restore the possibility of using collections, by being
      more clever when we store and retrieve collections
      490a56ba
  13. 13 Jan, 2022 9 commits
  14. 12 Jan, 2022 1 commit