-
-
Notifications
You must be signed in to change notification settings - Fork 619
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] convert to native javascript module
- Loading branch information
Showing
2 changed files
with
23 additions
and
25 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
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); |
This file was deleted.
Oops, something went wrong.