This commit converts almost all odoo module by native module. The goal is to deprecate odoo.define in favor of native module and then simplify boot.js by removing the regexp that finds module dependencies. task id: 3162300 closes odoo/odoo#117305 Related: odoo/enterprise#39118 Signed-off-by: Géry Debongnie <ged@odoo.com>
35 lines
1.3 KiB
JavaScript
35 lines
1.3 KiB
JavaScript
/** @odoo-module **/
|
|
|
|
import checkoutForm from "payment.checkout_form";
|
|
import manageForm from "payment.manage_form";
|
|
|
|
const salePaymentMixin = {
|
|
|
|
//--------------------------------------------------------------------------
|
|
// Private
|
|
//--------------------------------------------------------------------------
|
|
|
|
/**
|
|
* Add `sale_order_id` to the transaction route params if it is provided.
|
|
*
|
|
* @override method from payment.payment_form_mixin
|
|
* @private
|
|
* @param {string} code - The code of the selected payment option's provider
|
|
* @param {number} paymentOptionId - The id of the selected payment option
|
|
* @param {string} flow - The online payment flow of the selected payment option
|
|
* @return {object} The extended transaction route params
|
|
*/
|
|
_prepareTransactionRouteParams: function (code, paymentOptionId, flow) {
|
|
const transactionRouteParams = this._super(...arguments);
|
|
return {
|
|
...transactionRouteParams,
|
|
'sale_order_id': this.txContext.saleOrderId
|
|
? parseInt(this.txContext.saleOrderId) : undefined,
|
|
};
|
|
},
|
|
|
|
};
|
|
|
|
checkoutForm.include(salePaymentMixin);
|
|
manageForm.include(salePaymentMixin);
|