-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by rousseldenis
- Loading branch information
Showing
19 changed files
with
845 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
=================== | ||
Stock Free Quantity | ||
=================== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:2a7f0ed0b42635286e2da7a7e66dc3461a328c810e76b325cffadfea940d52c2 | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |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/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%2Fstock--logistics--availability-lightgray.png?logo=github | ||
:target: https://github.com/OCA/stock-logistics-availability/tree/18.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-18-0/stock-logistics-availability-18-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=18.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:%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 | ||
------- | ||
|
||
* Akretion | ||
|
||
Contributors | ||
------------ | ||
|
||
- Florian da Costa <[email protected]> | ||
|
||
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/18.0/stock_free_quantity>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"name": "Stock Free Quantity", | ||
"version": "18.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", | ||
], | ||
"installable": True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 <[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 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 <[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: 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 17.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 "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import product_template |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[build-system] | ||
requires = ["whool"] | ||
build-backend = "whool.buildapi" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Florian da Costa \<<[email protected]>\> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.