Elouan Le Bars
5 years ago
5 changed files with 60 additions and 8 deletions
-
3beesdoo_shift/__openerp__.py
-
7beesdoo_shift/models/attendance_sheet.py
-
35beesdoo_shift/static/src/js/barcode_scanner_focus.js
-
13beesdoo_shift/views/attendance_sheet.xml
-
10beesdoo_shift/views/beesdoo_shift_assets.xml
@ -0,0 +1,35 @@ |
|||||
|
odoo.define('beesdoo_shift.barcode_scanner_focus', function (require) { |
||||
|
"use strict"; |
||||
|
|
||||
|
var core = require('web.core'); |
||||
|
|
||||
|
var FormViewBarcodeHandler = require('barcodes.FormViewBarcodeHandler'); |
||||
|
|
||||
|
var BarcodeHandlerUnfocus = FormViewBarcodeHandler.extend({ |
||||
|
_set_quantity_listener: function(event) { |
||||
|
console.log("TEST"); |
||||
|
this.super(); |
||||
|
}, |
||||
|
// Method is not called when a field is focus.
|
||||
|
on_barcode_scanned: function(barcode) { |
||||
|
console.log("method called"); |
||||
|
this._super(barcode); |
||||
|
} |
||||
|
}); |
||||
|
core.form_widget_registry.add('barcode_handler_unfocus', BarcodeHandlerUnfocus); |
||||
|
|
||||
|
return BarcodeHandlerUnfocus; |
||||
|
/* |
||||
|
var Widget = require('web.Widget'); |
||||
|
var BarcodeHandlerUnfocus = Widget.extend({ |
||||
|
events: { |
||||
|
'click .oe_stat_button': 'function_test', |
||||
|
} |
||||
|
function_test: function (){ |
||||
|
console.log("test handler") |
||||
|
}); |
||||
|
|
||||
|
}); |
||||
|
core.form_widget_registry.add('barcode_handler_unfocus', BarcodeHandlerUnfocus); |
||||
|
return BarcodeHandlerUnfocus;*/ |
||||
|
}); |
@ -0,0 +1,10 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<openerp> |
||||
|
<data> |
||||
|
<template id="assets_backend" name="account assets" inherit_id="web.assets_backend"> |
||||
|
<xpath expr="." position="inside"> |
||||
|
<script type="text/javascript" src="/beesdoo_shift/static/src/js/barcode_scanner_focus.js"></script> |
||||
|
</xpath> |
||||
|
</template> |
||||
|
</data> |
||||
|
</openerp> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue