-
-
Notifications
You must be signed in to change notification settings - Fork 602
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
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 @@ | ||
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,23 @@ | ||
# 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": ["sale_global_discount", "pos_discount"], | ||
"installable": True, | ||
"assets": { | ||
"point_of_sale.assets": [ | ||
"pos_bypass_global_discount/static/src/js/**/*.js", | ||
], | ||
# "web.assets_tests": [ | ||
# "pos_loyalty_exclude/static/src/tours/**/*", | ||
# ], | ||
}, | ||
"auto_install": True, | ||
} |
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 @@ | ||
from . import pos_session |
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,12 @@ | ||
# Copyright 2024 Camptocamp SA | ||
# 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() | ||
params["search_params"]["fields"].append("bypass_global_discount") | ||
return params |
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,15 @@ | ||
odoo.define("pos_bypass_global_discount.models", function (require) { | ||
"use strict"; | ||
|
||
const {Orderline} = require("point_of_sale.models"); | ||
const Registries = require("point_of_sale.Registries"); | ||
|
||
const PosBypassDiscountOrderline = (Orderline) => | ||
class PosBypassDiscountOrderline extends Orderline { | ||
isGlobalDiscountApplicable() { | ||
const res = super.isGlobalDiscountApplicable(); | ||
return !this.product.bypass_global_discount && res; | ||
} | ||
}; | ||
Registries.Model.extend(Orderline, PosBypassDiscountOrderline); | ||
}); |
Empty file.