diff --git a/.gitignore b/odex25_base/.gitignore similarity index 100% rename from .gitignore rename to odex25_base/.gitignore diff --git a/odex25_base/odex25_barcodes_mobile/__init__.py b/odex25_base/odex25_barcodes_mobile/__init__.py new file mode 100644 index 000000000..40a96afc6 --- /dev/null +++ b/odex25_base/odex25_barcodes_mobile/__init__.py @@ -0,0 +1 @@ +# -*- coding: utf-8 -*- diff --git a/odex25_base/odex25_barcodes_mobile/__manifest__.py b/odex25_base/odex25_barcodes_mobile/__manifest__.py new file mode 100644 index 000000000..4b9de76e3 --- /dev/null +++ b/odex25_base/odex25_barcodes_mobile/__manifest__.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- + +{ + 'name': 'Barcode in Mobile', + 'category': 'Hidden', + 'author': 'Expert Co. Ltd.', + 'website': 'http://www.exp-sa.com', + 'summary': 'Barcode scan in Mobile', + 'version': '1.0', + 'description': """ """, + 'depends': ['barcodes', 'odex25_web_mobile'], + 'data': ['views/odex25_barcodes_mobile_template.xml'], + 'qweb': ['static/src/xml/barcodes.xml'], + 'installable': True, + 'auto_install': True, +} diff --git a/odex25_base/odex25_barcodes_mobile/static/description/icon.png b/odex25_base/odex25_barcodes_mobile/static/description/icon.png new file mode 100644 index 000000000..4141f52da Binary files /dev/null and b/odex25_base/odex25_barcodes_mobile/static/description/icon.png differ diff --git a/odex25_base/odex25_barcodes_mobile/static/src/js/barcode_events.js b/odex25_base/odex25_barcodes_mobile/static/src/js/barcode_events.js new file mode 100644 index 000000000..87eca8440 --- /dev/null +++ b/odex25_base/odex25_barcodes_mobile/static/src/js/barcode_events.js @@ -0,0 +1,33 @@ +odoo.define('odex25_barcodes_mobile.BarcodeEvents', function (require) { +"use strict"; + +var BarcodeEvents = require('barcodes.BarcodeEvents'); + +const mobile = require('odex25_web_mobile.core'); + + +if (!mobile.methods.closeVirtualKeyboard) { + return; +} +var barcodeEvents = BarcodeEvents.BarcodeEvents; + +// Each time the input has the focus, the mobile virtual keyboard will +// be opened but we don't control exactly when. +// In some are cases, the opening is slowly deferred. The keyboard +// will appear anyway and closeVirtualKeyboard will be executed too early. +barcodeEvents.$barcodeInput.on('focus', function () { + setTimeout(mobile.methods.closeVirtualKeyboard, 0); +}); + +// On mobile app, we can keep the input focused as the virtual keyboard +// is closed by a specific method. +barcodeEvents._blurBarcodeInput = function () { + if (this.$barcodeInput) { + this.$barcodeInput.val(''); + } +} +barcodeEvents.__blurBarcodeInput = _.debounce(barcodeEvents._blurBarcodeInput, + barcodeEvents.inputTimeOut); + + +}); diff --git a/odex25_base/odex25_barcodes_mobile/static/src/js/barcode_mobile_mixin.js b/odex25_base/odex25_barcodes_mobile/static/src/js/barcode_mobile_mixin.js new file mode 100644 index 000000000..0b614b05d --- /dev/null +++ b/odex25_base/odex25_barcodes_mobile/static/src/js/barcode_mobile_mixin.js @@ -0,0 +1,28 @@ +odoo.define('odex25_web_mobile.barcode_mobile_mixin', function (require) { +"use strict"; + +const mobile = require('odex25_web_mobile.core'); + +return { + events: { + 'click .o_mobile_barcode': 'open_mobile_scanner' + }, + async start() { + const res = await this._super(...arguments); + if (!mobile.methods.scanBarcode) { + this.$el.find(".o_mobile_barcode").remove(); + } + return res; + }, + async open_mobile_scanner() { + const response = await mobile.methods.scanBarcode(); + const barcode = response.data; + if (barcode) { + this._onBarcodeScanned(barcode); + mobile.methods.vibrate({'duration': 100}); + } else { + mobile.methods.showToast({'message': 'Please, Scan again !!'}); + } + } +}; +}); diff --git a/odex25_base/odex25_barcodes_mobile/static/src/scss/barcode_mobile.css b/odex25_base/odex25_barcodes_mobile/static/src/scss/barcode_mobile.css new file mode 100644 index 000000000..c631d9d63 --- /dev/null +++ b/odex25_base/odex25_barcodes_mobile/static/src/scss/barcode_mobile.css @@ -0,0 +1,59 @@ +.o_barcode_mobile_container { + position: relative; + display: inline-block; + font-family: "Lato", sans-serif; + font-size: 1.08333333rem; + font-weight: 400; + line-height: 1.5; + color: #fff; +} +.o_barcode_mobile_container img, .o_barcode_mobile_container .o_mobile_barcode { + width: 115px; + height: 60px; +} +.o_barcode_mobile_container .o_mobile_barcode { + width: 100%; + bottom: 0; + position: absolute; + opacity: 0.75; + padding-top: 5px; +} +.o_barcode_mobile_container .o_mobile_barcode .o_barcode_mobile_camera { + margin: 5px; + font-size: 1em; +} +.o_barcode_mobile_container .o_mobile_barcode div { + font-size: 12px; +} +.o_barcode_mobile_container .o_barcode_laser { + position: absolute; + top: 50%; + left: -15px; + bottom: auto; + right: -15px; + height: 5px; + background: rgba(255, 0, 0, 0.6); + box-shadow: 0 1px 10px 1px rgba(255, 0, 0, 0.8); + animation: o_barcode_scanner_intro 1s cubic-bezier(0.6, -0.28, 0.735, 0.045) 0.4s; +} +@keyframes o_barcode_scanner_intro { + 25% { + top: 75%; + } + 50% { + top: 0; + } + 75% { + top: 100%; + } + 100% { + top: 50%; + } +} + +@media screen and (max-width: 576px) { + .o_event_barcode_bg.o_home_menu_background { + background: white; + height: 100%; + } +}/*# sourceMappingURL=barcode_mobile.css.map */ \ No newline at end of file diff --git a/odex25_base/odex25_barcodes_mobile/static/src/scss/barcode_mobile.css.map b/odex25_base/odex25_barcodes_mobile/static/src/scss/barcode_mobile.css.map new file mode 100644 index 000000000..c2e9a6371 --- /dev/null +++ b/odex25_base/odex25_barcodes_mobile/static/src/scss/barcode_mobile.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["barcode_mobile.scss","barcode_mobile.css"],"names":[],"mappings":"AAAA;EACI,kBAAA;EACA,qBAAA;EACA,+BAAA;EACA,wBAAA;EACA,gBAAA;EACA,gBAAA;EACA,WAAA;ACCJ;ADCI;EACI,YAAA;EACA,YAAA;ACCR;ADEI;EACI,WAAA;EACA,SAAA;EACA,kBAAA;EACA,aAAA;EACA,gBAAA;ACAR;ADEQ;EACI,WAAA;EACA,cAAA;ACAZ;ADGQ;EACI,eAAA;ACDZ;ADKI;EAEI,kBAAA;EACA,QAAA;EACA,WAAA;EACA,YAAA;EACA,YAAA;EAEA,WAAA;EACA,gCAAA;EACA,+CAAA;EACA,iFAAA;ACLR;ADQI;EACI;IACI,QAAA;ECNV;EDQM;IACI,MAAA;ECNV;EDQM;IACI,SAAA;ECNV;EDQM;IACI,QAAA;ECNV;AACF;;ADSA;EACI;IACI,iBAAA;IACA,YAAA;ECNN;AACF","file":"barcode_mobile.css"} \ No newline at end of file diff --git a/odex25_base/odex25_barcodes_mobile/static/src/scss/barcode_mobile.scss b/odex25_base/odex25_barcodes_mobile/static/src/scss/barcode_mobile.scss new file mode 100644 index 000000000..20fda86a7 --- /dev/null +++ b/odex25_base/odex25_barcodes_mobile/static/src/scss/barcode_mobile.scss @@ -0,0 +1,66 @@ +.o_barcode_mobile_container { + position: relative; + display: inline-block; + font-family: 'Lato', sans-serif; + font-size: 1.08333333rem; + font-weight: 400; + line-height: 1.5; + color: #fff; + + img, .o_mobile_barcode { + width: 115px; + height: 60px; + } + + .o_mobile_barcode { + width: 100%; + bottom: 0; + position: absolute; + opacity: 0.75; + padding-top: 5px; + + .o_barcode_mobile_camera { + margin: 5px; + font-size: 1em; + } + + div { + font-size: 12px; + } + } + + .o_barcode_laser { + // avoid dependencies to web file in pos + position: absolute; + top: 50%; + left: -15px; + bottom: auto; + right: -15px; + + height: 5px; + background: rgba(red, 0.6); + box-shadow: 0 1px 10px 1px rgba(red, 0.8); + animation: o_barcode_scanner_intro 1s cubic-bezier(0.6, -0.28, 0.735, 0.045) 0.4s; + } + + @keyframes o_barcode_scanner_intro { + 25% { + top: 75%; + } + 50% { + top: 0; + } + 75% { + top: 100%; + } + 100% { + top: 50%; + } + } +} +@media screen and (max-width: 576px) { + .o_event_barcode_bg.o_home_menu_background { + background: white; + height: 100%; + } +} diff --git a/odex25_base/odex25_barcodes_mobile/static/src/xml/barcodes.xml b/odex25_base/odex25_barcodes_mobile/static/src/xml/barcodes.xml new file mode 100644 index 000000000..4336852b9 --- /dev/null +++ b/odex25_base/odex25_barcodes_mobile/static/src/xml/barcodes.xml @@ -0,0 +1,15 @@ + + + + + + + + diff --git a/odex25_base/odex25_barcodes_mobile/views/odex25_barcodes_mobile_template.xml b/odex25_base/odex25_barcodes_mobile/views/odex25_barcodes_mobile_template.xml new file mode 100644 index 000000000..7f779ee52 --- /dev/null +++ b/odex25_base/odex25_barcodes_mobile/views/odex25_barcodes_mobile_template.xml @@ -0,0 +1,12 @@ + + + + + + diff --git a/odex25_base/odex25_event_barcode_mobile/__init__.py b/odex25_base/odex25_event_barcode_mobile/__init__.py new file mode 100644 index 000000000..40a96afc6 --- /dev/null +++ b/odex25_base/odex25_event_barcode_mobile/__init__.py @@ -0,0 +1 @@ +# -*- coding: utf-8 -*- diff --git a/odex25_base/odex25_event_barcode_mobile/__manifest__.py b/odex25_base/odex25_event_barcode_mobile/__manifest__.py new file mode 100644 index 000000000..fb438096a --- /dev/null +++ b/odex25_base/odex25_event_barcode_mobile/__manifest__.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- + +{ + 'name': 'Event Barcode in Mobile', + 'category': 'Odex25 Marketing/Events', + 'author': "Expert Co. Ltd.", + 'website': "http://www.exp-sa.com", + 'summary': 'Event Barcode scan in Mobile', + 'version': '1.0', + 'description': """ """, + 'depends': ['odex25_event_barcode', 'odex25_barcodes_mobile'], + 'qweb': ['static/src/xml/odex25_event_barcode_mobile.xml'], + 'data': ['views/odex25_event_barcode_mobile_template.xml'], + 'installable': True, + 'auto_install': True, +} diff --git a/odex25_base/odex25_event_barcode_mobile/i18n/ar.po b/odex25_base/odex25_event_barcode_mobile/i18n/ar.po new file mode 100644 index 000000000..ad4cfeef5 --- /dev/null +++ b/odex25_base/odex25_event_barcode_mobile/i18n/ar.po @@ -0,0 +1,35 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * odex25_event_barcode_mobile +# +# Translators: +# Mustafa Rawi , 2019 +# Martin Trigaux, 2019 +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server saas~11.5+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-09-18 10:05+0000\n" +"PO-Revision-Date: 2019-08-26 09:35+0000\n" +"Last-Translator: Martin Trigaux, 2019\n" +"Language-Team: Arabic (https://www.transifex.com/odoo/teams/41243/ar/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: ar\n" +"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n" + +#. module: odex25_event_barcode_mobile +#. openerp-web +#: code:addons/odex25_event_barcode_mobile/static/src/xml/odex25_event_barcode_mobile.xml:8 +#, python-format +msgid "Barcode" +msgstr "باركود" + +#. module: odex25_event_barcode_mobile +#. openerp-web +#: code:addons/odex25_event_barcode_mobile/static/src/xml/odex25_event_barcode_mobile.xml:7 +#, python-format +msgid "Tap to scan" +msgstr "انقر للقراءة" diff --git a/odex25_base/odex25_event_barcode_mobile/static/description/icon.png b/odex25_base/odex25_event_barcode_mobile/static/description/icon.png new file mode 100644 index 000000000..4141f52da Binary files /dev/null and b/odex25_base/odex25_event_barcode_mobile/static/description/icon.png differ diff --git a/odex25_base/odex25_event_barcode_mobile/static/src/js/odex25_event_barcode_mobile.js b/odex25_base/odex25_event_barcode_mobile/static/src/js/odex25_event_barcode_mobile.js new file mode 100644 index 000000000..8d8a2a698 --- /dev/null +++ b/odex25_base/odex25_event_barcode_mobile/static/src/js/odex25_event_barcode_mobile.js @@ -0,0 +1,10 @@ +odoo.define('web.event.barcode_mobile', function (require) { +"use strict"; + +const EventBarcodeScanView = require('odex25_event_barcode.EventScanView'); +const barcodeMobileMixin = require('odex25_web_mobile.barcode_mobile_mixin'); + +EventBarcodeScanView.include(Object.assign({}, barcodeMobileMixin, { + events: Object.assign({}, barcodeMobileMixin.events, EventBarcodeScanView.prototype.events) +})); +}); diff --git a/odex25_base/odex25_event_barcode_mobile/static/src/xml/odex25_event_barcode_mobile.xml b/odex25_base/odex25_event_barcode_mobile/static/src/xml/odex25_event_barcode_mobile.xml new file mode 100644 index 000000000..a37628f51 --- /dev/null +++ b/odex25_base/odex25_event_barcode_mobile/static/src/xml/odex25_event_barcode_mobile.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/odex25_base/odex25_event_barcode_mobile/views/odex25_event_barcode_mobile_template.xml b/odex25_base/odex25_event_barcode_mobile/views/odex25_event_barcode_mobile_template.xml new file mode 100644 index 000000000..4ceb19af7 --- /dev/null +++ b/odex25_base/odex25_event_barcode_mobile/views/odex25_event_barcode_mobile_template.xml @@ -0,0 +1,8 @@ + + + + + + +