Skip to content

Commit

Permalink
[IMP] convert to native javascript module
Browse files Browse the repository at this point in the history
  • Loading branch information
huguesdk committed Dec 10, 2024
1 parent 5d07030 commit 1089611
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/** @odoo-module **/

import PaymentScreen from "point_of_sale.PaymentScreen";
import Registries from "point_of_sale.Registries";

const InvoiceDefaultPartnerPaymentScreen = (OriginalPaymentScreen) =>
class extends OriginalPaymentScreen {
async validateOrder() {
const partner = this.currentOrder.get_partner();
const default_partner_id = this.env.pos.config.default_partner_id;
if (this.currentOrder.is_to_invoice() && !partner && default_partner_id) {
this.currentOrder.set_partner(
this.env.pos.db.get_partner_by_id(default_partner_id[0])
);
}
return super.validateOrder(...arguments);
}
};

Registries.Component.extend(PaymentScreen, InvoiceDefaultPartnerPaymentScreen);

This file was deleted.

0 comments on commit 1089611

Please sign in to comment.