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 Nov 20, 2024
1 parent 240a518 commit 8c4599a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 25 deletions.
23 changes: 23 additions & 0 deletions pos_auto_invoice/static/src/js/models.esm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/** @odoo-module **/

import {Order} from "point_of_sale.models";
import Registries from "point_of_sale.Registries";

const AutoInvoiceOrder = (OriginalOrder) =>
class extends OriginalOrder {
constructor(obj, options) {
super(...arguments);
if (!options.json && this.pos.config.invoice_by_default) {
this.to_invoice = true;
}
}

init_from_JSON(json) {
super.init_from_JSON(...arguments);
// This should be done in the original method, but curiously
// it is not (to_invoice is always set to false).
this.to_invoice = json.to_invoice;
}
};

Registries.Model.extend(Order, AutoInvoiceOrder);
25 changes: 0 additions & 25 deletions pos_auto_invoice/static/src/js/models.js

This file was deleted.

0 comments on commit 8c4599a

Please sign in to comment.