Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
odoo-addon-product_pricelist_item_uom_standard @ git+https://github.com/OCA/product-attribute.git@refs/pull/2364/head#subdirectory=product_pricelist_item_uom_standard
109 changes: 109 additions & 0 deletions website_sale_product_pricelist_item_uom/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=======================================
Website Sale Product Pricelist Item UoM
=======================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:17cd15ceeda4fffd614f9479d673ed5ef8c19cefaaf2ac97f8b96709e9dc2c2f
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/license-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%2Fe--commerce-lightgray.png?logo=github
:target: https://github.com/OCA/e-commerce/tree/19.0/website_sale_product_pricelist_item_uom
:alt: OCA/e-commerce
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/e-commerce-19-0/e-commerce-19-0-website_sale_product_pricelist_item_uom
: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/e-commerce&target_branch=19.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module is a backport of the standard implementation Odoo introduces
in version 19.3, see
`odoo/odoo@d2648b1 <https://github.com/odoo/odoo/commit/d2648b1d983927b5df7260a16d6d1d33c213ddeb#diff-5a563f36ffd028b0d8510c6d1339b097a5067a2247cc35c0f9bdd1fd0b5a0b0>`__.

This module shows the price of each packaging on the eCommerce product
page.

When a product is sold in several packagings, hovering a packaging
button displays the price of that packaging for the quantity currently
selected, so that customers can compare packagings without switching
between them.

It is the eCommerce counterpart of
``product_pricelist_item_uom_standard``, which allows a pricelist rule
to be restricted to a specific packaging, and is installed automatically
when both that module and ``website_sale`` are installed.

**Table of contents**

.. contents::
:local:

Usage
=====

1. Configure the packagings of a product and a pricelist rule per
packaging, as described in ``product_pricelist_item_uom_standard``.
2. Publish the product on the website.
3. Open the product page on the eCommerce: the packaging buttons are
displayed under the *Packaging* title.
4. Hover a packaging button: the price of that packaging for the
selected quantity is displayed next to the title, and disappears when
the pointer leaves the button.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/e-commerce/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/e-commerce/issues/new?body=module:%20website_sale_product_pricelist_item_uom%0Aversion:%2019.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
-------

* Camptocamp SA

Contributors
------------

- `Camptocamp <https://www.camptocamp.com>`__:

- Ricardo Almeida Soares <ricardo.almeidasoares@camptocamp.com>

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/e-commerce <https://github.com/OCA/e-commerce/tree/19.0/website_sale_product_pricelist_item_uom>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions website_sale_product_pricelist_item_uom/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
26 changes: 26 additions & 0 deletions website_sale_product_pricelist_item_uom/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright 2026 Camptocamp SA (https://www.camptocamp.com).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Website Sale Product Pricelist Item UoM",
"summary": "Show the price of each packaging on the eCommerce product page",
"version": "19.0.1.0.0",
"development_status": "Beta",
"category": "Website/Website",
"author": "Camptocamp SA, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/e-commerce",
"license": "AGPL-3",
"depends": [
"website_sale",
"product_pricelist_item_uom_standard",
],
"data": [
"views/variant_templates.xml",
],
"assets": {
"web.assets_frontend": [
"website_sale_product_pricelist_item_uom/static/src/js/interactions/**/*",
],
},
"installable": True,
"auto_install": True,
}
1 change: 1 addition & 0 deletions website_sale_product_pricelist_item_uom/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import product_template
37 changes: 37 additions & 0 deletions website_sale_product_pricelist_item_uom/models/product_template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright 2026 Camptocamp SA (https://www.camptocamp.com).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import models
from odoo.http import request


class ProductTemplate(models.Model):
_inherit = "product.template"

def _get_additionnal_combination_info(
self, product_or_template, quantity, uom, date, website
):
combination_info = super()._get_additionnal_combination_info(
product_or_template, quantity, uom, date, website
)
template = (
product_or_template
if product_or_template._name == "product.template"
else product_or_template.product_tmpl_id
)
if not template._has_multiple_uoms():
return combination_info
pricelist = request.pricelist.with_context(**self.env.context)
combination_info["packaging_prices"] = {}
for product_uom in template._get_available_uoms():
# Unit price expressed in the packaging UoM...
uom_price = pricelist._get_product_price(
product=product_or_template, quantity=quantity, uom=product_uom
)
# ...converted back to the product base UoM, as displayed prices are.
combination_info["packaging_prices"][product_uom.id] = (
product_uom._compute_price(
price=uom_price, to_unit=product_or_template.uom_id
)
)
return combination_info
3 changes: 3 additions & 0 deletions website_sale_product_pricelist_item_uom/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- [Camptocamp](https://www.camptocamp.com):
- Ricardo Almeida Soares \<<ricardo.almeidasoares@camptocamp.com>\>
13 changes: 13 additions & 0 deletions website_sale_product_pricelist_item_uom/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
This module is a backport of the standard implementation Odoo introduces in
version 19.3, see
[odoo/odoo@d2648b1](https://github.com/odoo/odoo/commit/d2648b1d983927b5df7260a16d6d1d33c213ddeb#diff-5a563f36ffd028b0d8510c6d1339b097a5067a2247cc35c0f9bdd1fd0b5a0b0).

This module shows the price of each packaging on the eCommerce product page.

When a product is sold in several packagings, hovering a packaging button
displays the price of that packaging for the quantity currently selected,
so that customers can compare packagings without switching between them.

It is the eCommerce counterpart of `product_pricelist_item_uom_standard`, which
allows a pricelist rule to be restricted to a specific packaging, and is
installed automatically when both that module and `website_sale` are installed.
8 changes: 8 additions & 0 deletions website_sale_product_pricelist_item_uom/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
1. Configure the packagings of a product and a pricelist rule per packaging,
as described in `product_pricelist_item_uom_standard`.
2. Publish the product on the website.
3. Open the product page on the eCommerce: the packaging buttons are displayed
under the *Packaging* title.
4. Hover a packaging button: the price of that packaging for the selected
quantity is displayed next to the title, and disappears when the pointer
leaves the button.
Loading
Loading