Skip to content

Commit

Permalink
[ADD] pos_bypass_global_discount
Browse files Browse the repository at this point in the history
  • Loading branch information
trisdoan committed Sep 19, 2024
1 parent f808797 commit 245c3d5
Show file tree
Hide file tree
Showing 14 changed files with 657 additions and 0 deletions.
79 changes: 79 additions & 0 deletions pos_bypass_global_discount/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
==========================
POS Bypass Global Discount
==========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:5f77c0acfa94c44cf02d9d34e69c09a5f8258fc46c7dd93c51c5bcce55f230ff
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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_bypass_global_discount
: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_bypass_global_discount
: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/pos&target_branch=16.0
:alt: Try me on Runboat

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

Field `bypass_global_discount` was introduced in [base_global_discount](https://github.com/OCA/server-backend/tree/16.0/base_global_discount). It's used to exclude some products from global discounts calculations.
This module is meant to be installed as a companion to `sale_global_discount`. It makes sure the POS will also honors the `bypass_global_discount` field when user inputs a Discount at the Order level.

**Table of contents**

.. contents::
:local:

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 to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/pos/issues/new?body=module:%20pos_bypass_global_discount%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
~~~~~~~

* Camptocamp

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

* `Camptocamp <https://www.camptocamp.com>`_

* Tri Doan <tridm@trobz.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/pos <https://github.com/OCA/pos/tree/16.0/pos_bypass_global_discount>`_ 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 pos_bypass_global_discount/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
22 changes: 22 additions & 0 deletions pos_bypass_global_discount/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Copyright 2024 Camptocamp (https://www.camptocamp.com).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "POS Bypass Global Discount",
"summary": "",
"version": "16.0.1.0.0",
"author": "Camptocamp, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/pos",
"license": "AGPL-3",
"category": "Point of Sale",
"depends": ["pos_discount", "pos_loyalty", "sale_global_discount"],
"installable": True,
"assets": {
"point_of_sale.assets": [
"pos_bypass_global_discount/static/src/js/**/*.js",
],
"web.assets_tests": [
"pos_bypass_global_discount/static/src/tours/**/*",
],
},
}
1 change: 1 addition & 0 deletions pos_bypass_global_discount/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import pos_session
13 changes: 13 additions & 0 deletions pos_bypass_global_discount/models/pos_session.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2024 Camptocamp
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models


class POSSession(models.Model):
_inherit = "pos.session"

def _loader_params_product_product(self):
params = super()._loader_params_product_product()
if "search_params" in params and "fields" in params["search_params"]:
params["search_params"]["fields"].append("bypass_global_discount")
return params
3 changes: 3 additions & 0 deletions pos_bypass_global_discount/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* `Camptocamp <https://www.camptocamp.com>`_

* Tri Doan <tridm@trobz.com>
2 changes: 2 additions & 0 deletions pos_bypass_global_discount/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Field `bypass_global_discount` was introduced in [base_global_discount](https://github.com/OCA/server-backend/tree/16.0/base_global_discount). It's used to exclude some products from global discounts calculations.
This module is meant to be installed as a companion to `sale_global_discount`. It makes sure the POS will also honors the `bypass_global_discount` field when user inputs a Discount at the Order level.
Loading

0 comments on commit 245c3d5

Please sign in to comment.