From c48052b309443a4321b4a3fe985f9c98fbd6c6a4 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Wed, 29 Nov 2023 09:19:42 +0000 Subject: [PATCH 1/2] [IMP] base_sequence_default: better readme Fixes https://github.com/OCA/server-tools/issues/2769 @moduon MT-4324 Co-authored-by: Gelo Joga <147538094+Gelojr@users.noreply.github.com> --- base_sequence_default/README.rst | 31 ++++++++-- base_sequence_default/readme/CONFIGURE.md | 9 ++- base_sequence_default/readme/DESCRIPTION.md | 7 ++- base_sequence_default/readme/USAGE.md | 2 + .../static/description/index.html | 62 ++++++++++++------- 5 files changed, 81 insertions(+), 30 deletions(-) diff --git a/base_sequence_default/README.rst b/base_sequence_default/README.rst index fa9c8ed20c9..0f3350bb04a 100644 --- a/base_sequence_default/README.rst +++ b/base_sequence_default/README.rst @@ -7,7 +7,7 @@ Default Fields with Sequence !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:46bd6b862d7ba13aade25e32561797314eacd98aabe5af22479e59e95bd4fc59 + !! source digest: sha256:ff7d3aed37cb25905d2a42e95caa5434fd63ca836b1f894f53a8435b5454a489 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png @@ -28,8 +28,11 @@ Default Fields with Sequence |badge1| |badge2| |badge3| |badge4| |badge5| -This module extends the defaults functionality to allow filling -*Character* type fields on creation with a predefined sequence. +This module extends the use of sequences. It will allow you to use them +in any text field. + +If configured correctly, new records will have a default incremental +value in the field of your choice. .. IMPORTANT:: This is an alpha version, the data model and design can change at any time without warning. @@ -47,32 +50,52 @@ Configuration To configure this module, you need to: 1. Enable developer mode. + 2. Go to the form view of the model to which you want to add the new sequential default value. + 3. Hover over the field to which you want to add the sequential default value. A tooltip with more info will appear. + 4. Make sure the tooltip says *Type: char*. Only those fields will work. + 5. Take note of the *Object* and *Field*. + 6. Go to *Settings > Technical > Sequences & Identifiers > Sequences*. + 7. Create one sequence with code named after this pattern: ``base_sequence_default.{object}.fields.{field}``. E.g.: ``base_sequence_default.res.partner.fields.name`` to add a default - sequenced name for new partners. + sequenced name for new partners. Do not use ``{}`` when adding the + model and field name to the pattern. + + .. image:: https://github.com/OCA/server-tools/assets/147538094/ebf4be69-85d4-4c28-a3ec-bbe930fd53cf + :alt: Setting the sequence code properly + 8. Configure the sequence at will. + .. image:: https://github.com/OCA/server-tools/assets/147538094/e3eb311b-738f-4fce-9af5-a1b592908704 + :alt: Configuring a sequence to have date range sub-sequences + Usage ===== To use this module, it is necessary to: 1. Follow the configuration instructions. + 2. Create a record of the model you configured. + 3. Leave empty the fields where you configured a sequence. If they are required fields, set value to "-" to trigger the automatic sequence on creation. + 4. Check that the field defined in the sequence is set to the next value in the sequence. + .. image:: https://github.com/OCA/server-tools/assets/147538094/82698762-6ac2-4ac0-89ba-7c9b32ea5909 + :alt: The partner reference was auto-incremented as configured + Bug Tracker =========== diff --git a/base_sequence_default/readme/CONFIGURE.md b/base_sequence_default/readme/CONFIGURE.md index 18524458677..2577ee76ea6 100644 --- a/base_sequence_default/readme/CONFIGURE.md +++ b/base_sequence_default/readme/CONFIGURE.md @@ -12,6 +12,11 @@ To configure this module, you need to: Sequences*. 7. Create one sequence with code named after this pattern: `base_sequence_default.{object}.fields.{field}`. E.g.: - `base_sequence_default.res.partner.fields.name` to add a default - sequenced name for new partners. + `base_sequence_default.res.partner.fields.name` to add a default sequenced + name for new partners. Do not use `{}` when adding the model and field name + to the pattern. + + ![Setting the sequence code properly](https://github.com/OCA/server-tools/assets/147538094/ebf4be69-85d4-4c28-a3ec-bbe930fd53cf) 8. Configure the sequence at will. + + ![Configuring a sequence to have date range sub-sequences](https://github.com/OCA/server-tools/assets/147538094/e3eb311b-738f-4fce-9af5-a1b592908704) diff --git a/base_sequence_default/readme/DESCRIPTION.md b/base_sequence_default/readme/DESCRIPTION.md index 1ebf3825927..382ab131a7a 100644 --- a/base_sequence_default/readme/DESCRIPTION.md +++ b/base_sequence_default/readme/DESCRIPTION.md @@ -1,2 +1,5 @@ -This module extends the defaults functionality to allow filling -*Character* type fields on creation with a predefined sequence. +This module extends the use of sequences. It will allow you to use them in any text +field. + +If configured correctly, new records will have a default incremental value in the field +of your choice. diff --git a/base_sequence_default/readme/USAGE.md b/base_sequence_default/readme/USAGE.md index c349a6ab0ab..2f838f6d34f 100644 --- a/base_sequence_default/readme/USAGE.md +++ b/base_sequence_default/readme/USAGE.md @@ -7,3 +7,5 @@ To use this module, it is necessary to: on creation. 4. Check that the field defined in the sequence is set to the next value in the sequence. + + ![The partner reference was auto-incremented as configured](https://github.com/OCA/server-tools/assets/147538094/82698762-6ac2-4ac0-89ba-7c9b32ea5909) diff --git a/base_sequence_default/static/description/index.html b/base_sequence_default/static/description/index.html index 8d74da71232..cb961f1100a 100644 --- a/base_sequence_default/static/description/index.html +++ b/base_sequence_default/static/description/index.html @@ -367,11 +367,13 @@

Default Fields with Sequence

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:46bd6b862d7ba13aade25e32561797314eacd98aabe5af22479e59e95bd4fc59 +!! source digest: sha256:ff7d3aed37cb25905d2a42e95caa5434fd63ca836b1f894f53a8435b5454a489 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Alpha License: AGPL-3 OCA/server-tools Translate me on Weblate Try me on Runboat

-

This module extends the defaults functionality to allow filling -Character type fields on creation with a predefined sequence.

+

This module extends the use of sequences. It will allow you to use them +in any text field.

+

If configured correctly, new records will have a default incremental +value in the field of your choice.

Important

This is an alpha version, the data model and design can change at any time without warning. @@ -395,33 +397,49 @@

Default Fields with Sequence

Configuration

To configure this module, you need to:

-
    -
  1. Enable developer mode.
  2. -
  3. Go to the form view of the model to which you want to add the new -sequential default value.
  4. -
  5. Hover over the field to which you want to add the sequential default -value. A tooltip with more info will appear.
  6. -
  7. Make sure the tooltip says Type: char. Only those fields will work.
  8. -
  9. Take note of the Object and Field.
  10. -
  11. Go to Settings > Technical > Sequences & Identifiers > Sequences.
  12. -
  13. Create one sequence with code named after this pattern: +
      +
    1. Enable developer mode.

      +
    2. +
    3. Go to the form view of the model to which you want to add the new +sequential default value.

      +
    4. +
    5. Hover over the field to which you want to add the sequential default +value. A tooltip with more info will appear.

      +
    6. +
    7. Make sure the tooltip says Type: char. Only those fields will work.

      +
    8. +
    9. Take note of the Object and Field.

      +
    10. +
    11. Go to Settings > Technical > Sequences & Identifiers > Sequences.

      +
    12. +
    13. Create one sequence with code named after this pattern: base_sequence_default.{object}.fields.{field}. E.g.: base_sequence_default.res.partner.fields.name to add a default -sequenced name for new partners.

    14. -
    15. Configure the sequence at will.
    16. +sequenced name for new partners. Do not use {} when adding the +model and field name to the pattern.

      +Setting the sequence code properly + +
    17. Configure the sequence at will.

      +Configuring a sequence to have date range sub-sequences +

Usage

To use this module, it is necessary to:

-
    -
  1. Follow the configuration instructions.
  2. -
  3. Create a record of the model you configured.
  4. -
  5. Leave empty the fields where you configured a sequence. If they are +
      +
    1. Follow the configuration instructions.

      +
    2. +
    3. Create a record of the model you configured.

      +
    4. +
    5. Leave empty the fields where you configured a sequence. If they are required fields, set value to “-” to trigger the automatic sequence -on creation.

    6. -
    7. Check that the field defined in the sequence is set to the next value -in the sequence.
    8. +on creation.

      + +
    9. Check that the field defined in the sequence is set to the next value +in the sequence.

      +The partner reference was auto-incremented as configured +
From d650568e45a6240052178a5c6053e2bb4858948a Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Sat, 9 Dec 2023 15:30:33 +0000 Subject: [PATCH 2/2] [BOT] post-merge updates --- README.md | 2 +- base_sequence_default/README.rst | 16 +++++++++------- base_sequence_default/__manifest__.py | 2 +- .../static/description/index.html | 8 ++++---- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 8382c75aa3d..2372e15b01f 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ addon | version | maintainers | summary [base_name_search_improved](base_name_search_improved/) | 16.0.1.0.0 | | Friendlier search when typing in relation fields [base_partition](base_partition/) | 16.0.1.0.0 | | Base module that provide the partition method on all models [base_search_fuzzy](base_search_fuzzy/) | 16.0.1.0.0 | | Fuzzy search with the PostgreSQL trigram extension -[base_sequence_default](base_sequence_default/) | 16.0.1.0.1 | [![Shide](https://github.com/Shide.png?size=30px)](https://github.com/Shide) [![yajo](https://github.com/yajo.png?size=30px)](https://github.com/yajo) [![rafaelbn](https://github.com/rafaelbn.png?size=30px)](https://github.com/rafaelbn) | Use sequences for default values of fields when creating a new record +[base_sequence_default](base_sequence_default/) | 16.0.1.0.2 | [![Shide](https://github.com/Shide.png?size=30px)](https://github.com/Shide) [![yajo](https://github.com/yajo.png?size=30px)](https://github.com/yajo) [![rafaelbn](https://github.com/rafaelbn.png?size=30px)](https://github.com/rafaelbn) | Use sequences for default values of fields when creating a new record [base_sequence_option](base_sequence_option/) | 16.0.1.0.0 | [![kittiu](https://github.com/kittiu.png?size=30px)](https://github.com/kittiu) | Alternative sequence options for specific models [base_sparse_field_list_support](base_sparse_field_list_support/) | 16.0.1.0.0 | | add list support to convert_to_cache() [base_technical_user](base_technical_user/) | 16.0.1.0.0 | | Add a technical user parameter on the company diff --git a/base_sequence_default/README.rst b/base_sequence_default/README.rst index 0f3350bb04a..32306302b8e 100644 --- a/base_sequence_default/README.rst +++ b/base_sequence_default/README.rst @@ -7,7 +7,7 @@ Default Fields with Sequence !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:ff7d3aed37cb25905d2a42e95caa5434fd63ca836b1f894f53a8435b5454a489 + !! source digest: sha256:30552d740f43d32a3643985156656c3d9917f363a22c3e46b3dc906cc2144d00 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png @@ -69,13 +69,14 @@ To configure this module, you need to: sequenced name for new partners. Do not use ``{}`` when adding the model and field name to the pattern. - .. image:: https://github.com/OCA/server-tools/assets/147538094/ebf4be69-85d4-4c28-a3ec-bbe930fd53cf - :alt: Setting the sequence code properly + |Setting the sequence code properly| 8. Configure the sequence at will. - .. image:: https://github.com/OCA/server-tools/assets/147538094/e3eb311b-738f-4fce-9af5-a1b592908704 - :alt: Configuring a sequence to have date range sub-sequences + |Configuring a sequence to have date range sub-sequences| + +.. |Setting the sequence code properly| image:: https://github.com/OCA/server-tools/assets/147538094/ebf4be69-85d4-4c28-a3ec-bbe930fd53cf +.. |Configuring a sequence to have date range sub-sequences| image:: https://github.com/OCA/server-tools/assets/147538094/e3eb311b-738f-4fce-9af5-a1b592908704 Usage ===== @@ -93,8 +94,9 @@ To use this module, it is necessary to: 4. Check that the field defined in the sequence is set to the next value in the sequence. - .. image:: https://github.com/OCA/server-tools/assets/147538094/82698762-6ac2-4ac0-89ba-7c9b32ea5909 - :alt: The partner reference was auto-incremented as configured + |The partner reference was auto-incremented as configured| + +.. |The partner reference was auto-incremented as configured| image:: https://github.com/OCA/server-tools/assets/147538094/82698762-6ac2-4ac0-89ba-7c9b32ea5909 Bug Tracker =========== diff --git a/base_sequence_default/__manifest__.py b/base_sequence_default/__manifest__.py index 2cded8af15f..dce342f6ea4 100644 --- a/base_sequence_default/__manifest__.py +++ b/base_sequence_default/__manifest__.py @@ -4,7 +4,7 @@ { "name": "Default Fields with Sequence", "summary": "Use sequences for default values of fields when creating a new record", - "version": "16.0.1.0.1", + "version": "16.0.1.0.2", "development_status": "Alpha", "category": "Tools", "website": "https://github.com/OCA/server-tools", diff --git a/base_sequence_default/static/description/index.html b/base_sequence_default/static/description/index.html index cb961f1100a..f474d8f8e13 100644 --- a/base_sequence_default/static/description/index.html +++ b/base_sequence_default/static/description/index.html @@ -367,7 +367,7 @@

Default Fields with Sequence

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:ff7d3aed37cb25905d2a42e95caa5434fd63ca836b1f894f53a8435b5454a489 +!! source digest: sha256:30552d740f43d32a3643985156656c3d9917f363a22c3e46b3dc906cc2144d00 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Alpha License: AGPL-3 OCA/server-tools Translate me on Weblate Try me on Runboat

This module extends the use of sequences. It will allow you to use them @@ -417,10 +417,10 @@

Configuration

base_sequence_default.res.partner.fields.name to add a default sequenced name for new partners. Do not use {} when adding the model and field name to the pattern.

-Setting the sequence code properly +

Setting the sequence code properly

  • Configure the sequence at will.

    -Configuring a sequence to have date range sub-sequences +

    Configuring a sequence to have date range sub-sequences

  • @@ -438,7 +438,7 @@

    Usage

  • Check that the field defined in the sequence is set to the next value in the sequence.

    -The partner reference was auto-incremented as configured +

    The partner reference was auto-incremented as configured