diff --git a/.copier-answers.yml b/.copier-answers.yml index 93235804ae12..d41c1e730e46 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,7 +1,8 @@ # Do NOT update manually; changes here will be overwritten by Copier -_commit: v1.17.2 +_commit: v1.19.2 _src_path: gh:oca/oca-addons-repo-template ci: GitHub +convert_readme_fragments_to_markdown: false generate_requirements_txt: true github_check_license: true github_ci_extra_env: {} @@ -14,9 +15,13 @@ odoo_test_flavor: Both odoo_version: 14.0 org_name: Odoo Community Association (OCA) org_slug: OCA -rebel_module_groups: [] +rebel_module_groups: +- product_internal_reference_generator +- product_sequence repo_description: 'TODO: add repo description.' repo_name: product-attribute repo_slug: product-attribute repo_website: https://github.com/OCA/product-attribute +use_pyproject_toml: false +use_ruff: false diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 326c12556764..d369315ef7ec 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,8 +36,24 @@ jobs: matrix: include: - container: ghcr.io/oca/oca-ci/py3.6-odoo14.0:latest + include: "product_internal_reference_generator" name: test with Odoo - container: ghcr.io/oca/oca-ci/py3.6-ocb14.0:latest + include: "product_internal_reference_generator" + name: test with OCB + makepot: "true" + - container: ghcr.io/oca/oca-ci/py3.6-odoo14.0:latest + include: "product_sequence" + name: test with Odoo + - container: ghcr.io/oca/oca-ci/py3.6-ocb14.0:latest + include: "product_sequence" + name: test with OCB + makepot: "true" + - container: ghcr.io/oca/oca-ci/py3.6-odoo14.0:latest + exclude: "product_internal_reference_generator,product_sequence" + name: test with Odoo + - container: ghcr.io/oca/oca-ci/py3.6-ocb14.0:latest + exclude: "product_internal_reference_generator,product_sequence" name: test with OCB makepot: "true" services: @@ -49,6 +65,9 @@ jobs: POSTGRES_DB: odoo ports: - 5432:5432 + env: + INCLUDE: "${{ matrix.include }}" + EXCLUDE: "${{ matrix.exclude }}" steps: - uses: actions/checkout@v3 with: diff --git a/.gitignore b/.gitignore index 9c283fd41f6c..0090721f5d24 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ __pycache__/ *.py[cod] /.venv /.pytest_cache +/.ruff_cache # C extensions *.so diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d8c4b6847fd1..03cbeb100c10 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,4 @@ + exclude: | (?x) # NOT INSTALLABLE ADDONS @@ -14,6 +15,8 @@ exclude: | ^docs/_templates/.*\.html$| # Don't bother non-technical authors with formatting issues in docs readme/.*\.(rst|md)$| + # Ignore build and dist directories in addons + /build/|/dist/| # You don't usually want a bot to modify your legal texts (LICENSE.*|COPYING.*) default_language_version: @@ -35,7 +38,7 @@ repos: language: fail files: '[a-zA-Z0-9_]*/i18n/en\.po$' - repo: https://github.com/oca/maintainer-tools - rev: 969238e47c07d0c40573acff81d170f63245d738 + rev: f71041f22b8cd68cf7c77b73a14ca8d8cd190a60 hooks: # update the NOT INSTALLABLE ADDONS section above - id: oca-update-pre-commit-excluded-addons @@ -48,6 +51,7 @@ repos: - --org-name=OCA - --repo-name=product-attribute - --if-source-changed + - --keep-source-digest - repo: https://github.com/OCA/odoo-pre-commit-hooks rev: v0.0.25 hooks: diff --git a/README.md b/README.md index 7e85f5a1e112..1e9b807c2413 100644 --- a/README.md +++ b/README.md @@ -17,85 +17,7 @@ TODO: add repo description. [//]: # (addons) -Available addons ----------------- -addon | version | maintainers | summary ---- | --- | --- | --- -[base_product_mass_addition](base_product_mass_addition/) | 14.0.1.2.0 | | Base Product Mass Addition -[packaging_uom](packaging_uom/) | 14.0.1.0.1 | [![rousseldenis](https://github.com/rousseldenis.png?size=30px)](https://github.com/rousseldenis) | Use uom in package -[pos_product_cost_security](pos_product_cost_security/) | 14.0.1.0.1 | | Compatibility between Point of Sale and Product Cost Security -[product_assortment](product_assortment/) | 14.0.1.1.1 | | Adds the ability to manage products assortment -[product_assortment_description](product_assortment_description/) | 14.0.1.0.1 | | Description field for assortment -[product_attribute_archive](product_attribute_archive/) | 14.0.1.0.0 | | Add an active field on product attributes -[product_attribute_value_menu](product_attribute_value_menu/) | 14.0.2.0.2 | | Product attributes values tree and form. Import attribute values. -[product_barcode_required](product_barcode_required/) | 14.0.1.0.0 | [![simahawk](https://github.com/simahawk.png?size=30px)](https://github.com/simahawk) | Make product barcode required when enabled -[product_bom_revision](product_bom_revision/) | 14.0.1.0.1 | | Store the revision of a product and a BOM -[product_categ_image](product_categ_image/) | 14.0.1.0.0 | | Add image on product category -[product_category_active](product_category_active/) | 14.0.1.0.0 | | Add option to archive product categories -[product_category_code](product_category_code/) | 14.0.1.0.0 | [![rousseldenis](https://github.com/rousseldenis.png?size=30px)](https://github.com/rousseldenis) | Allows to define a code on product categories -[product_category_code_unique](product_category_code_unique/) | 14.0.1.0.0 | [![rousseldenis](https://github.com/rousseldenis.png?size=30px)](https://github.com/rousseldenis) | Allows to set product category code field as unique -[product_category_product_link](product_category_product_link/) | 14.0.1.0.1 | | Allows to get products from a category -[product_category_type](product_category_type/) | 14.0.1.0.1 | [![legalsylvain](https://github.com/legalsylvain.png?size=30px)](https://github.com/legalsylvain) | Add Type field on Product Categories to distinguish between parent and final categories -[product_code_mandatory](product_code_mandatory/) | 14.0.1.0.1 | | Set Product Internal Reference as a required field -[product_code_unique](product_code_unique/) | 14.0.1.0.0 | | Set Product Internal Reference as Unique -[product_cost_security](product_cost_security/) | 14.0.1.0.0 | [![sergio-teruel](https://github.com/sergio-teruel.png?size=30px)](https://github.com/sergio-teruel) | Product cost security restriction view -[product_custom_info](product_custom_info/) | 14.0.1.0.1 | | Add custom field in products -[product_dimension](product_dimension/) | 14.0.1.0.0 | | Product Dimension -[product_expiry_configurable](product_expiry_configurable/) | 14.0.1.0.0 | | This model allows setting expiry times on category and to use the 'end_of_life' date for the computation of lot dates -[product_form_pricelist](product_form_pricelist/) | 14.0.1.0.1 | | Show/edit pricelist in product form -[product_logistics_uom](product_logistics_uom/) | 14.0.1.0.2 | [![hparfr](https://github.com/hparfr.png?size=30px)](https://github.com/hparfr) | Configure product weights and volume UoM -[product_lot_sequence](product_lot_sequence/) | 14.0.1.0.2 | | Adds ability to define a lot sequence from the product -[product_main_supplierinfo](product_main_supplierinfo/) | 14.0.1.0.1 | [![sebalix](https://github.com/sebalix.png?size=30px)](https://github.com/sebalix) | Display the main vendor of a product. -[product_manufacturer](product_manufacturer/) | 14.0.1.0.2 | | Adds manufacturers and attributes on the product view. -[product_medical](product_medical/) | 14.0.1.0.1 | | Base structure to handle medical products -[product_model_viewer](product_model_viewer/) | 14.0.1.0.1 | [![eLBati](https://github.com/eLBati.png?size=30px)](https://github.com/eLBati) | 3D model viewer for products -[product_multi_category](product_multi_category/) | 14.0.1.0.0 | | Product - Many Categories -[product_multi_image](product_multi_image/) | 14.0.1.0.1 | | Multiple Images in Products -[product_net_weight](product_net_weight/) | 14.0.1.0.1 | [![legalsylvain](https://github.com/legalsylvain.png?size=30px)](https://github.com/legalsylvain) | Add 'Net Weight' on product models -[product_order_noname](product_order_noname/) | 14.0.2.0.0 | [![WR-96](https://github.com/WR-96.png?size=30px)](https://github.com/WR-96) [![moylop260](https://github.com/moylop260.png?size=30px)](https://github.com/moylop260) [![luisg123v](https://github.com/luisg123v.png?size=30px)](https://github.com/luisg123v) | Speedup product retrieve -[product_packaging_dimension](product_packaging_dimension/) | 14.0.1.0.2 | | Manage packaging dimensions and weight -[product_packaging_type](product_packaging_type/) | 14.0.0.2.0 | | Product Packaging Type -[product_packaging_type_pallet](product_packaging_type_pallet/) | 14.0.1.0.1 | | Manage packaging of pallet type -[product_packaging_type_required](product_packaging_type_required/) | 14.0.1.1.0 | [![simahawk](https://github.com/simahawk.png?size=30px)](https://github.com/simahawk) [![dcrier](https://github.com/dcrier.png?size=30px)](https://github.com/dcrier) | Product Packaging Type Required -[product_packaging_unit_price_calculator](product_packaging_unit_price_calculator/) | 14.0.1.1.1 | | Wizard to calculate a unit price from a packaging price -[product_pricelist_assortment](product_pricelist_assortment/) | 14.0.2.2.0 | | Product assortment and pricelist -[product_pricelist_button_box](product_pricelist_button_box/) | 14.0.1.0.1 | [![rousseldenis](https://github.com/rousseldenis.png?size=30px)](https://github.com/rousseldenis) | Allows to define a button_box section on pricelist form -[product_pricelist_direct_print](product_pricelist_direct_print/) | 14.0.2.0.0 | | Print price list from menu option, product templates, products variants or price lists -[product_pricelist_direct_print_company_group](product_pricelist_direct_print_company_group/) | 14.0.1.0.0 | | Print Pricelist items using the company group model -[product_pricelist_revision](product_pricelist_revision/) | 14.0.1.0.2 | | Product Pricelist Revision -[product_pricelist_supplierinfo](product_pricelist_supplierinfo/) | 14.0.1.1.1 | | Allows to create priceslists based on supplier info -[product_product_template_navigation](product_product_template_navigation/) | 14.0.1.0.1 | | Adds a button in product to view the template -[product_profile](product_profile/) | 14.0.1.0.1 | [![bealdav](https://github.com/bealdav.png?size=30px)](https://github.com/bealdav) [![sebastienbeau](https://github.com/sebastienbeau.png?size=30px)](https://github.com/sebastienbeau) [![kevinkhao](https://github.com/kevinkhao.png?size=30px)](https://github.com/kevinkhao) | Allow to configure a product in 1 click -[product_restricted_type](product_restricted_type/) | 14.0.1.0.1 | | Product Restricted Type -[product_sale_manufactured_for](product_sale_manufactured_for/) | 14.0.1.1.0 | | Allows to indicate in products that they were made specifically for some customers. -[product_seasonality](product_seasonality/) | 14.0.1.3.0 | | Define rules for products' seasonal availability -[product_secondary_unit](product_secondary_unit/) | 14.0.1.0.4 | [![sergio-teruel](https://github.com/sergio-teruel.png?size=30px)](https://github.com/sergio-teruel) | Set a secondary unit per product -[product_sequence](product_sequence/) | 14.0.2.0.1 | | Product Sequence -[product_state](product_state/) | 14.0.1.1.4 | [![emagdalenaC2i](https://github.com/emagdalenaC2i.png?size=30px)](https://github.com/emagdalenaC2i) | Module introducing a state field on product template -[product_state_active](product_state_active/) | 14.0.1.0.0 | [![rousseldenis](https://github.com/rousseldenis.png?size=30px)](https://github.com/rousseldenis) | Allows to define option on product state to activate or inactivate product -[product_state_history](product_state_history/) | 14.0.1.0.2 | [![rousseldenis](https://github.com/rousseldenis.png?size=30px)](https://github.com/rousseldenis) | Allows to store product state history for reporting purpose -[product_status](product_status/) | 14.0.1.0.2 | | Product Status Computed From Fields -[product_stock_state](product_stock_state/) | 14.0.1.0.1 | [![sebastienbeau](https://github.com/sebastienbeau.png?size=30px)](https://github.com/sebastienbeau) [![legalsylvain](https://github.com/legalsylvain.png?size=30px)](https://github.com/legalsylvain) [![kevinkhao](https://github.com/kevinkhao.png?size=30px)](https://github.com/kevinkhao) | Compute the state of a product's stockthe stock level and sale_ok field -[product_supplierinfo_archive](product_supplierinfo_archive/) | 14.0.1.1.0 | [![GuillemCForgeFlow](https://github.com/GuillemCForgeFlow.png?size=30px)](https://github.com/GuillemCForgeFlow) [![AlvaroTForgeFlow](https://github.com/AlvaroTForgeFlow.png?size=30px)](https://github.com/AlvaroTForgeFlow) [![OriolVForgeFlow](https://github.com/OriolVForgeFlow.png?size=30px)](https://github.com/OriolVForgeFlow) | Add the active field to the product supplier info -[product_supplierinfo_for_customer](product_supplierinfo_for_customer/) | 14.0.1.3.0 | | Allows to define prices for customers in the products -[product_supplierinfo_for_customer_group](product_supplierinfo_for_customer_group/) | 14.0.1.0.0 | | Fixes compatibility of product_supplierinfo_for_customer and product_supplierinfo_group -[product_supplierinfo_group](product_supplierinfo_group/) | 14.0.2.0.3 | | Product Supplierinfo Group -[product_supplierinfo_revision](product_supplierinfo_revision/) | 14.0.1.0.0 | | Product Supplierinfo Revision -[product_supplierinfo_stock_picking_type](product_supplierinfo_stock_picking_type/) | 14.0.1.0.0 | [![victoralmau](https://github.com/victoralmau.png?size=30px)](https://github.com/victoralmau) | Product supplierinfo stock picking type -[product_template_tags](product_template_tags/) | 14.0.1.2.0 | [![patrickrwilson](https://github.com/patrickrwilson.png?size=30px)](https://github.com/patrickrwilson) [![ivantodorovich](https://github.com/ivantodorovich.png?size=30px)](https://github.com/ivantodorovich) | This addon allow to add tags on products -[product_template_tags_code](product_template_tags_code/) | 14.0.1.0.1 | | This addon allow to add code on products tags -[product_tier_validation](product_tier_validation/) | 14.0.2.0.1 | [![dreispt](https://github.com/dreispt.png?size=30px)](https://github.com/dreispt) | Support a tier validation process for Products -[product_total_weight_from_packaging](product_total_weight_from_packaging/) | 14.0.1.1.1 | | Compute estimated weight based on product's packaging weights -[product_uom_updatable](product_uom_updatable/) | 14.0.1.0.1 | | allows products uom to be modified after be used in a stock picking if the product uom is of the same category -[product_variant_attribute_name_manager](product_variant_attribute_name_manager/) | 14.0.1.1.1 | [![JordiMForgeFlow](https://github.com/JordiMForgeFlow.png?size=30px)](https://github.com/JordiMForgeFlow) | Manage how to display the attributes on the product variant name. -[product_variant_company](product_variant_company/) | 14.0.1.0.0 | [![CetmixGitDrone](https://github.com/CetmixGitDrone.png?size=30px)](https://github.com/CetmixGitDrone) [![Volodiay622](https://github.com/Volodiay622.png?size=30px)](https://github.com/Volodiay622) | Product Company Storage -[product_video_link](product_video_link/) | 14.0.1.0.2 | | Link Video on product and category -[product_weight](product_weight/) | 14.0.1.0.1 | | Allows to calculate products weight from its components. -[product_weight_logistics_uom](product_weight_logistics_uom/) | 14.0.1.0.0 | [![hparfr](https://github.com/hparfr.png?size=30px)](https://github.com/hparfr) | Glue module for product_weight and product_logistics_uom -[purchase_product_template_tags](purchase_product_template_tags/) | 14.0.1.1.0 | [![ivantodorovich](https://github.com/ivantodorovich.png?size=30px)](https://github.com/ivantodorovich) | Show product tags menu in Purchase app -[sale_product_template_tags](sale_product_template_tags/) | 14.0.1.1.0 | [![ivantodorovich](https://github.com/ivantodorovich.png?size=30px)](https://github.com/ivantodorovich) | Show product tags menu in Sale app -[stock_product_template_tags](stock_product_template_tags/) | 14.0.1.1.0 | [![ivantodorovich](https://github.com/ivantodorovich.png?size=30px)](https://github.com/ivantodorovich) | Show product tags menu in Inventory app -[uom_extra_data](uom_extra_data/) | 14.0.1.0.1 | | Have mm, ml, week, work_week uom +This part will be replaced when running the oca-gen-addons-table script from OCA/maintainer-tools. [//]: # (end addons) diff --git a/product_internal_reference_generator/README.rst b/product_internal_reference_generator/README.rst index 01c5bf1374bf..83ec7cae0c21 100644 --- a/product_internal_reference_generator/README.rst +++ b/product_internal_reference_generator/README.rst @@ -7,7 +7,7 @@ Product Internal Reference Generator !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:3044a39b233283158fdc8a459f7951b1e03a2eb8626bf7ef85fb11d5c1266b8e + !! source digest: sha256:849bfe7f33fcb6733eee66fdd4edaf6fb631b114679a127ca33cf8c3049a4828 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/product_internal_reference_generator/__manifest__.py b/product_internal_reference_generator/__manifest__.py index 6c0f91ad6027..3ebbb51e3198 100644 --- a/product_internal_reference_generator/__manifest__.py +++ b/product_internal_reference_generator/__manifest__.py @@ -8,6 +8,7 @@ "category": "Sale", "version": "14.0.1.0.0", "depends": ["stock", "base_view_inheritance_extension"], + "excludes": ["product_sequence"], "data": [ "security/groups.xml", "security/ir.model.access.csv", diff --git a/product_internal_reference_generator/static/description/index.html b/product_internal_reference_generator/static/description/index.html index 9a6fc361b187..3e5839001b30 100644 --- a/product_internal_reference_generator/static/description/index.html +++ b/product_internal_reference_generator/static/description/index.html @@ -367,7 +367,7 @@

Product Internal Reference Generator

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:3044a39b233283158fdc8a459f7951b1e03a2eb8626bf7ef85fb11d5c1266b8e +!! source digest: sha256:849bfe7f33fcb6733eee66fdd4edaf6fb631b114679a127ca33cf8c3049a4828 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Beta License: AGPL-3 OCA/product-attribute Translate me on Weblate Try me on Runboat

This module allows to generate internal references for Product templates and variants using sequences, setting codes as read-only.

diff --git a/product_internal_reference_generator/tests/test_product_internal_reference_generator.py b/product_internal_reference_generator/tests/test_product_internal_reference_generator.py index eadefa7e3195..f07f5716f9bf 100644 --- a/product_internal_reference_generator/tests/test_product_internal_reference_generator.py +++ b/product_internal_reference_generator/tests/test_product_internal_reference_generator.py @@ -1,5 +1,6 @@ # Copyright 2023 Ooops - Ilyas # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + from odoo.tests import Form, SavepointCase @@ -42,8 +43,8 @@ def test_all(self): line.value_ids.add(self.val1) line.value_ids.add(self.val2) pt_car.save() - self.pt_car.btn_generate_sequence() # default_code must be generated for multiple variants + self.pt_car.btn_generate_sequence() self._check_default_code("001", 0, self.pt_car) self._check_default_code("002", 1, self.pt_car)