-
-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] product_variant_tree_qty_available: new module
- Loading branch information
1 parent
b71e3a5
commit 26d8092
Showing
18 changed files
with
688 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
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,100 @@ | ||
======================================= | ||
Product Variant Tree View Qty Available | ||
======================================= | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:502306720c2603976d9ce87ab3aca202cc3dcb2a5047612604a905a2e82c9fb1 | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |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-LGPL--3-blue.png | ||
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html | ||
:alt: License: LGPL-3 | ||
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproduct--variant-lightgray.png?logo=github | ||
:target: https://github.com/OCA/product-variant/tree/14.0/product_variant_tree_qty_available | ||
:alt: OCA/product-variant | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/product-variant-14-0/product-variant-14-0-product_variant_tree_qty_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/product-variant&target_branch=14.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
This module extends the functionality of the 'stock' module and adds an | ||
action button to open quant view from 'Product Variants' tree. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Usage | ||
===== | ||
|
||
To use this module, you need to: | ||
|
||
#. Go to the "Products => Product Variants" in the "Inventory" menu #. | ||
Click on "Open" button #. Check user access rights to view all required | ||
fields. | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/product-variant/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/product-variant/issues/new?body=module:%20product_variant_tree_qty_available%0Aversion:%2014.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 | ||
------- | ||
|
||
* Ooops | ||
* Cetmix | ||
|
||
Contributors | ||
------------ | ||
|
||
- Ooops https://ooops404.com | ||
- Cetmix https://cetmix.com/ | ||
- Dessan Hemrayev [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. | ||
|
||
.. |maintainer-dessanhemrayev| image:: https://github.com/dessanhemrayev.png?size=40px | ||
:target: https://github.com/dessanhemrayev | ||
:alt: dessanhemrayev | ||
.. |maintainer-CetmixGitDrone| image:: https://github.com/CetmixGitDrone.png?size=40px | ||
:target: https://github.com/CetmixGitDrone | ||
:alt: CetmixGitDrone | ||
|
||
Current `maintainers <https://odoo-community.org/page/maintainer-role>`__: | ||
|
||
|maintainer-dessanhemrayev| |maintainer-CetmixGitDrone| | ||
|
||
This module is part of the `OCA/product-variant <https://github.com/OCA/product-variant/tree/14.0/product_variant_tree_qty_available>`_ 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,4 @@ | ||
# Copyright (C) 2023 Cetmix OÜ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
||
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,19 @@ | ||
# Copyright (C) 2023 Cetmix OÜ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
||
{ | ||
"name": "Product Variant Tree View Qty Available", | ||
"summary": "Adds the 'QTY' button to product variant tree view", | ||
"version": "14.0.1.0.1", | ||
"category": "Inventory", | ||
"website": "https://github.com/OCA/product-variant", | ||
"author": "Ooops, Cetmix, Odoo Community Association (OCA)", | ||
"license": "LGPL-3", | ||
"application": False, | ||
"maintainers": ["dessanhemrayev", "CetmixGitDrone"], | ||
"installable": True, | ||
"depends": ["stock"], | ||
"data": [ | ||
"views/product_views.xml", | ||
], | ||
} |
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,5 @@ | ||
# Copyright (C) 2023 Cetmix OÜ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
||
from . import product_product | ||
from . import stock_quant |
13 changes: 13 additions & 0 deletions
13
product_variant_tree_qty_available/models/product_product.py
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,13 @@ | ||
# Copyright (C) 2023 Cetmix OÜ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
||
from odoo import _, models | ||
|
||
|
||
class Product(models.Model): | ||
_inherit = "product.product" | ||
|
||
def action_open_product_quants(self): | ||
action = super().action_open_quants() | ||
action["name"] = _("%s - Update Quantity") % self.display_name | ||
return action |
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,29 @@ | ||
# Copyright (C) 2023 Cetmix OÜ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
||
from odoo import _, models | ||
|
||
|
||
class StockQuant(models.Model): | ||
_inherit = "stock.quant" | ||
|
||
def _search_on_hand(self, operator, value): | ||
if operator not in ["=", "!="] or not isinstance(value, bool): | ||
raise models.UserError(_("Operation not supported")) | ||
domain_loc = ( | ||
self.env["product.product"] | ||
.with_context(compute_child=False) | ||
._get_domain_locations()[0] | ||
) | ||
domain_loc_value = domain_loc and domain_loc[0][2] or [] | ||
location_ids = self.env["stock.location"]._search( | ||
[("id", "child_of", domain_loc_value)] | ||
) | ||
quant_ids = self.env["stock.quant"]._search( | ||
[("location_id", "in", location_ids)] | ||
) | ||
if (operator == "!=" and value is True) or (operator == "=" and value is False): | ||
domain_operator = "not in" | ||
else: | ||
domain_operator = "in" | ||
return [("id", domain_operator, quant_ids)] |
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 @@ | ||
* Ooops <https://ooops404.com> | ||
* Cetmix <https://cetmix.com/> | ||
* Dessan Hemrayev <[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 @@ | ||
This module extends the functionality of the 'stock' module | ||
and adds an action button to open quant view from 'Product Variants' tree. |
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,5 @@ | ||
To use this module, you need to: | ||
|
||
#. Go to the "Products => Product Variants" in the "Inventory" menu | ||
#. Click on "Open" button | ||
#. Check user access rights to view all required fields. |
Empty file.
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.