-
-
Notifications
You must be signed in to change notification settings - Fork 148
[18.0][MIG] website_sale_product_pack: Migration to 18.0 #194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ALopez-Adhoc
wants to merge
31
commits into
OCA:18.0
Choose a base branch
from
adhoc-dev:18.0-mig-website_sale_product_pack
base: 18.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,329
−0
Open
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
c6c167b
[ADD] website_sale_product_pack: New module
chienandalu 208ecf5
[FIX] stock_product_pack: get already computed values if existing
chienandalu 89548e9
[UPD] Update website_sale_product_pack.pot
oca-travis e787431
[UPD] README.rst
OCA-git-bot c52e10c
[ADD] icon.png
OCA-git-bot b0b6e1f
[FIX] website_sale_product_pack: Resilient tests
pedrobaeza 2b83334
Set portal user pricelist
chienandalu cec7a49
[FIX] website_sale_product_pack: detailed totalized packs
chienandalu 293f123
website_sale_product_pack 13.0.1.0.1
OCA-git-bot f973f42
website_sale_product_pack 13.0.1.0.2
OCA-git-bot 1015dc5
[IMP] website_sale_product_pack: Published and unpublished for produc…
OCA-git-bot 26e9011
[UPD] Update website_sale_product_pack.pot
3662963
[UPD] README.rst
OCA-git-bot 6b942e5
[16.0][MIG] website_sale_product_pack: Migration to 16.0
alvaro-domatix edd4635
[FIX] website_sale_product_pack: Fixed KeyError: 'product_id' error d…
lef-adhoc 418d023
[UPD] Update website_sale_product_pack.pot
8a4bb6b
[BOT] post-merge updates
OCA-git-bot 1ce5941
Added translation using Weblate (Italian)
mymage d622deb
Translated using Weblate (Italian)
mymage 89c5483
[IMP] website_sale_product_pack: pre-commit execution
augusto-weiss a48bf58
[MIG] website_sale_product_pack: Migration to 17.0
augusto-weiss d33a0f7
[UPD] Update website_sale_product_pack.pot
de2d2db
[BOT] post-merge updates
OCA-git-bot 7d7b18a
Update translation files
weblate bf195f2
Translated using Weblate (Italian)
mymage 3551c39
[FIX] website_product_pack: detailed displayed components price on we…
augusto-weiss e6d6379
[BOT] post-merge updates
OCA-git-bot a271fd4
[17.0][FIX] website_sale_product_pack: add decorator to remove warnings
Abranes 23f8b2e
[BOT] post-merge updates
OCA-git-bot 6a7fef3
[IMP] website_sale_product_pack: pre-commit execution
ALopez-Adhoc 12b5cc0
[MIG] website_sale_product_pack: Migration to 18.0
ALopez-Adhoc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| ========================= | ||
| Website Sale Product Pack | ||
| ========================= | ||
|
|
||
| .. | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| !! This file is generated by oca-gen-addon-readme !! | ||
| !! changes will be overwritten. !! | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
| !! source digest: sha256:b253d0a32950c83c03fbde45ce4e7b7335fc773f15534306c65a0ec5344121b8 | ||
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
|
||
| .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png | ||
| :target: https://odoo-community.org/page/development-status | ||
| :alt: Beta | ||
| .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png | ||
| :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
| :alt: License: AGPL-3 | ||
| .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproduct--pack-lightgray.png?logo=github | ||
| :target: https://github.com/OCA/product-pack/tree/18.0/website_sale_product_pack | ||
| :alt: OCA/product-pack | ||
| .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
| :target: https://translation.odoo-community.org/projects/product-pack-18-0/product-pack-18-0-website_sale_product_pack | ||
| :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/product-pack&target_branch=18.0 | ||
| :alt: Try me on Runboat | ||
|
|
||
| |badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
|
||
| This module introduces compatibility of product packs with e-commerce: | ||
|
|
||
| - In the cart summary, the components aren't editable and are shown | ||
| hanging from the main pack reference. | ||
| - When we remove a pack from the cart, their components are removed as | ||
| well. | ||
| - The cart popup summary only shows the main pack line and discards the | ||
| sublines in the units count. | ||
| - The cart summary shows the component lines hanging from the main one | ||
| as well. | ||
| - It's ensured the the prices are shown correctly for the whole pack and | ||
| that they're correctly summarized depending on the pack type. | ||
|
|
||
| **Table of contents** | ||
|
|
||
| .. contents:: | ||
| :local: | ||
|
|
||
| Usage | ||
| ===== | ||
|
|
||
| There are several demo packs to test the module. Publish them and add | ||
| them to the cart from the frontend. You should have the same quotation | ||
| as if you do it in the backend. | ||
|
|
||
| Known issues / Roadmap | ||
| ====================== | ||
|
|
||
| - Improve pack cart display. | ||
| - When we have subpacks (a pack inside a pack) we should improve | ||
| visually how it's shown in the cart. | ||
|
|
||
| Bug Tracker | ||
| =========== | ||
|
|
||
| Bugs are tracked on `GitHub Issues <https://github.com/OCA/product-pack/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 <https://github.com/OCA/product-pack/issues/new?body=module:%20website_sale_product_pack%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
|
||
| Do not contact contributors directly about support or help with technical issues. | ||
|
|
||
| Credits | ||
| ======= | ||
|
|
||
| Authors | ||
| ------- | ||
|
|
||
| * Tecnativa | ||
|
|
||
| Contributors | ||
| ------------ | ||
|
|
||
| - `Tecnativa <https://www.tecnativa.com>`__: | ||
|
|
||
| - David Vidal | ||
|
|
||
| - `ADHOC SA <https://www.adhoc.com.ar>`__: | ||
|
|
||
| - Nicolas Mac Rouillon | ||
|
|
||
| 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. | ||
|
|
||
| This module is part of the `OCA/product-pack <https://github.com/OCA/product-pack/tree/18.0/website_sale_product_pack>`_ project on GitHub. | ||
|
|
||
| You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| from . import models |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Copyright 2021 Tecnativa - David Vidal | ||
| # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
| { | ||
| "name": "Website Sale Product Pack", | ||
| "category": "E-Commerce", | ||
| "summary": "Compatibility module of product pack with e-commerce", | ||
| "version": "18.0.1.0.0", | ||
| "license": "AGPL-3", | ||
| "depends": ["website_sale", "sale_product_pack"], | ||
| "data": ["views/templates.xml"], | ||
| "assets": { | ||
| "web.assets_tests": [ | ||
| "website_sale_product_pack/static/tests/tours/website_sale_product_pack_tour.esm.js", | ||
| ], | ||
| }, | ||
| "author": "Tecnativa, Odoo Community Association (OCA)", | ||
| "website": "https://github.com/OCA/product-pack", | ||
| "installable": True, | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| # Translation of Odoo Server. | ||
| # This file contains the translation of the following modules: | ||
| # * website_sale_product_pack | ||
| # | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Odoo Server 16.0\n" | ||
| "Report-Msgid-Bugs-To: \n" | ||
| "PO-Revision-Date: 2024-10-09 09:06+0000\n" | ||
| "Last-Translator: mymage <stefano.consolaro@mymage.it>\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" | ||
| "X-Generator: Weblate 5.6.2\n" | ||
|
|
||
| #. module: website_sale_product_pack | ||
| #: model_terms:ir.ui.view,arch_db:website_sale_product_pack.cart_lines | ||
| #: model_terms:ir.ui.view,arch_db:website_sale_product_pack.checkout_layout | ||
| msgid "<span>↳ </span>" | ||
| msgstr "<span>↳ </span>" | ||
|
|
||
| #. module: website_sale_product_pack | ||
| #: model:ir.model,name:website_sale_product_pack.model_product_template | ||
| msgid "Product" | ||
| msgstr "Prodotto" | ||
|
|
||
| #. module: website_sale_product_pack | ||
| #: model:ir.model,name:website_sale_product_pack.model_product_product | ||
| msgid "Product Variant" | ||
| msgstr "Variante prodotto" | ||
|
|
||
| #. module: website_sale_product_pack | ||
| #: model:ir.model,name:website_sale_product_pack.model_sale_order | ||
| msgid "Sales Order" | ||
| msgstr "Ordine di vendita" | ||
|
|
||
| #. module: website_sale_product_pack | ||
| #: model:ir.model,name:website_sale_product_pack.model_sale_order_line | ||
| msgid "Sales Order Line" | ||
| msgstr "Riga ordine di vendita" | ||
|
|
||
| #. module: website_sale_product_pack | ||
| #: model:ir.model,name:website_sale_product_pack.model_website | ||
| msgid "Website" | ||
| msgstr "Sito web" | ||
|
|
||
| #. module: website_sale_product_pack | ||
| #. odoo-python | ||
| #: code:addons/website_sale_product_pack/models/product_product.py:0 | ||
| #, python-format | ||
| msgid "" | ||
| "You can't add unpublished products (%(unpublished_products)s)to a published " | ||
| "pack (%(pack_name)s)" | ||
| msgstr "" | ||
| "Non si possono aggiungere prodotti non pubblicati (%(unpublished_products)s) " | ||
| "ad un pacco pubblicato (%(pack_name)s)" | ||
|
|
||
| #. module: website_sale_product_pack | ||
| #. odoo-python | ||
| #: code:addons/website_sale_product_pack/models/product_template.py:0 | ||
| #, python-format | ||
| msgid "" | ||
| "You can't unpublished product (%(product_name)s) for apublished pack parents " | ||
| "(%(pack_parents)s)" | ||
| msgstr "" | ||
| "Non si può non pubblicare un prodotto (%(product_name)s) per un collo padre " | ||
| "pubblicato (%(pack_parents)s)" | ||
|
|
||
| #. module: website_sale_product_pack | ||
| #. odoo-python | ||
| #: code:addons/website_sale_product_pack/models/product_template.py:0 | ||
| #, python-format | ||
| msgid "" | ||
| "You can't unpublished products (%(unpublished_products)s) to apublished pack " | ||
| "(%(pack_name)s)" | ||
| msgstr "" | ||
| "Non si può non pubblicare un prodotto (%(unpublished_products)s) di un collo " | ||
| "pubblicato (%(pack_name)s)" | ||
|
|
||
| #, python-format | ||
| #~ msgid "" | ||
| #~ "You can't add unpublished products (%(unpublished_products)s) toa " | ||
| #~ "published pack (%(pack_name)s)" | ||
| #~ msgstr "" | ||
| #~ "Non si possono aggiungere prodotti non pubblicati " | ||
| #~ "(%(unpublished_products)s) ad un collo pubblicato (%(pack_name)s)" |
72 changes: 72 additions & 0 deletions
72
website_sale_product_pack/i18n/website_sale_product_pack.pot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| # Translation of Odoo Server. | ||
| # This file contains the translation of the following modules: | ||
| # * website_sale_product_pack | ||
| # | ||
| msgid "" | ||
| msgstr "" | ||
| "Project-Id-Version: Odoo Server 17.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" | ||
|
|
||
| #. module: website_sale_product_pack | ||
| #: model_terms:ir.ui.view,arch_db:website_sale_product_pack.cart_lines | ||
| #: model_terms:ir.ui.view,arch_db:website_sale_product_pack.checkout_layout | ||
| msgid "<span>↳ </span>" | ||
| msgstr "" | ||
|
|
||
| #. module: website_sale_product_pack | ||
| #: model:ir.model,name:website_sale_product_pack.model_product_template | ||
| msgid "Product" | ||
| msgstr "" | ||
|
|
||
| #. module: website_sale_product_pack | ||
| #: model:ir.model,name:website_sale_product_pack.model_product_product | ||
| msgid "Product Variant" | ||
| msgstr "" | ||
|
|
||
| #. module: website_sale_product_pack | ||
| #: model:ir.model,name:website_sale_product_pack.model_sale_order | ||
| msgid "Sales Order" | ||
| msgstr "" | ||
|
|
||
| #. module: website_sale_product_pack | ||
| #: model:ir.model,name:website_sale_product_pack.model_sale_order_line | ||
| msgid "Sales Order Line" | ||
| msgstr "" | ||
|
|
||
| #. module: website_sale_product_pack | ||
| #: model:ir.model,name:website_sale_product_pack.model_website | ||
| msgid "Website" | ||
| msgstr "" | ||
|
|
||
| #. module: website_sale_product_pack | ||
| #. odoo-python | ||
| #: code:addons/website_sale_product_pack/models/product_product.py:0 | ||
| #, python-format | ||
| msgid "" | ||
| "You can't add unpublished products (%(unpublished_products)s)to a published " | ||
| "pack (%(pack_name)s)" | ||
| msgstr "" | ||
|
|
||
| #. module: website_sale_product_pack | ||
| #. odoo-python | ||
| #: code:addons/website_sale_product_pack/models/product_template.py:0 | ||
| #, python-format | ||
| msgid "" | ||
| "You can't unpublished product (%(product_name)s) for apublished pack parents" | ||
| " (%(pack_parents)s)" | ||
| msgstr "" | ||
|
|
||
| #. module: website_sale_product_pack | ||
| #. odoo-python | ||
| #: code:addons/website_sale_product_pack/models/product_template.py:0 | ||
| #, python-format | ||
| msgid "" | ||
| "You can't unpublished products (%(unpublished_products)s) to apublished pack" | ||
| " (%(pack_name)s)" | ||
| msgstr "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| from . import sale_order | ||
| from . import product_product | ||
| from . import product_template |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # Copyright 2019 Tecnativa - Ernesto Tejeda | ||
| # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
|
||
| from odoo import _, api, models | ||
| from odoo.exceptions import ValidationError | ||
|
|
||
|
|
||
| class ProductProduct(models.Model): | ||
| _inherit = "product.product" | ||
|
|
||
| @api.constrains("pack_line_ids") | ||
| def check_website_published(self): | ||
| for rec in self.filtered("is_published"): | ||
| unpublished = rec.pack_line_ids.mapped("product_id").filtered( | ||
| lambda x: not x.is_published | ||
| ) | ||
| if unpublished: | ||
| raise ValidationError( | ||
| _( | ||
| "You can't add unpublished products " | ||
| "(%(unpublished_products)s)" | ||
| "to a published pack (%(pack_name)s)" | ||
| ) | ||
| % { | ||
| "unpublished_products": ", ".join(unpublished.mapped("name")), | ||
| "pack_name": rec.name, | ||
| } | ||
| ) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing space between 'products' and the opening parenthesis