You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
703 B

  1. odoo.define('barcode_action.form', function (require) {
  2. "use strict";
  3. var FormController = require('web.FormController');
  4. FormController.include({
  5. _barcodeHandleAction: function (barcode, activeBarcode) {
  6. var record = this.model.get(this.handle);
  7. var self = this;
  8. return self._rpc({
  9. model: record.data.model,
  10. method: record.data.method,
  11. args: [[record.data.res_id], barcode],
  12. }).done(function (action) {
  13. if (action){
  14. self._barcodeStopListening();
  15. self.do_action(action);
  16. }
  17. });
  18. },
  19. });
  20. });