-
-
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.
[MIG] pos_order_remove_line: Migration to 16.0
- Loading branch information
Showing
9 changed files
with
50 additions
and
55 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
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# Copyright 2019 LevelPrime | ||
# Copyright 2023 LevelPrime | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) |
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
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
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
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,30 @@ | ||
/** @odoo-module **/ | ||
/* | ||
* Copyright 2023 LevelPrime | ||
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) | ||
*/ | ||
|
||
import Orderline from "point_of_sale.Orderline"; | ||
import Registries from "point_of_sale.Registries"; | ||
|
||
const PosOrderline = (Orderline) => | ||
class extends Orderline { | ||
async removeLine(ev) { | ||
const order = this.env.pos.get_order(); | ||
if (order) { | ||
ev.stopPropagation(); | ||
ev.preventDefault(); | ||
this.selectLine(); | ||
order.remove_orderline(order.get_selected_orderline()); | ||
this.checkRewardLines(order); | ||
} | ||
} | ||
|
||
checkRewardLines(order) { | ||
const anyRewardLine = order.orderlines.some((line) => line.is_reward_line); | ||
if (anyRewardLine) { | ||
order._updateRewards(); | ||
} | ||
} | ||
}; | ||
Registries.Component.extend(Orderline, PosOrderline); |
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.