Skip to content

Commit

Permalink
Merge PR #1025 into 17.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Mar 6, 2025
2 parents 947095b + ce5e6d8 commit 5df7829
Show file tree
Hide file tree
Showing 27 changed files with 1,122 additions and 0 deletions.
123 changes: 123 additions & 0 deletions website_sale_stock_available/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
============================
Website Sale Stock Available
============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:b0e268e3498507348a1fe49792941c94cf93facf16b3544ed7d902121af4efb3
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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%2Fe--commerce-lightgray.png?logo=github
:target: https://github.com/OCA/e-commerce/tree/17.0/website_sale_stock_available
: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-17-0/e-commerce-17-0-website_sale_stock_available
: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=17.0
:alt: Try me on Runboat

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

This module extends the functionality of the *Product Availability*
module (technical name: ``website_sale_stock``) so that for the
eCommerce the *Available* quantity of a product is taken into account
instead of the *free* quantity.

Note that in the past the eCommerce availability was based in
*Forecasted quantity*. This isn't true anymore from version 15.0.

If a product is configured to *prevent sales if not enough stock* (see
configuration section) and its page is accessed in the Website Shop, the
availability messages will be based on the *Available* quantity instead
of *Free* quantity. And also, the eCommerce won't allow you to buy more
products than *Available* quantity (not *Free* quantity isn't taken into
account).

**Table of contents**

.. contents::
:local:

Configuration
=============

To configure this module, you need to:

1. Go to *Inventory > Products > Products* and edit a product that you
only want to sell in the eCommerce if there is enough stock.
2. Navigate to *Out-of-stock (continue selling)* field in the *Sales*
tab and unset it.

Usage
=====

To use this module, you need to:

1. Go to your eCommerce.
2. Select a product that you has been previously configured to *prevent
sales if not enough stock* for the web product page.
3. Odoo doesn't allow you to add the product to the cart if *Available*
quantity (not *Free to use* quantity) is equal or less than zero.
Besides, availability messages will be based on the *Available*
quantity instead of the *Free to use* quantity.

|Availability message|

.. |Availability message| image:: https://raw.githubusercontent.com/OCA/e-commerce/17.0/website_sale_stock_available/static/description/availability_message.png

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_stock_available%0Aversion:%2017.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>`__:

- Ernesto Tejeda
- Pedro M. Baeza
- David Vidal
- Carlos Lopez

- Iván Todorovich

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/17.0/website_sale_stock_available>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions website_sale_stock_available/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from . import controllers
from . import models
18 changes: 18 additions & 0 deletions website_sale_stock_available/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2020 Tecnativa - Ernesto Tejeda
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Website Sale Stock Available",
"summary": "Display 'Available to promise' in shop online instead "
"of 'Free To Use Quantity'",
"version": "17.0.1.0.0",
"category": "Website",
"website": "https://github.com/OCA/e-commerce",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"depends": [
"stock_available",
"website_sale_stock",
],
"data": [],
"installable": True,
}
1 change: 1 addition & 0 deletions website_sale_stock_available/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import main
15 changes: 15 additions & 0 deletions website_sale_stock_available/controllers/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2020 Tecnativa - David Vidal
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.http import request, route

from odoo.addons.website_sale.controllers.main import PaymentPortal


class PaymentPortal(PaymentPortal):
@route()
def shop_payment_transaction(self, *args, **kwargs):
"""Inject a context when potential or promised stock is set"""
request.website = request.website.with_context(
website_sale_stock_available=True
)
return super().shop_payment_transaction(*args, **kwargs)
38 changes: 38 additions & 0 deletions website_sale_stock_available/i18n/ca.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_sale_stock_available
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2021-01-20 20:45+0000\n"
"Last-Translator: claudiagn <[email protected]>\n"
"Language-Team: none\n"
"Language: ca\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 4.3.2\n"

#. module: website_sale_stock_available
#: model:ir.model,name:website_sale_stock_available.model_product_template
msgid "Product"
msgstr "Producte"

#. module: website_sale_stock_available
#: model:ir.model,name:website_sale_stock_available.model_product_product
msgid "Product Variant"
msgstr ""

#. module: website_sale_stock_available
#: model:ir.model,name:website_sale_stock_available.model_sale_order
msgid "Sales Order"
msgstr ""

#~ msgid "Product Template"
#~ msgstr "Plantilla de producte"

#~ msgid "Sale Order"
#~ msgstr "Comanda de venda"
38 changes: 38 additions & 0 deletions website_sale_stock_available/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_sale_stock_available
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-08-03 20:09+0000\n"
"Last-Translator: Ivorra78 <[email protected]>\n"
"Language-Team: none\n"
"Language: es\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 4.17\n"

#. module: website_sale_stock_available
#: model:ir.model,name:website_sale_stock_available.model_product_template
msgid "Product"
msgstr "Producto"

#. module: website_sale_stock_available
#: model:ir.model,name:website_sale_stock_available.model_product_product
msgid "Product Variant"
msgstr "Variante de Producto"

#. module: website_sale_stock_available
#: model:ir.model,name:website_sale_stock_available.model_sale_order
msgid "Sales Order"
msgstr "Órdenes de venta"

#~ msgid "Product Template"
#~ msgstr "Plantilla de producto"

#~ msgid "Sale Order"
#~ msgstr "Pedido de venta"
44 changes: 44 additions & 0 deletions website_sale_stock_available/i18n/es_AR.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_sale_stock_available
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-03-12 22:23+0000\n"
"Last-Translator: Ignacio Buioli <[email protected]>\n"
"Language-Team: none\n"
"Language: es_AR\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 4.14.1\n"

#. module: website_sale_stock_available
#: model:ir.model,name:website_sale_stock_available.model_product_template
msgid "Product"
msgstr "Producto"

#. module: website_sale_stock_available
#: model:ir.model,name:website_sale_stock_available.model_product_product
msgid "Product Variant"
msgstr "Variante de Producto"

#. module: website_sale_stock_available
#: model:ir.model,name:website_sale_stock_available.model_sale_order
msgid "Sales Order"
msgstr "Pedidos de Ventas"

#~ msgid "Product Template"
#~ msgstr "Plantilla de Producto"

#~ msgid "Display Name"
#~ msgstr "Mostrar Nombre"

#~ msgid "ID"
#~ msgstr "ID"

#~ msgid "Last Modified on"
#~ msgstr "Última modificación en"
38 changes: 38 additions & 0 deletions website_sale_stock_available/i18n/es_CL.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_sale_stock_available
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2020-05-30 05:19+0000\n"
"Last-Translator: Nelson Ramírez Sánchez <[email protected]>\n"
"Language-Team: none\n"
"Language: es_CL\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 3.10\n"

#. module: website_sale_stock_available
#: model:ir.model,name:website_sale_stock_available.model_product_template
msgid "Product"
msgstr "Producto"

#. module: website_sale_stock_available
#: model:ir.model,name:website_sale_stock_available.model_product_product
msgid "Product Variant"
msgstr ""

#. module: website_sale_stock_available
#: model:ir.model,name:website_sale_stock_available.model_sale_order
msgid "Sales Order"
msgstr ""

#~ msgid "Product Template"
#~ msgstr "Plantilla de Producto"

#~ msgid "Sale Order"
#~ msgstr "Nota de Venta"
38 changes: 38 additions & 0 deletions website_sale_stock_available/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_sale_stock_available
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-08-05 17:58+0000\n"
"Last-Translator: Rémi <[email protected]>\n"
"Language-Team: none\n"
"Language: fr\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_stock_available
#: model:ir.model,name:website_sale_stock_available.model_product_template
msgid "Product"
msgstr "Produit"

#. module: website_sale_stock_available
#: model:ir.model,name:website_sale_stock_available.model_product_product
msgid "Product Variant"
msgstr "Variante de produit"

#. module: website_sale_stock_available
#: model:ir.model,name:website_sale_stock_available.model_sale_order
msgid "Sales Order"
msgstr "Bon de commande"

#~ msgid "Product Template"
#~ msgstr "Modèle d'article"

#~ msgid "Sale Order"
#~ msgstr "Commande client"
32 changes: 32 additions & 0 deletions website_sale_stock_available/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_sale_stock_available
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-05-08 16:34+0000\n"
"Last-Translator: mymage <[email protected]>\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 4.17\n"

#. module: website_sale_stock_available
#: model:ir.model,name:website_sale_stock_available.model_product_template
msgid "Product"
msgstr "Prodotto"

#. module: website_sale_stock_available
#: model:ir.model,name:website_sale_stock_available.model_product_product
msgid "Product Variant"
msgstr "Variante prodotto"

#. module: website_sale_stock_available
#: model:ir.model,name:website_sale_stock_available.model_sale_order
msgid "Sales Order"
msgstr "Ordine di vendita"
Loading

0 comments on commit 5df7829

Please sign in to comment.