diff --git a/.copier-answers.yml b/.copier-answers.yml index 81ccfb6ef..ea77e8003 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Do NOT update manually; changes here will be overwritten by Copier -_commit: v1.29 +_commit: v1.36 _src_path: git+https://github.com/OCA/oca-addons-repo-template additional_ruff_rules: [] ci: GitHub @@ -12,12 +12,13 @@ github_enable_codecov: true github_enable_makepot: true github_enable_stale_action: true github_enforce_dev_status_compatibility: true -include_wkhtmltopdf: false +include_wkhtmltopdf: true odoo_test_flavor: Both odoo_version: 18.0 org_name: Odoo Community Association (OCA) org_slug: OCA -rebel_module_groups: [] +rebel_module_groups: +- stock_picking_report_delivery_custom_name repo_description: stock-logistics-reporting repo_name: stock-logistics-reporting repo_slug: stock-logistics-reporting diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..e0d56685a --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +test-requirements.txt merge=union diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 5eb021ef1..852a07469 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -17,6 +17,7 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "3.11" + cache: 'pip' - name: Get python version run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV - uses: actions/cache@v4 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a06488079..1fd1cc9f1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,13 +36,22 @@ jobs: matrix: include: - container: ghcr.io/oca/oca-ci/py3.10-odoo18.0:latest + include: "stock_picking_report_delivery_custom_name" name: test with Odoo - container: ghcr.io/oca/oca-ci/py3.10-ocb18.0:latest + include: "stock_picking_report_delivery_custom_name" + name: test with OCB + makepot: "true" + - container: ghcr.io/oca/oca-ci/py3.10-odoo18.0:latest + exclude: "stock_picking_report_delivery_custom_name" + name: test with Odoo + - container: ghcr.io/oca/oca-ci/py3.10-ocb18.0:latest + exclude: "stock_picking_report_delivery_custom_name" name: test with OCB makepot: "true" services: postgres: - image: postgres:12.0 + image: postgres:12 env: POSTGRES_USER: odoo POSTGRES_PASSWORD: odoo @@ -50,6 +59,8 @@ jobs: ports: - 5432:5432 env: + INCLUDE: "${{ matrix.include }}" + EXCLUDE: "${{ matrix.exclude }}" OCA_ENABLE_CHECKLOG_ODOO: "1" steps: - uses: actions/checkout@v4 @@ -65,6 +76,13 @@ jobs: run: oca_init_test_database - name: Run tests run: oca_run_tests + - name: Upload screenshots from JS tests + uses: actions/upload-artifact@v4 + if: ${{ failure() }} + with: + name: Screenshots of failed JS tests - ${{ matrix.name }}${{ join(matrix.include) }} + path: /tmp/odoo_tests/${{ env.PGDATABASE }} + if-no-files-found: ignore - uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 347655413..f3b7e632a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -39,11 +39,11 @@ repos: language: fail files: '[a-zA-Z0-9_]*/i18n/en\.po$' - repo: https://github.com/sbidoul/whool - rev: v1.2 + rev: v1.3 hooks: - id: whool-init - repo: https://github.com/oca/maintainer-tools - rev: bf9ecb9938b6a5deca0ff3d870fbd3f33341fded + rev: b89f767503be6ab2b11e4f50a7557cb20066e667 hooks: # update the NOT INSTALLABLE ADDONS section above - id: oca-update-pre-commit-excluded-addons @@ -95,6 +95,7 @@ repos: additional_dependencies: - "eslint@9.12.0" - "eslint-plugin-jsdoc@50.3.1" + - "globals@16.0.0" - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.6.0 hooks: diff --git a/.pylintrc b/.pylintrc index 7c62b6d2e..197cb6737 100644 --- a/.pylintrc +++ b/.pylintrc @@ -25,19 +25,25 @@ disable=all enable=anomalous-backslash-in-string, api-one-deprecated, api-one-multi-together, - assignment-from-none, - attribute-deprecated, class-camelcase, - dangerous-default-value, dangerous-view-replace-wo-priority, - development-status-allowed, duplicate-id-csv, - duplicate-key, duplicate-xml-fields, duplicate-xml-record-id, eval-referenced, - eval-used, incoherent-interpreter-exec-perm, + openerp-exception-warning, + redundant-modulename-xml, + relative-import, + rst-syntax-error, + wrong-tabs-instead-of-spaces, + xml-syntax-error, + assignment-from-none, + attribute-deprecated, + dangerous-default-value, + development-status-allowed, + duplicate-key, + eval-used, license-allowed, manifest-author-string, manifest-deprecated-key, @@ -48,73 +54,68 @@ enable=anomalous-backslash-in-string, method-inverse, method-required-super, method-search, - openerp-exception-warning, pointless-statement, pointless-string-statement, print-used, redundant-keyword-arg, - redundant-modulename-xml, reimported, - relative-import, return-in-init, - rst-syntax-error, sql-injection, too-few-format-args, translation-field, translation-required, unreachable, use-vim-comment, - wrong-tabs-instead-of-spaces, - xml-syntax-error, - attribute-string-redundant, character-not-valid-in-resource-link, - consider-merging-classes-inherited, - context-overridden, create-user-wo-reset-password, dangerous-filter-wo-user, dangerous-qweb-replace-wo-priority, deprecated-data-xml-node, deprecated-openerp-xml-node, duplicate-po-message-definition, - except-pass, file-not-used, + missing-newline-extrafiles, + old-api7-method-defined, + po-msgstr-variables, + po-syntax-error, + str-format-used, + unnecessary-utf8-coding-comment, + xml-attribute-translatable, + xml-deprecated-qweb-directive, + xml-deprecated-tree-attribute, + attribute-string-redundant, + consider-merging-classes-inherited, + context-overridden, + except-pass, invalid-commit, manifest-maintainers-list, - missing-newline-extrafiles, missing-readme, missing-return, odoo-addons-relative-import, - old-api7-method-defined, - po-msgstr-variables, - po-syntax-error, renamed-field-parameter, resource-not-exist, - str-format-used, test-folder-imported, translation-contains-variable, translation-positional-used, - unnecessary-utf8-coding-comment, website-manifest-key-not-valid-uri, - xml-attribute-translatable, - xml-deprecated-qweb-directive, - xml-deprecated-tree-attribute, external-request-timeout, - # messages that do not cause the lint step to fail - consider-merging-classes-inherited, + missing-manifest-dependency, + too-complex,, create-user-wo-reset-password, dangerous-filter-wo-user, - deprecated-module, file-not-used, - invalid-commit, - missing-manifest-dependency, missing-newline-extrafiles, - missing-readme, no-utf8-coding-comment, - odoo-addons-relative-import, old-api7-method-defined, + unnecessary-utf8-coding-comment, + # messages that do not cause the lint step to fail + consider-merging-classes-inherited, + deprecated-module, + invalid-commit, + missing-readme, + odoo-addons-relative-import, redefined-builtin, - too-complex, - unnecessary-utf8-coding-comment + manifest-external-assets [REPORTS] diff --git a/.pylintrc-mandatory b/.pylintrc-mandatory index 018fd61cd..73674c04d 100644 --- a/.pylintrc-mandatory +++ b/.pylintrc-mandatory @@ -17,19 +17,25 @@ disable=all enable=anomalous-backslash-in-string, api-one-deprecated, api-one-multi-together, - assignment-from-none, - attribute-deprecated, class-camelcase, - dangerous-default-value, dangerous-view-replace-wo-priority, - development-status-allowed, duplicate-id-csv, - duplicate-key, duplicate-xml-fields, duplicate-xml-record-id, eval-referenced, - eval-used, incoherent-interpreter-exec-perm, + openerp-exception-warning, + redundant-modulename-xml, + relative-import, + rst-syntax-error, + wrong-tabs-instead-of-spaces, + xml-syntax-error, + assignment-from-none, + attribute-deprecated, + dangerous-default-value, + development-status-allowed, + duplicate-key, + eval-used, license-allowed, manifest-author-string, manifest-deprecated-key, @@ -40,56 +46,50 @@ enable=anomalous-backslash-in-string, method-inverse, method-required-super, method-search, - openerp-exception-warning, pointless-statement, pointless-string-statement, print-used, redundant-keyword-arg, - redundant-modulename-xml, reimported, - relative-import, return-in-init, - rst-syntax-error, sql-injection, too-few-format-args, translation-field, translation-required, unreachable, use-vim-comment, - wrong-tabs-instead-of-spaces, - xml-syntax-error, - attribute-string-redundant, character-not-valid-in-resource-link, - consider-merging-classes-inherited, - context-overridden, create-user-wo-reset-password, dangerous-filter-wo-user, dangerous-qweb-replace-wo-priority, deprecated-data-xml-node, deprecated-openerp-xml-node, duplicate-po-message-definition, - except-pass, file-not-used, + missing-newline-extrafiles, + old-api7-method-defined, + po-msgstr-variables, + po-syntax-error, + str-format-used, + unnecessary-utf8-coding-comment, + xml-attribute-translatable, + xml-deprecated-qweb-directive, + xml-deprecated-tree-attribute, + attribute-string-redundant, + consider-merging-classes-inherited, + context-overridden, + except-pass, invalid-commit, manifest-maintainers-list, - missing-newline-extrafiles, missing-readme, missing-return, odoo-addons-relative-import, - old-api7-method-defined, - po-msgstr-variables, - po-syntax-error, renamed-field-parameter, resource-not-exist, - str-format-used, test-folder-imported, translation-contains-variable, translation-positional-used, - unnecessary-utf8-coding-comment, website-manifest-key-not-valid-uri, - xml-attribute-translatable, - xml-deprecated-qweb-directive, - xml-deprecated-tree-attribute, external-request-timeout [REPORTS] diff --git a/README.md b/README.md index 8cc7bcb51..eb07cc15b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ +[![Support the OCA](https://odoo-community.org/readme-banner-image)](https://odoo-community.org/get-involved?utm_source=repo-readme) +# stock-logistics-reporting [![Runboat](https://img.shields.io/badge/runboat-Try%20me-875A7B.png)](https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-reporting&target_branch=18.0) [![Pre-commit Status](https://github.com/OCA/stock-logistics-reporting/actions/workflows/pre-commit.yml/badge.svg?branch=18.0)](https://github.com/OCA/stock-logistics-reporting/actions/workflows/pre-commit.yml?query=branch%3A18.0) [![Build Status](https://github.com/OCA/stock-logistics-reporting/actions/workflows/test.yml/badge.svg?branch=18.0)](https://github.com/OCA/stock-logistics-reporting/actions/workflows/test.yml?query=branch%3A18.0) @@ -7,11 +9,15 @@ +<<<<<<< before updating # Stock Reporting Are you looking for modules related to logistics? Or would like to contribute to? There are many repositories with specific purposes. Have a look at this [README](https://github.com/OCA/wms/blob/18.0/README.md). +======= +stock-logistics-reporting +>>>>>>> after updating diff --git a/eslint.config.cjs b/eslint.config.cjs index 0d5731f89..dd0cbe0ae 100644 --- a/eslint.config.cjs +++ b/eslint.config.cjs @@ -1,3 +1,4 @@ +var globals = require('globals'); jsdoc = require("eslint-plugin-jsdoc"); const config = [{ @@ -16,6 +17,8 @@ const config = [{ openerp: "readonly", owl: "readonly", luxon: "readonly", + QUnit: "readonly", + ...globals.browser, }, ecmaVersion: 2024, @@ -191,7 +194,7 @@ const config = [{ }, }, { - files: ["**/*.esm.js"], + files: ["**/*.esm.js", "**/*test.js"], languageOptions: { ecmaVersion: 2024, diff --git a/stock_picking_report_delivery_custom_name/README.rst b/stock_picking_report_delivery_custom_name/README.rst new file mode 100644 index 000000000..bfd236348 --- /dev/null +++ b/stock_picking_report_delivery_custom_name/README.rst @@ -0,0 +1,129 @@ +================================ +Hidden product names in pickings +================================ + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:f0badbbbeb097457171667cf21dcf5c251d284f75a573f5a79cd2d7c8131f979 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png + :target: https://odoo-community.org/page/development-status + :alt: Alpha +.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fstock--logistics--reporting-lightgray.png?logo=github + :target: https://github.com/OCA/stock-logistics-reporting/tree/18.0/stock_picking_report_delivery_custom_name + :alt: OCA/stock-logistics-reporting +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/stock-logistics-reporting-18-0/stock-logistics-reporting-18-0-stock_picking_report_delivery_custom_name + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/stock-logistics-reporting&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +When you install this module the product name will be hidden from the +delivery slip report whenever a description is set in the operation or +the detailed operation. + +.. IMPORTANT:: + This is an alpha version, the data model and design can change at any time without warning. + Only for development or testing purpose, do not use in production. + `More details on development status `_ + +**Table of contents** + +.. contents:: + :local: + +Use Cases / Context +=================== + +In some bussinesses even the internal references used in the product are +considered strategic information that should be kept secret. + +Configuration +============= + +In order to set a default picking description: + +- Go to *Inventory > Products \* Products* and chose the one you want. +- Click on the *Inventory* tab and go to the *Description for Delivery + orders* field. +- Set the text you want your customers to see. + +You can also use this module along with +``stock_picking_report_custom_description`` in order to get the +descriptions from the sales directly. + +Usage +===== + +To test this module, you can first configure the products with their +puclic descriptions or set them in the picking operations. + +- Go to *Inventory > Overview* and click in the *Delivery orders* orders + to process. +- Choose one and in the *Operations* tab, use the columns selector to + reveal the **Description** one. +- You can edit with the text you want to in the lines you want to. +- Print the delivery slip from the print menu in the header. +- You'll see just the description where you set it. + +Known issues / Roadmap +====================== + +- Allow to add exceptions at product level (a simple flag would do) to + allow to keep the standard behavior in some exceptions. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Moduon + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +.. |maintainer-chienandalu| image:: https://github.com/chienandalu.png?size=40px + :target: https://github.com/chienandalu + :alt: chienandalu +.. |maintainer-Andrii9090| image:: https://github.com/Andrii9090.png?size=40px + :target: https://github.com/Andrii9090 + :alt: Andrii9090 + +Current `maintainers `__: + +|maintainer-chienandalu| |maintainer-Andrii9090| + +This module is part of the `OCA/stock-logistics-reporting `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/stock_picking_report_delivery_custom_name/__init__.py b/stock_picking_report_delivery_custom_name/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/stock_picking_report_delivery_custom_name/__manifest__.py b/stock_picking_report_delivery_custom_name/__manifest__.py new file mode 100644 index 000000000..438a77f55 --- /dev/null +++ b/stock_picking_report_delivery_custom_name/__manifest__.py @@ -0,0 +1,21 @@ +# Copyright 2023 Moduon Team S.L. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) + +{ + "name": "Hidden product names in pickings", + "summary": """ + Allows to hide the product display name in favor of the picking description""", + "version": "18.0.1.0.0", + "development_status": "Alpha", + "category": "Inventory/Delivery", + "website": "https://github.com/OCA/stock-logistics-reporting", + "author": "Moduon, Odoo Community Association (OCA)", + "maintainers": ["chienandalu", "Andrii9090"], + "license": "LGPL-3", + "depends": [ + "stock", + ], + "data": [ + "views/report_deliveryslip.xml", + ], +} diff --git a/stock_picking_report_delivery_custom_name/i18n/it.po b/stock_picking_report_delivery_custom_name/i18n/it.po new file mode 100644 index 000000000..73388557f --- /dev/null +++ b/stock_picking_report_delivery_custom_name/i18n/it.po @@ -0,0 +1,14 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" diff --git a/stock_picking_report_delivery_custom_name/i18n/stock_picking_report_delivery_custom_name.pot b/stock_picking_report_delivery_custom_name/i18n/stock_picking_report_delivery_custom_name.pot new file mode 100644 index 000000000..78d58d53f --- /dev/null +++ b/stock_picking_report_delivery_custom_name/i18n/stock_picking_report_delivery_custom_name.pot @@ -0,0 +1,13 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" diff --git a/stock_picking_report_delivery_custom_name/pyproject.toml b/stock_picking_report_delivery_custom_name/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/stock_picking_report_delivery_custom_name/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/stock_picking_report_delivery_custom_name/readme/CONFIGURE.md b/stock_picking_report_delivery_custom_name/readme/CONFIGURE.md new file mode 100644 index 000000000..9ee725860 --- /dev/null +++ b/stock_picking_report_delivery_custom_name/readme/CONFIGURE.md @@ -0,0 +1,8 @@ +In order to set a default picking description: + +- Go to *Inventory > Products * Products* and chose the one you want. +- Click on the *Inventory* tab and go to the *Description for Delivery orders* field. +- Set the text you want your customers to see. + +You can also use this module along with `stock_picking_report_custom_description` in +order to get the descriptions from the sales directly. diff --git a/stock_picking_report_delivery_custom_name/readme/CONTEXT.md b/stock_picking_report_delivery_custom_name/readme/CONTEXT.md new file mode 100644 index 000000000..eeb676883 --- /dev/null +++ b/stock_picking_report_delivery_custom_name/readme/CONTEXT.md @@ -0,0 +1,2 @@ +In some bussinesses even the internal references used in the product are considered +strategic information that should be kept secret. diff --git a/stock_picking_report_delivery_custom_name/readme/DESCRIPTION.md b/stock_picking_report_delivery_custom_name/readme/DESCRIPTION.md new file mode 100644 index 000000000..dd8f3617e --- /dev/null +++ b/stock_picking_report_delivery_custom_name/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +When you install this module the product name will be hidden from the delivery slip +report whenever a description is set in the operation or the detailed operation. diff --git a/stock_picking_report_delivery_custom_name/readme/ROADMAP.md b/stock_picking_report_delivery_custom_name/readme/ROADMAP.md new file mode 100644 index 000000000..3760f78b3 --- /dev/null +++ b/stock_picking_report_delivery_custom_name/readme/ROADMAP.md @@ -0,0 +1,2 @@ +- Allow to add exceptions at product level (a simple flag would do) to allow to keep the + standard behavior in some exceptions. diff --git a/stock_picking_report_delivery_custom_name/readme/USAGE.md b/stock_picking_report_delivery_custom_name/readme/USAGE.md new file mode 100644 index 000000000..af1030282 --- /dev/null +++ b/stock_picking_report_delivery_custom_name/readme/USAGE.md @@ -0,0 +1,9 @@ +To test this module, you can first configure the products with their puclic descriptions +or set them in the picking operations. + +- Go to *Inventory > Overview* and click in the *Delivery orders* orders to process. +- Choose one and in the *Operations* tab, use the columns selector to reveal the + **Description** one. +- You can edit with the text you want to in the lines you want to. +- Print the delivery slip from the print menu in the header. +- You'll see just the description where you set it. diff --git a/stock_picking_report_delivery_custom_name/static/description/icon.png b/stock_picking_report_delivery_custom_name/static/description/icon.png new file mode 100644 index 000000000..1dcc49c24 Binary files /dev/null and b/stock_picking_report_delivery_custom_name/static/description/icon.png differ diff --git a/stock_picking_report_delivery_custom_name/static/description/index.html b/stock_picking_report_delivery_custom_name/static/description/index.html new file mode 100644 index 000000000..0df220d0c --- /dev/null +++ b/stock_picking_report_delivery_custom_name/static/description/index.html @@ -0,0 +1,469 @@ + + + + + +Hidden product names in pickings + + + +
+

Hidden product names in pickings

+ + +

Alpha License: LGPL-3 OCA/stock-logistics-reporting Translate me on Weblate Try me on Runboat

+

When you install this module the product name will be hidden from the +delivery slip report whenever a description is set in the operation or +the detailed operation.

+
+

Important

+

This is an alpha version, the data model and design can change at any time without warning. +Only for development or testing purpose, do not use in production. +More details on development status

+
+

Table of contents

+ +
+

Use Cases / Context

+

In some bussinesses even the internal references used in the product are +considered strategic information that should be kept secret.

+
+
+

Configuration

+

In order to set a default picking description:

+
    +
  • Go to Inventory > Products * Products and chose the one you want.
  • +
  • Click on the Inventory tab and go to the Description for Delivery +orders field.
  • +
  • Set the text you want your customers to see.
  • +
+

You can also use this module along with +stock_picking_report_custom_description in order to get the +descriptions from the sales directly.

+
+
+

Usage

+

To test this module, you can first configure the products with their +puclic descriptions or set them in the picking operations.

+
    +
  • Go to Inventory > Overview and click in the Delivery orders orders +to process.
  • +
  • Choose one and in the Operations tab, use the columns selector to +reveal the Description one.
  • +
  • You can edit with the text you want to in the lines you want to.
  • +
  • Print the delivery slip from the print menu in the header.
  • +
  • You’ll see just the description where you set it.
  • +
+
+
+

Known issues / Roadmap

+
    +
  • Allow to add exceptions at product level (a simple flag would do) to +allow to keep the standard behavior in some exceptions.
  • +
+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Moduon
  • +
+
+
+

Maintainers

+

This module is maintained by the OCA.

+ +Odoo Community Association + +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

Current maintainers:

+

chienandalu Andrii9090

+

This module is part of the OCA/stock-logistics-reporting project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/stock_picking_report_delivery_custom_name/tests/__init__.py b/stock_picking_report_delivery_custom_name/tests/__init__.py new file mode 100644 index 000000000..8b887e347 --- /dev/null +++ b/stock_picking_report_delivery_custom_name/tests/__init__.py @@ -0,0 +1 @@ +from . import test_delivery_slip_custom_name diff --git a/stock_picking_report_delivery_custom_name/tests/test_delivery_slip_custom_name.py b/stock_picking_report_delivery_custom_name/tests/test_delivery_slip_custom_name.py new file mode 100644 index 000000000..5bcebcb1f --- /dev/null +++ b/stock_picking_report_delivery_custom_name/tests/test_delivery_slip_custom_name.py @@ -0,0 +1,59 @@ +# Copyright 2023 Moduon Team S.L. +# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) +from odoo.tests import Form, common +from odoo.tools import html2plaintext + + +class TestStockPickingReportCustomName(common.TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.customer = cls.env["res.partner"].create({"name": "Mr. Odoo"}) + cls.product = cls.env["product.product"].create( + { + "name": "Super secret part name", + "default_code": "SPN", + "type": "consu", + "description_pickingout": "Generic part public name", + } + ) + cls.delivery_type = cls.env.ref("stock.picking_type_out") + picking_form = Form(cls.env["stock.picking"]) + picking_form.picking_type_id = cls.env.ref("stock.picking_type_out") + with picking_form.move_ids_without_package.new() as move_form: + move_form.product_id = cls.product + move_form.product_uom_qty = 1 + move_form.quantity = 1 + cls.picking = picking_form.save() + + def _get_report_in_plain_text(self): + html, _ = self.env["ir.actions.report"]._render_qweb_html( + "stock.action_report_delivery", self.picking.ids + ) + return html2plaintext(html) + + def test_delivery_slip_with_public_name(self): + text = self._get_report_in_plain_text() + self.assertTrue("Generic part public name" in text) + self.assertFalse("Super secret part name" in text) + self.picking.button_validate() + # Now we're seeing detailed operations + text = self._get_report_in_plain_text() + self.assertTrue("Generic part public name" in text) + self.assertFalse("Super secret part name" in text) + + def test_delivery_slip_with_regular_name(self): + self.picking.move_ids.description_picking = False + text = self._get_report_in_plain_text() + self.assertFalse("Generic part public name" in text) + self.assertTrue("[SPN] Super secret part name" in text) + # The description is ignored as it's equal to the product name + self.picking.move_ids.description_picking = "Super secret part name" + text = self._get_report_in_plain_text() + self.assertFalse("Generic part public name" in text) + self.assertTrue("[SPN] Super secret part name" in text) + self.assertEqual( + 1, + text.count("Super secret part name"), + "The name should be printed just once!", + ) diff --git a/stock_picking_report_delivery_custom_name/views/report_deliveryslip.xml b/stock_picking_report_delivery_custom_name/views/report_deliveryslip.xml new file mode 100644 index 000000000..96634c79b --- /dev/null +++ b/stock_picking_report_delivery_custom_name/views/report_deliveryslip.xml @@ -0,0 +1,49 @@ + + + + + + +