Jaime Arroyo
6 years ago
committed by
OCA-git-bot
5 changed files with 37 additions and 37 deletions
-
10barcode_action/README.rst
-
2barcode_action/__manifest__.py
-
6barcode_action/static/description/index.html
-
20barcode_action/static/src/js/action_barcode_form.js
-
36barcode_action/static/src/js/action_barcode_widget.js
@ -1,23 +1,23 @@ |
|||
odoo.define('barcode_action.form', function (require) { |
|||
"use strict"; |
|||
"use strict"; |
|||
|
|||
var FormController = require('web.FormController'); |
|||
var FormController = require('web.FormController'); |
|||
|
|||
FormController.include({ |
|||
_barcodeHandleAction: function (barcode, activeBarcode) { |
|||
var record = this.model.get(this.handle); |
|||
var self = this; |
|||
return self._rpc({ |
|||
FormController.include({ |
|||
_barcodeHandleAction: function (barcode, activeBarcode) { |
|||
var record = this.model.get(this.handle); |
|||
var self = this; |
|||
return self._rpc({ |
|||
model: record.data.model, |
|||
method: record.data.method, |
|||
args: [[record.data.res_id], barcode], |
|||
}).done(function (action) { |
|||
if (action){ |
|||
if (action) { |
|||
self._barcodeStopListening(); |
|||
self.do_action(action); |
|||
} |
|||
}); |
|||
}, |
|||
}); |
|||
}, |
|||
}); |
|||
|
|||
}); |
@ -1,24 +1,24 @@ |
|||
odoo.define('barcode_action.field', function (require) { |
|||
"use strict"; |
|||
"use strict"; |
|||
|
|||
var AbstractField = require('web.AbstractField'); |
|||
var field_registry = require('web.field_registry'); |
|||
var AbstractField = require('web.AbstractField'); |
|||
var field_registry = require('web.field_registry'); |
|||
|
|||
var ActionBarcodeField = AbstractField.extend({ |
|||
init: function() { |
|||
this._super.apply(this, arguments); |
|||
this.trigger_up('activeBarcode', { |
|||
name: this.name, |
|||
commands: { |
|||
barcode: '_barcodeHandleAction', |
|||
} |
|||
}); |
|||
}, |
|||
}); |
|||
field_registry.add('action_barcode_handler', ActionBarcodeField); |
|||
var ActionBarcodeField = AbstractField.extend({ |
|||
init: function () { |
|||
this._super.apply(this, arguments); |
|||
this.trigger_up('activeBarcode', { |
|||
name: this.name, |
|||
commands: { |
|||
barcode: '_barcodeHandleAction', |
|||
}, |
|||
}); |
|||
}, |
|||
}); |
|||
field_registry.add('action_barcode_handler', ActionBarcodeField); |
|||
|
|||
return { |
|||
ActionBarcodeField:ActionBarcodeField, |
|||
}; |
|||
return { |
|||
ActionBarcodeField:ActionBarcodeField, |
|||
}; |
|||
|
|||
}); |
Write
Preview
Loading…
Cancel
Save
Reference in new issue