Skip to content
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

[17.0][MIG] website_sale_stock_available: Migration to version 17.0 #1025

Open
wants to merge 21 commits into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
a34e735
[ADD] website_sale_stock_available: new module
Apr 22, 2020
f8955a5
[FIX] website_sale_stock_available: Check proper flag for returning q…
pedrobaeza May 6, 2020
b6cc8c8
[FIX] website_sale_stock_available: immediately_usable_qty in_cart_up…
May 12, 2020
1b47a53
[IMP] website_sale_stock_available: Improve readme
May 15, 2020
bffbd57
[FIX] website_sale_stock_available: prevent payment blocking
chienandalu Dec 10, 2020
a3c2321
[MIG] website_sale_stock_available: Migration to 14.0
ivantodorovich Feb 3, 2021
19fd1f7
[IMP] pre-commit run
ivantodorovich Feb 3, 2021
782317b
[UPD] Update website_sale_stock_available.pot
oca-travis Apr 6, 2021
56aac0d
Added translation using Weblate (Spanish (Argentina))
ibuioli Sep 11, 2021
b7aff39
[MIG] website_sale_stock_available: Migration to 15.0
chienandalu Dec 20, 2022
a2a3f05
Update translation files
weblate Feb 7, 2023
b8ff268
[MIG] website_sale_stock_available: Migration to 16.0
bvanjeelharia Feb 23, 2023
6095805
Update translation files
weblate Feb 24, 2023
a2c5d68
Translated using Weblate (Spanish (Argentina))
ibuioli Mar 12, 2023
7bf7a0f
Translated using Weblate (Spanish)
Ivorra78 Aug 3, 2023
516cf7b
[FIX] website_sale_stock_available: depends_context
danielduqma Feb 29, 2024
54da69c
[FIX] website_sale_stock_available: respect args
danielduqma Mar 6, 2024
e0bc562
Added translation using Weblate (Italian)
mymage May 8, 2024
fd17fd5
Translated using Weblate (French)
remi-filament Aug 5, 2024
ba3f18c
[IMP] website_sale_stock_available: pre-commit auto fixes
carlos-lopez-tecnativa Feb 20, 2025
ce5e6d8
[MIG] website_sale_stock_available: Migration to version 17.0
carlos-lopez-tecnativa Feb 20, 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: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(

Check warning on line 12 in website_sale_stock_available/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

website_sale_stock_available/controllers/main.py#L12

Added line #L12 was not covered by tests
website_sale_stock_available=True
)
return super().shop_payment_transaction(*args, **kwargs)

Check warning on line 15 in website_sale_stock_available/controllers/main.py

View check run for this annotation

Codecov / codecov/patch

website_sale_stock_available/controllers/main.py#L15

Added line #L15 was not covered by tests
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