Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
97 changes: 97 additions & 0 deletions pos_order_exclude_attribute_combination/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
=================================================================
POS Orders - Limit seletion of not allowed attribute combinations
=================================================================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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%2Fpos-lightgray.png?logo=github
:target: https://github.com/OCA/pos/tree/16.0/pos_order_exclude_attribute_combination
:alt: OCA/pos
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/pos-16-0/pos-16-0-pos_order_exclude_attribute_combination
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/pos&target_branch=16.0
:alt: Try me on Runboat

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

This module allow user to show warning for Limit seletion of not allowed attribute combinations

**Table of contents**

.. contents::
:local:

Usage
=====

To use this module, you need to:

#. Configure the product with variant exclude option
#. Open the POS Session add select product
#. When you select attribute then check for combination available if not then show warning on top of the dialog

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/pos/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/pos/issues/new?body=module:%20pos_order_exclude_attribute_combination%0Aversion:%2016.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
~~~~~~~

* Open Source Integrators

Contributors
~~~~~~~~~~~~

* Sandip Vyas <svyas@opensourceintegrators.com>

Other credits
~~~~~~~~~~~~~

The development of this module has been financially supported by:

* Open Source Integrators <https://opensourceintegrators.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.

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

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

|maintainer-ursais|

This module is part of the `OCA/pos <https://github.com/OCA/pos/tree/16.0/pos_order_exclude_attribute_combination>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
4 changes: 4 additions & 0 deletions pos_order_exclude_attribute_combination/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (C) 2022 Open Source Integrators (https://www.opensourceintegrators.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
23 changes: 23 additions & 0 deletions pos_order_exclude_attribute_combination/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright (C) 2022 Open Source Integrators (https://www.opensourceintegrators.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "POS Orders - Limit seletion of not allowed attribute combinations",
"version": "16.0.1.0.0",
"summary": """Product attribute values allow to set Exclude for
to make some combinations unavailable.""",
"author": "Open Source Integrators, Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Point of Sale",
"maintainer": "Open Source Integrators",
"website": "https://github.com/OCA/pos",
"depends": ["point_of_sale"],
"maintainers": ["ursais"],
"installable": True,
"assets": {
"point_of_sale.assets": [
"pos_order_exclude_attribute_combination/static/src/js/**/*.js",
"pos_order_exclude_attribute_combination/static/src/xml/**/*.xml",
"pos_order_exclude_attribute_combination/static/src/scss/**/*.scss",
],
},
}
4 changes: 4 additions & 0 deletions pos_order_exclude_attribute_combination/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (C) 2022 Open Source Integrators (https://www.opensourceintegrators.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import product
22 changes: 22 additions & 0 deletions pos_order_exclude_attribute_combination/models/product.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright (C) 2022 Open Source Integrators (https://www.opensourceintegrators.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import models


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

def get_product_attribute_value(self, attribute_values):
return self.env["product.template.attribute.value"].search(
[
("product_attribute_value_id", "in", attribute_values),
("product_tmpl_id", "=", self.id),
]
)

def get_product_info(self, product_id, combination):
combination = self.get_product_attribute_value(combination)
return self._is_combination_possible(
combination=combination, parent_combination=combination
)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Sandip Vyas <svyas@opensourceintegrators.com>
3 changes: 3 additions & 0 deletions pos_order_exclude_attribute_combination/readme/CREDITS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The development of this module has been financially supported by:

* Open Source Integrators <https://opensourceintegrators.com>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This module allow user to show warning for Limit seletion of not allowed attribute combinations
5 changes: 5 additions & 0 deletions pos_order_exclude_attribute_combination/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
To use this module, you need to:

#. Configure the product with variant exclude option
#. Open the POS Session add select product
#. When you select attribute then check for combination available if not then show warning on top of the dialog
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading