summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xfixco_custom/__manifest__.py1
-rw-r--r--fixco_custom/static/src/js/check_product_barcode.js76
-rw-r--r--fixco_custom/views/assets.xml7
3 files changed, 0 insertions, 84 deletions
diff --git a/fixco_custom/__manifest__.py b/fixco_custom/__manifest__.py
index b6d5aec..5d9a65a 100755
--- a/fixco_custom/__manifest__.py
+++ b/fixco_custom/__manifest__.py
@@ -10,7 +10,6 @@
'images': ['assets/favicon.ico'],
'depends': ['base', 'coupon', 'delivery', 'sale', 'sale_management', 'proweb_kartu_stok', 'base_accounting_kit'],
'data': [
- 'views/assets.xml',
'security/ir.model.access.csv',
'views/res_partner.xml',
'views/sale_order.xml',
diff --git a/fixco_custom/static/src/js/check_product_barcode.js b/fixco_custom/static/src/js/check_product_barcode.js
deleted file mode 100644
index 38a9a59..0000000
--- a/fixco_custom/static/src/js/check_product_barcode.js
+++ /dev/null
@@ -1,76 +0,0 @@
-odoo.define('indoteknik_custom.buffered_scanner', function (require) {
- 'use strict';
- console.log('✅ Mqdd_Custom JS Loaded');
-
- var GAP_MS = 120;
- var MIN_LEN = 3;
- var COMMIT_TIMEOUT = 180;
-
- var buffer = '';
- var last = 0;
- var timer = null;
-
- function reset() {
- buffer = '';
- last = 0;
- if (timer) { clearTimeout(timer); timer = null; }
- }
-
- function isCodeProduct(el) {
- return el && el instanceof HTMLInputElement && (el.name === 'code_product' || el.name === 'quantity');
- }
-
- function commit() {
- var el = document.activeElement;
- if (!isCodeProduct(el)) { reset(); return; }
- if (buffer.length >= MIN_LEN) {
- el.value = buffer;
- el.dispatchEvent(new Event('input', { bubbles: true }));
- el.dispatchEvent(new Event('change', { bubbles: true }));
- }
- reset();
- }
-
- document.addEventListener('keydown', function (e) {
- var el = document.activeElement;
- if (!isCodeProduct(el)) return;
-
- var key = e.key;
-
- // ENTER mengakhiri scan
- if (key === 'Enter') {
- e.preventDefault();
- commit();
- return;
- }
-
- // abaikan tombol kontrol (Shift, Tab, Arrow, Backspace, dll.)
- if (key.length !== 1) return;
-
- var now = performance.now();
- var gap = now - (last || now);
- last = now;
-
- if (!buffer || gap <= GAP_MS) {
- // bagian dari "scan cepat" → tangani sendiri (hindari karakter hilang)
- e.preventDefault();
- buffer += key;
-
- if (timer) clearTimeout(timer);
- timer = setTimeout(function () {
- // auto-commit jika scanner tidak mengirim Enter
- commit();
- }, COMMIT_TIMEOUT);
- } else {
- // jeda besar → kemungkinan manual. Kalau mau benar-benar melarang,
- // buka komentar 2 baris di bawah.
- // e.preventDefault();
- // e.stopPropagation();
- reset(); // keluar dari mode buffer agar manual normal
- }
- }, true);
-
- document.addEventListener('focusin', function (e) {
- if (isCodeProduct(e.target)) reset();
- }, true);
-}); \ No newline at end of file
diff --git a/fixco_custom/views/assets.xml b/fixco_custom/views/assets.xml
deleted file mode 100644
index 2ecfe3f..0000000
--- a/fixco_custom/views/assets.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<odoo>
- <template id="indoteknik_assets_backend" inherit_id="web.assets_backend" name="Mqdd Custom Backend Assets">
- <xpath expr="." position="inside">
- <script type="text/javascript" src="/fixco_custom/static/src/js/check_product_barcode.js"/>
- </xpath>
- </template>
-</odoo>