diff options
| author | Géry Debongnie <ged@odoo.com> | 2017-03-05 10:05:56 +0100 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2017-04-11 19:44:38 +0200 |
| commit | 905e01921f3c3ef43ace6fc537d1d8c0d280002c (patch) | |
| tree | 265c43ab21c5401a5d9f0f3d64d86f1ac417451c /addons/barcodes/static/src/js/inherited_form_widget_button.js | |
| parent | 54d4c73af4ad05c7640d28c1892247c9538b8017 (diff) | |
[REF] web, *: redesign all JS views
This commit introduce a full redesign of all JS views. We started
basically from scratch. The goal was to unify all the various views
under a common framework, to make them testable, to make then usable in
different conditions (in studio, or in the frontend), and to make our
lives easier.
Some important points are:
- we introduced new coding guidelines (camelCase, 80 chars width, ...)
- we have a brand new testing framework (still QUnit based)
- kanban view moved to the web addon
- calendar view (formerly web_calender) moved to web as well
- the tree view was removed
- all new code should be documented
We hope that this code is the start of a new era for the Odoo web
client, we want to have a high quality codebase, well documented, well
tested, well designed.
Work done by the framework team: mostly aab, ged, chm, dmo, qsm
Diffstat (limited to 'addons/barcodes/static/src/js/inherited_form_widget_button.js')
| -rw-r--r-- | addons/barcodes/static/src/js/inherited_form_widget_button.js | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/addons/barcodes/static/src/js/inherited_form_widget_button.js b/addons/barcodes/static/src/js/inherited_form_widget_button.js index 08475ee199b..d1998cd40cf 100644 --- a/addons/barcodes/static/src/js/inherited_form_widget_button.js +++ b/addons/barcodes/static/src/js/inherited_form_widget_button.js @@ -1,33 +1,34 @@ odoo.define('barcode.InheritedFormWidgetButton', function (require) { "use strict"; -var widgets = require('web.form_widgets'); -var BarcodeEvents = require('barcodes.BarcodeEvents'); -var BarcodeHandlerMixin = require('barcodes.BarcodeHandlerMixin'); +// FIXME +// var widgets = require('web.form_widgets'); +// var BarcodeEvents = require('barcodes.BarcodeEvents'); +// var BarcodeHandlerMixin = require('barcodes.BarcodeHandlerMixin'); -// If the button has a barcode_trigger attribute, dynamically inherit -// BarcodeHandlerMixin and redefine on_barcode_scanned +// // If the button has a barcode_trigger attribute, dynamically inherit +// // BarcodeHandlerMixin and redefine on_barcode_scanned -var ButtonBarcodeHandlerMixin = _.extend({}, BarcodeHandlerMixin, { - init: function(field_manager, node) { - if (node.attrs.barcode_trigger) { - BarcodeHandlerMixin.init.call(this, field_manager, node); - var self = this; - this.on_barcode_scanned = function(barcode) { - var match = barcode.match(/O-BTN\.(.+)/); - if (match && match[1] === self.node.attrs.barcode_trigger && - (self.$el.is(':visible') || self.$el.parent('.dropdown-menu').length)) { - self.on_click(); - } - }; - } else { - this._super(field_manager, node); - } - }, -}); +// var ButtonBarcodeHandlerMixin = _.extend({}, BarcodeHandlerMixin, { +// init: function(field_manager, node) { +// if (node.attrs.barcode_trigger) { +// BarcodeHandlerMixin.init.call(this, field_manager, node); +// var self = this; +// this.on_barcode_scanned = function(barcode) { +// var match = barcode.match(/O-BTN\.(.+)/); +// if (match && match[1] === self.node.attrs.barcode_trigger && +// (self.$el.is(':visible') || self.$el.parent('.dropdown-menu').length)) { +// self.on_click(); +// } +// }; +// } else { +// this._super(field_manager, node); +// } +// }, +// }); -BarcodeEvents.ReservedBarcodePrefixes.push('O-BTN'); +// BarcodeEvents.ReservedBarcodePrefixes.push('O-BTN'); -widgets.WidgetButton.include(ButtonBarcodeHandlerMixin); +// widgets.WidgetButton.include(ButtonBarcodeHandlerMixin); }); |
