[IMP] barcodes: form views action barcodes

Make all common form operations doable through barcode scanning
This commit is contained in:
Arthur Maniet
2015-09-11 12:04:13 +02:00
parent 5b96b4349e
commit d0423b5e5c
@@ -16,6 +16,7 @@ var FormViewBarcodeHandler = common.AbstractField.extend(BarcodeHandlerMixin, {
// Hardcoded barcode actions
this.map_barcode_method = {
'O-CMD.NEW': _.bind(this.form_view.on_button_new, this.form_view),
'O-CMD.EDIT': _.bind(this.form_view.on_button_edit, this.form_view),
'O-CMD.CANCEL': _.bind(this.form_view.on_button_cancel, this.form_view),
// FIXME: on_button_save shouldn't mix view and model concerns (it expects to be used as onclick handler)
'O-CMD.SAVE': _.bind(this.form_view.on_button_save, this.form_view, {target: $('.o_cp_buttons .o_form_button_save')}),