Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
be42807
[10.0][ADD] stock_available_base_exclude_location
rousseldenis Apr 23, 2020
6bf3355
[10.0][IMP] stock_available_base_exclude_location: Better tests
rousseldenis Sep 18, 2020
b66c53a
[UPD] Update stock_available_base_exclude_location.pot
oca-travis Sep 19, 2020
1c3550a
[UPD] README.rst
OCA-git-bot Sep 19, 2020
e956ec3
stock_available_base_exclude_location 10.0.1.0.1
OCA-git-bot Sep 19, 2020
f7c1234
[IMP] stock_available_base_exclude_location: black, isort, prettier
xavier-bouquiaux Jun 22, 2021
ea802b3
[MIG][14.0] stock_available_base_exclude_location
xavier-bouquiaux Jun 23, 2021
b719dc7
[UPD] Update stock_available_base_exclude_location.pot
Sep 6, 2022
699dfd8
[UPD] README.rst
OCA-git-bot Sep 6, 2022
85de027
stock_available_base_exclude_location 14.0.1.0.1
OCA-git-bot Sep 6, 2022
8cef4aa
[IMP] stock_available_base_exclude_location: pre-commit stuff
rousseldenis Nov 13, 2023
8c509f7
[16.0][MIG] stock_available_base_exclude_location
rousseldenis Nov 13, 2023
d14ec95
[IMP] stock_available_base_exclude_location: Allows to use a domain f…
rousseldenis Nov 13, 2023
9a55630
[FIX] stock_available_base_exclude_location: Fix excluded locations d…
paradoxxxzero Feb 8, 2023
25519a1
[IMP] stock_available_base_exclude_location: Don't put base domain twice
rousseldenis Nov 13, 2023
c523b54
[IMP] stock_available_base_exclude_location: Use a Char domain field …
rousseldenis Nov 13, 2023
efa833b
[UPD] Update stock_available_base_exclude_location.pot
Apr 8, 2024
44b2e9d
Added translation using Weblate (Italian)
mymage Apr 10, 2024
2a863b1
Translated using Weblate (Italian)
mymage Apr 10, 2024
44394c1
[IMP] stock_available_base_exclude_location: pre-commit auto fixes
BhaveshHeliconia Apr 14, 2025
68bd3b3
[MIG] stock_available_base_exclude_location: Migration to 18.0
BhaveshHeliconia Apr 14, 2025
b64dd40
[UPD] Update stock_available_base_exclude_location.pot
Jun 10, 2025
5751dd7
[BOT] post-merge updates
OCA-git-bot Jun 10, 2025
795cf94
stock_available_base_exclude_location: Fix Migration 18.0
jbaudoux Dec 16, 2025
beb9c26
[BOT] post-merge updates
OCA-git-bot Dec 16, 2025
65e037a
[FIX] stock_available_base_exclude_location: FakeModel
jbaudoux Mar 3, 2026
b26bf15
[BOT] post-merge updates
OCA-git-bot Mar 3, 2026
b9aa35d
Added translation using Weblate (French)
rousseldenis Apr 3, 2026
feea07e
[MIG] stock_available_base_exclude_location: Migration to v19
AaronHForgeFlow May 18, 2026
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
103 changes: 103 additions & 0 deletions stock_available_base_exclude_location/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=====================================
Stock Available Base Exclude Location
=====================================

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

.. |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/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_available_base_exclude_location
: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_available_base_exclude_location
: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|

This module is a technical base module to allow defining excluded
locations on an Odoo model.

**Table of contents**

.. contents::
:local:

Usage
=====

In new module, inherit from "stock.exclude.location.mixin" model on the
wanted model.

Then, when querying for product availability, add to context the key
"excluded_location_ids" with your model "stock_excluded_location_ids"
property.

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_available_base_exclude_location%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
-------

* ACSONE SA/NV

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

- Denis Roussel <denis.roussel@acsone.eu>
- Xavier Bouquiaux <xavier.bouquiaux@acsone.eu>
- `Heliconia Solutions Pvt. Ltd. <https://www.heliconia.io>`__

- Bhavesh Heliconia

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.

.. |maintainer-rousseldenis| image:: https://github.com/rousseldenis.png?size=40px
:target: https://github.com/rousseldenis
:alt: rousseldenis

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-rousseldenis|

This module is part of the `OCA/stock-logistics-availability <https://github.com/OCA/stock-logistics-availability/tree/19.0/stock_available_base_exclude_location>`_ 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_available_base_exclude_location/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
15 changes: 15 additions & 0 deletions stock_available_base_exclude_location/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2020 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Stock Available Base Exclude Location",
"summary": """
Base module to exclude locations for product available quantities""",
"version": "19.0.1.0.0",
"category": "Warehouse",
"maintainers": ["rousseldenis"],
"license": "AGPL-3",
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/stock-logistics-availability",
"depends": ["stock"],
}
55 changes: 55 additions & 0 deletions stock_available_base_exclude_location/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_available_base_exclude_location
#
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: 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"

#. module: stock_available_base_exclude_location
#: model:ir.model.fields,field_description:stock_available_base_exclude_location.field_stock_exclude_location_mixin__stock_excluded_location_domain_char
msgid "Domain to filter locations"
msgstr ""

#. module: stock_available_base_exclude_location
#: model:ir.model.fields,help:stock_available_base_exclude_location.field_stock_exclude_location_mixin__stock_excluded_location_ids
msgid ""
"Fill in this field to exclude locations for product available quantities."
msgstr ""

#. module: stock_available_base_exclude_location
#: model:ir.model.fields,help:stock_available_base_exclude_location.field_stock_exclude_location_mixin__stock_excluded_location_domain
#: model:ir.model.fields,help:stock_available_base_exclude_location.field_stock_exclude_location_mixin__stock_excluded_location_domain_char
msgid ""
"Fill in this with the domain you want to exclude locations for product "
"available quantities"
msgstr ""

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

#. module: stock_available_base_exclude_location
#: model:ir.model.fields,field_description:stock_available_base_exclude_location.field_stock_exclude_location_mixin__stock_excluded_location_domain
msgid "Stock Excluded Location Domain"
msgstr ""

#. module: stock_available_base_exclude_location
#: model:ir.model.fields,field_description:stock_available_base_exclude_location.field_stock_exclude_location_mixin__stock_excluded_location_ids
msgid "Stock Excluded Locations"
msgstr ""

#. module: stock_available_base_exclude_location
#: model:ir.model,name:stock_available_base_exclude_location.model_stock_exclude_location_mixin
msgid ""
"technical base module to allow defining excluded locations on an Odoo model"
msgstr ""
63 changes: 63 additions & 0 deletions stock_available_base_exclude_location/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_available_base_exclude_location
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-04-10 08:41+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_available_base_exclude_location
#: model:ir.model.fields,field_description:stock_available_base_exclude_location.field_stock_exclude_location_mixin__stock_excluded_location_domain_char
msgid "Domain to filter locations"
msgstr "Dominio per filtrare le ubicazioni"

#. module: stock_available_base_exclude_location
#: model:ir.model.fields,help:stock_available_base_exclude_location.field_stock_exclude_location_mixin__stock_excluded_location_ids
msgid ""
"Fill in this field to exclude locations for product availablequantities."
msgstr ""
"Compilare questo campo per escludere ubicazioni dalle quantità disponibili "
"del prodotto."

#. module: stock_available_base_exclude_location
#: model:ir.model.fields,help:stock_available_base_exclude_location.field_stock_exclude_location_mixin__stock_excluded_location_domain
#: model:ir.model.fields,help:stock_available_base_exclude_location.field_stock_exclude_location_mixin__stock_excluded_location_domain_char
msgid ""
"Fill in this with the domain you want to exclude locations for product "
"available quantities"
msgstr ""
"Compilare questo campo con il dominio che si vuole utilizzare per escludere "
"le ubicazioni per le quantià prodotto disponibili"

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

#. module: stock_available_base_exclude_location
#: model:ir.model.fields,field_description:stock_available_base_exclude_location.field_stock_exclude_location_mixin__stock_excluded_location_domain
msgid "Stock Excluded Location Domain"
msgstr "Dominio ubicazione esclusa dalla giacenza"

#. module: stock_available_base_exclude_location
#: model:ir.model.fields,field_description:stock_available_base_exclude_location.field_stock_exclude_location_mixin__stock_excluded_location_ids
msgid "Stock Excluded Locations"
msgstr "Ubicazioni escluse dalla giacenza"

#. module: stock_available_base_exclude_location
#: model:ir.model,name:stock_available_base_exclude_location.model_stock_exclude_location_mixin
msgid ""
"technical base module to allow defining excluded locations on an Odoo model"
msgstr ""
"modulo tecnico base per consentire la definizione di ubicazioni escluse su "
"un modello Odoo"
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * stock_available_base_exclude_location
#
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_available_base_exclude_location
#: model:ir.model.fields,field_description:stock_available_base_exclude_location.field_stock_exclude_location_mixin__stock_excluded_location_domain_char
msgid "Domain to filter locations"
msgstr ""

#. module: stock_available_base_exclude_location
#: model:ir.model.fields,help:stock_available_base_exclude_location.field_stock_exclude_location_mixin__stock_excluded_location_ids
msgid ""
"Fill in this field to exclude locations for product available quantities."
msgstr ""

#. module: stock_available_base_exclude_location
#: model:ir.model.fields,help:stock_available_base_exclude_location.field_stock_exclude_location_mixin__stock_excluded_location_domain
#: model:ir.model.fields,help:stock_available_base_exclude_location.field_stock_exclude_location_mixin__stock_excluded_location_domain_char
msgid ""
"Fill in this with the domain you want to exclude locations for product "
"available quantities"
msgstr ""

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

#. module: stock_available_base_exclude_location
#: model:ir.model.fields,field_description:stock_available_base_exclude_location.field_stock_exclude_location_mixin__stock_excluded_location_domain
msgid "Stock Excluded Location Domain"
msgstr ""

#. module: stock_available_base_exclude_location
#: model:ir.model.fields,field_description:stock_available_base_exclude_location.field_stock_exclude_location_mixin__stock_excluded_location_ids
msgid "Stock Excluded Locations"
msgstr ""

#. module: stock_available_base_exclude_location
#: model:ir.model,name:stock_available_base_exclude_location.model_stock_exclude_location_mixin
msgid ""
"technical base module to allow defining excluded locations on an Odoo model"
msgstr ""
2 changes: 2 additions & 0 deletions stock_available_base_exclude_location/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import product_product
from . import stock_exclude_location_mixin
68 changes: 68 additions & 0 deletions stock_available_base_exclude_location/models/product_product.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Copyright 2020 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models
from odoo.fields import Domain


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

def _get_domain_locations_new(self, location_ids):
"""
This is used to exclude locations if needed
:param location_ids:
:param company_id:
:param compute_child:
:return:
"""
(
domain_quant_loc,
domain_move_in_loc,
domain_move_out_loc,
) = super()._get_domain_locations_new(
location_ids=location_ids,
)
excluded_location_ids = self.env.context.get("excluded_location_ids", [])
excluded_location_domain = self.env.context.get("excluded_location_domain", [])
domain_excluded_quant_loc = []
domain_excluded_move_in_loc = []
domain_excluded_move_out_loc = []
if excluded_location_ids:
domain_excluded_quant_loc = list(
Domain([("location_id", "not in", excluded_location_ids.ids)])
& Domain(domain_excluded_quant_loc)
)
domain_excluded_move_in_loc = list(
Domain([("location_id", "not in", excluded_location_ids.ids)])
& Domain(domain_excluded_move_in_loc)
)
domain_excluded_move_out_loc = list(
Domain([("location_id", "not in", excluded_location_ids.ids)])
& Domain(domain_excluded_move_out_loc)
)
if excluded_location_domain:
domain_excluded_quant_loc = list(
Domain(excluded_location_domain) & Domain(domain_excluded_quant_loc)
)
domain_excluded_move_in_loc = list(
Domain(excluded_location_domain) & Domain(domain_excluded_move_in_loc)
)
domain_excluded_move_out_loc = list(
Domain(excluded_location_domain) & Domain(domain_excluded_move_out_loc)
)
domain_quant_loc = (
list(Domain(domain_excluded_quant_loc) & Domain(domain_quant_loc))
if domain_excluded_quant_loc
else domain_quant_loc
)
domain_move_in_loc = (
list(Domain(domain_excluded_move_in_loc) & Domain(domain_move_in_loc))
if domain_excluded_move_in_loc
else domain_move_in_loc
)
domain_move_out_loc = (
list(Domain(domain_excluded_move_out_loc) & Domain(domain_move_out_loc))
if domain_excluded_move_in_loc
else domain_move_out_loc
)
return domain_quant_loc, domain_move_in_loc, domain_move_out_loc
Loading
Loading