-
-
Notifications
You must be signed in to change notification settings - Fork 617
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] pos_payment_method_cashdro: migration to 16.0
TT45180
- Loading branch information
1 parent
d2e8012
commit b77ae19
Showing
15 changed files
with
288 additions
and
305 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
34 changes: 0 additions & 34 deletions
34
pos_payment_method_cashdro/migrations/14.0.1.0.0/pre-migration.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from . import pos_payment_method | ||
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
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,14 @@ | ||
# Copyright 2024 Tecnativa - David Vidal | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
from odoo import models | ||
|
||
|
||
class PosSession(models.Model): | ||
_inherit = "pos.session" | ||
|
||
def _loader_params_pos_payment_method(self): | ||
result = super()._loader_params_pos_payment_method() | ||
result["search_params"]["fields"].extend( | ||
["cashdro_host", "cashdro_user", "cashdro_password"] | ||
) | ||
return result |
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,8 +1 @@ | ||
* Cashdro terminals are designed to communicate in the local network, so they can't | ||
receive or transmit any request to a remote Odoo server. So in order to implement | ||
further features, la cash control or cash ins/outs it would be necessary to either: | ||
|
||
- Prepare the Cashdro terminal for a remote use (VPN, dns, etc.) and implement the | ||
corresponding backend methods. | ||
- Develope PoS frontend modules that allow to perform such operations and extend this | ||
one making use of them. | ||
* Integrate cash control (money inputs / outputs). |
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,35 @@ | ||
/** @odoo-module */ | ||
/* Copyright 2021 Tecnativa - David Vidal | ||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).*/ | ||
import {Order, register_payment_method} from "point_of_sale.models"; | ||
import {PaymentCashdro} from "./payment_cashdro.esm"; | ||
import Registries from "point_of_sale.Registries"; | ||
|
||
register_payment_method("cashdro", PaymentCashdro); | ||
|
||
const PaymentCashdroOrder = (OriginalOrder) => | ||
class extends OriginalOrder { | ||
constructor() { | ||
super(...arguments); | ||
this.in_cashdro_transaction = false; | ||
} | ||
/** | ||
* @override | ||
* Set the amount to 0 as it's going to be filled by the Cashdro response | ||
*/ | ||
add_paymentline() { | ||
const line = super.add_paymentline(...arguments); | ||
if (!line) { | ||
return line; | ||
} | ||
if ( | ||
line.payment_method && | ||
line.payment_method.use_payment_terminal === "cashdro" | ||
) { | ||
line.set_amount(0); | ||
} | ||
return line; | ||
} | ||
}; | ||
|
||
Registries.Model.extend(Order, PaymentCashdroOrder); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.