Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
53e32cf
[ADD] website_sale_stock_available: new module
Apr 22, 2020
2a466bd
[FIX] website_sale_stock_available: Check proper flag for returning q…
pedrobaeza May 6, 2020
f0af85e
[FIX] website_sale_stock_available: immediately_usable_qty in_cart_up…
May 12, 2020
202b5ad
[IMP] website_sale_stock_available: Improve readme
May 15, 2020
34ac02d
[FIX] website_sale_stock_available: prevent payment blocking
chienandalu Dec 10, 2020
9ceb25d
[MIG] website_sale_stock_available: Migration to 14.0
ivantodorovich Feb 3, 2021
b95c852
[IMP] pre-commit run
ivantodorovich Feb 3, 2021
f23ebcd
[UPD] Update website_sale_stock_available.pot
oca-travis Apr 6, 2021
772425c
Added translation using Weblate (Spanish (Argentina))
ibuioli Sep 11, 2021
cded2fe
[MIG] website_sale_stock_available: Migration to 15.0
chienandalu Dec 20, 2022
3a66aeb
Update translation files
weblate Feb 7, 2023
2c37f59
[MIG] website_sale_stock_available: Migration to 16.0
bvanjeelharia Feb 23, 2023
6d27de1
Update translation files
weblate Feb 24, 2023
ee75e16
Translated using Weblate (Spanish (Argentina))
ibuioli Mar 12, 2023
7229010
Translated using Weblate (Spanish)
Ivorra78 Aug 3, 2023
f78d4e2
[FIX] website_sale_stock_available: depends_context
danielduqma Feb 29, 2024
74d97ef
[FIX] website_sale_stock_available: respect args
danielduqma Mar 6, 2024
8239426
Added translation using Weblate (Italian)
mymage May 8, 2024
6c1360b
Translated using Weblate (French)
remi-filament Aug 5, 2024
477c0ea
[IMP] website_sale_stock_available: pre-commit auto fixes
carlos-lopez-tecnativa Feb 20, 2025
0aa5d1a
[MIG] website_sale_stock_available: Migration to version 17.0
carlos-lopez-tecnativa Feb 20, 2025
aefc660
[MIG] website_sale_stock_available: Migration to version 18.0
carlos-lopez-tecnativa Aug 6, 2025
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
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:1466d69a1e2c40adc4684708bb2ff48b1be5525fd4e80230e935e8da4c717232
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/18.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-18-0/e-commerce-18-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=18.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/18.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:%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>`__:

- 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/18.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": "18.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.payment 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)
29 changes: 29 additions & 0 deletions website_sale_stock_available/i18n/ca_ES.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_sale_stock_available
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.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_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 ""
32 changes: 32 additions & 0 deletions website_sale_stock_available/i18n/es.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 18.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-08-03 20:09+0000\n"
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\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"
32 changes: 32 additions & 0 deletions website_sale_stock_available/i18n/es_AR.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 18.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-03-12 22:23+0000\n"
"Last-Translator: Ignacio Buioli <ibuioli@gmail.com>\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"
32 changes: 32 additions & 0 deletions website_sale_stock_available/i18n/es_CL.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 18.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2020-05-30 05:19+0000\n"
"Last-Translator: Nelson Ramírez Sánchez <info@konos.cl>\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 ""
32 changes: 32 additions & 0 deletions website_sale_stock_available/i18n/fr.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 18.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-08-05 17:58+0000\n"
"Last-Translator: Rémi <remi@le-filament.com>\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"
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 18.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-05-08 16:34+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 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"
32 changes: 32 additions & 0 deletions website_sale_stock_available/i18n/nl.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 18.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2020-12-15 13:19+0000\n"
"Last-Translator: Bosd <c5e2fd43-d292-4c90-9d1f-74ff3436329a@anonaddy.me>\n"
"Language-Team: none\n"
"Language: nl\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 "Product"

#. 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 ""
Loading