From f38e5cc468ee83247f157f8fa1e90214da15d2ec Mon Sep 17 00:00:00 2001 From: hugues de keyzer Date: Wed, 30 Oct 2024 11:01:35 +0100 Subject: [PATCH] [MIG] pos_auto_invoice: migration to 16.0 --- pos_auto_invoice/__manifest__.py | 2 +- pos_auto_invoice/static/src/js/models.js | 23 ++++++++++++++--------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/pos_auto_invoice/__manifest__.py b/pos_auto_invoice/__manifest__.py index f86d82db99..875079313a 100644 --- a/pos_auto_invoice/__manifest__.py +++ b/pos_auto_invoice/__manifest__.py @@ -5,7 +5,7 @@ "name": "Point of Sale Automatically Invoice", "summary": """ In the POS, set orders as to-invoice by default.""", - "version": "15.0.1.0.0", + "version": "16.0.1.0.0", "category": "Point of Sale", "website": "https://coopiteasy.be", "author": "Coop IT Easy SC", diff --git a/pos_auto_invoice/static/src/js/models.js b/pos_auto_invoice/static/src/js/models.js index 203edea592..336eb01ad7 100644 --- a/pos_auto_invoice/static/src/js/models.js +++ b/pos_auto_invoice/static/src/js/models.js @@ -1,13 +1,18 @@ -odoo.define("pos_auto_invoice.models", function(require) { +odoo.define("pos_auto_invoice.models", function (require) { "use strict"; - var models = require("point_of_sale.models"); + const {Order} = require("point_of_sale.models"); + const Registries = require("point_of_sale.Registries"); - var OrderSuper = models.Order; - models.Order = models.Order.extend({ - initialize: function(attributes, options) { - OrderSuper.prototype.initialize.apply(this, arguments); - this.to_invoice = true; - }, - }); + // eslint-disable-next-line no-shadow + const AutoInvoiceOrder = (Order) => + // eslint-disable-next-line no-shadow + class AutoInvoiceOrder extends Order { + constructor() { + super(...arguments); + this.to_invoice = true; + } + }; + + Registries.Model.extend(Order, AutoInvoiceOrder); });