Skip to content

Commit

Permalink
Merge PR #1220 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by legalsylvain
  • Loading branch information
OCA-git-bot committed Sep 25, 2024
2 parents 7ed8b32 + 245c3d5 commit b2b2e2a
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 b2b2e2a

Please sign in to comment.