Before this commit, the field's description was stored on the
component and this component was then registered.
Now, an object describing the field is used on registration the same way
as it is done for views since https://github.com/odoo/odoo/commit/b828cfc72c587d0b73fcc5459695705640437671.
This split the component's description (props, template, ...) of
the field's description (displayName, supportedTypes, ...) and makes
it clearer.
closes odoo/odoo#112498
Task: 3171520
Related: odoo/enterprise#37105
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
19 lines
539 B
JavaScript
19 lines
539 B
JavaScript
/** @odoo-module **/
|
|
|
|
import { registry } from "@web/core/registry";
|
|
import { FloatField, floatField } from "@web/views/fields/float/float_field";
|
|
|
|
export class FloatScannableField extends FloatField {
|
|
onBarcodeScanned() {
|
|
this.inputRef.el.dispatchEvent(new InputEvent("input"));
|
|
}
|
|
}
|
|
FloatScannableField.template = "barcodes.FloatScannableField";
|
|
|
|
export const floatScannableField = {
|
|
...floatField,
|
|
component: FloatScannableField,
|
|
};
|
|
|
|
registry.category("fields").add("field_float_scannable", floatScannableField);
|