Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
efd7107
[ADD] stock_free_qty
florian-dacosta Dec 28, 2020
f64a1b6
[IMP] stock_free_quantity: black, isort, prettier
oca-travis Jan 26, 2021
a78224a
[MIG] stock_free_quantity: Migration to 15.0
glitchov Oct 11, 2022
3235af0
[UPD] Update stock_free_quantity.pot
Dec 15, 2022
51faa6a
[UPD] README.rst
OCA-git-bot Dec 15, 2022
af46a9c
[ADD] icon.png
OCA-git-bot Dec 15, 2022
30701e5
stock_free_quantity 15.0.1.0.1
OCA-git-bot Dec 15, 2022
5c581bf
Added translation using Weblate (French)
apf-c2c May 30, 2023
34bfb6d
Translated using Weblate (French)
apf-c2c May 30, 2023
9d6726e
Translated using Weblate (French)
Jun 19, 2023
6c32d57
Translated using Weblate (French)
Ricardoalso Jun 21, 2023
ef515b9
[MIG] stock_free_quantity: Migration to 16.0
EvaSForgeFlow Jun 22, 2023
e16b69e
[UPD] Update stock_free_quantity.pot
Jun 29, 2023
247e763
[UPD] README.rst
OCA-git-bot Jun 29, 2023
ef7c420
Update translation files
weblate Jun 29, 2023
43a939e
[UPD] README.rst
OCA-git-bot Sep 3, 2023
50f7c8d
Added translation using Weblate (Italian)
mymage Nov 24, 2023
de702a6
Translated using Weblate (Italian)
mymage Nov 24, 2023
1614079
[MIG] stock_free_quantity: Migration to 17.0
jcadhoc Apr 11, 2024
90143cb
[IMP] stock_free_quantity: pre-commit stuff
EvaSForgeFlow Jun 22, 2023
bb3ea0c
[UPD] Update stock_free_quantity.pot
Nov 20, 2024
90487de
[BOT] post-merge updates
OCA-git-bot Nov 20, 2024
bbec853
[IMP] stock_free_quantity: pre-commit execution
jcadhoc Dec 11, 2024
ed0e643
[MIG] stock_free_quantity: Migration to 18.0
jcadhoc Dec 11, 2024
8e1d1c1
[UPD] Update stock_free_quantity.pot
Feb 12, 2025
409c734
[BOT] post-merge updates
OCA-git-bot Feb 12, 2025
c92ce31
[FIX] stock_free_quantity: fix product/template smart button UI
DavidJForgeFlow Mar 25, 2025
890af99
[BOT] post-merge updates
OCA-git-bot Mar 27, 2025
0f6387d
Added translation using Weblate (Turkish)
bo-eska May 1, 2025
4ff4cc0
[MIG] stock_free_quantity: Migration to 19.0
lef-adhoc Nov 5, 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
81 changes: 81 additions & 0 deletions stock_free_quantity/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

===================
Stock Free Quantity
===================

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

.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
:target: https://odoo-community.org/page/development-status
:alt: Production/Stable
.. |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%2Fstock--logistics--availability-lightgray.png?logo=github
:target: https://github.com/OCA/stock-logistics-availability/tree/19.0/stock_free_quantity
:alt: OCA/stock-logistics-availability
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/stock-logistics-availability-19-0/stock-logistics-availability-19-0-stock_free_quantity
: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/stock-logistics-availability&target_branch=19.0
:alt: Try me on Runboat

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

Add Product variant free quantity in Product form view and add the same
on Product templates.

**Table of contents**

.. contents::
:local:

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/stock-logistics-availability/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/stock-logistics-availability/issues/new?body=module:%20stock_free_quantity%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
-------

* Akretion

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

- Florian da Costa <florian.dacost@akretion.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/stock-logistics-availability <https://github.com/OCA/stock-logistics-availability/tree/19.0/stock_free_quantity>`_ 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 stock_free_quantity/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
16 changes: 16 additions & 0 deletions stock_free_quantity/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "Stock Free Quantity",
"version": "19.0.1.0.0",
"author": "Akretion,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/stock-logistics-availability",
"development_status": "Production/Stable",
"category": "Warehouse",
"depends": ["stock"],
"license": "AGPL-3",
"data": [
"views/product_template_view.xml",
"views/product_product_view.xml",
"views/stock_quant_view.xml",
],
"installable": True,
}
41 changes: 41 additions & 0 deletions stock_free_quantity/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_free_quantity
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-06-21 10:08+0000\n"
"Last-Translator: Ricardoalso <ricardo.almeidasoares@camptocamp.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 4.17\n"

#. module: stock_free_quantity
#: model_terms:ir.ui.view,arch_db:stock_free_quantity.product_normal_form_view
#: model_terms:ir.ui.view,arch_db:stock_free_quantity.view_stock_available_form
msgid "<span class=\"o_stat_text\">Free</span>"
msgstr "<span class=\"o_stat_text\">Disponible</span>"

#. module: stock_free_quantity
#: model:ir.model.fields,field_description:stock_free_quantity.field_product_template__free_qty
msgid "Free Quantity"
msgstr "Quantité disponible"

#. module: stock_free_quantity
#: model_terms:ir.ui.view,arch_db:stock_free_quantity.product_template_kanban_free_qty_view
msgid "Free:"
msgstr "Disponible :"

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

#~ msgid "Product Template"
#~ msgstr "Article"
38 changes: 38 additions & 0 deletions stock_free_quantity/i18n/it.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:
# * stock_free_quantity
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-11-24 16:35+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: stock_free_quantity
#: model_terms:ir.ui.view,arch_db:stock_free_quantity.product_normal_form_view
#: model_terms:ir.ui.view,arch_db:stock_free_quantity.view_stock_available_form
msgid "<span class=\"o_stat_text\">Free</span>"
msgstr "<span class=\"o_stat_text\">Libera</span>"

#. module: stock_free_quantity
#: model:ir.model.fields,field_description:stock_free_quantity.field_product_template__free_qty
msgid "Free Quantity"
msgstr "Quantità libera"

#. module: stock_free_quantity
#: model_terms:ir.ui.view,arch_db:stock_free_quantity.product_template_kanban_free_qty_view
msgid "Free:"
msgstr "Libera:"

#. module: stock_free_quantity
#: model:ir.model,name:stock_free_quantity.model_product_template
msgid "Product"
msgstr "Prodotto"
35 changes: 35 additions & 0 deletions stock_free_quantity/i18n/stock_free_quantity.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_free_quantity
#
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: stock_free_quantity
#: model_terms:ir.ui.view,arch_db:stock_free_quantity.product_normal_form_view
#: model_terms:ir.ui.view,arch_db:stock_free_quantity.view_stock_available_form
msgid "<span class=\"o_stat_text\">Free</span>"
msgstr ""

#. module: stock_free_quantity
#: model:ir.model.fields,field_description:stock_free_quantity.field_product_template__free_qty
msgid "Free Quantity"
msgstr ""

#. module: stock_free_quantity
#: model_terms:ir.ui.view,arch_db:stock_free_quantity.product_template_kanban_free_qty_view
msgid "Free:"
msgstr ""

#. module: stock_free_quantity
#: model:ir.model,name:stock_free_quantity.model_product_template
msgid "Product"
msgstr ""
36 changes: 36 additions & 0 deletions stock_free_quantity/i18n/tr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_free_quantity
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: tr\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"

#. module: stock_free_quantity
#: model_terms:ir.ui.view,arch_db:stock_free_quantity.product_normal_form_view
#: model_terms:ir.ui.view,arch_db:stock_free_quantity.view_stock_available_form
msgid "<span class=\"o_stat_text\">Free</span>"
msgstr ""

#. module: stock_free_quantity
#: model:ir.model.fields,field_description:stock_free_quantity.field_product_template__free_qty
msgid "Free Quantity"
msgstr ""

#. module: stock_free_quantity
#: model_terms:ir.ui.view,arch_db:stock_free_quantity.product_template_kanban_free_qty_view
msgid "Free:"
msgstr ""

#. module: stock_free_quantity
#: model:ir.model,name:stock_free_quantity.model_product_template
msgid "Product"
msgstr ""
1 change: 1 addition & 0 deletions stock_free_quantity/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import product_template
11 changes: 11 additions & 0 deletions stock_free_quantity/models/product_product.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from odoo import models


class ProductProduct(models.Model):
_inherit = "product.product"

def _prepare_domain_available_not_reserved(self):
domain_quant = [("product_id", "in", self.ids)]
domain_quant_locations = self._get_domain_locations()[0]
domain_quant.extend(domain_quant_locations)
return domain_quant
32 changes: 32 additions & 0 deletions stock_free_quantity/models/product_template.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from odoo import fields, models


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

def _compute_quantities_dict(self):
prod_available = super()._compute_quantities_dict()
for template in self:
free_qty = 0
for p in template.with_context(active_test=False).product_variant_ids:
free_qty += p.free_qty
prod_available[template.id]["free_qty"] = free_qty
return prod_available

def _compute_quantities(self):
super()._compute_quantities()
res = self._compute_quantities_dict()
for template in self:
template.free_qty = res[template.id]["free_qty"]
return

def _search_free_qty(self, operator, value):
return [("product_variant_ids.free_qty", operator, value)]

free_qty = fields.Float(
"Free Quantity",
compute="_compute_quantities",
search="_search_free_qty",
compute_sudo=False,
digits="Product Unit of Measure",
)
3 changes: 3 additions & 0 deletions stock_free_quantity/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
1 change: 1 addition & 0 deletions stock_free_quantity/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Florian da Costa \<<florian.dacost@akretion.com>\>
2 changes: 2 additions & 0 deletions stock_free_quantity/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Add Product variant free quantity in Product form view and add the same
on Product templates.
Binary file added stock_free_quantity/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading