-
-
Notifications
You must be signed in to change notification settings - Fork 585
12.0 pos qr scan barcode3 #1178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
KolushovAlexandr
wants to merge
5
commits into
itpp-labs:12.0
Choose a base branch
from
KolushovAlexandr:12.0-pos_qr_scan-barcode3
base: 12.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a9e8289
:ambulance: pos_qr_scan: fixed ReferenceError: gCtx is not defined
em230418 68a1f0d
:book: pos_qr_scan: added reference about insecure contexts
em230418 e01d0bc
:sparkles: pos_qr_scan barcode scanning ability
KolushovAlexandr 4cee446
:tada::one::two: pos_clientlist_scan_button
KolushovAlexandr a633afb
:zap: another barcode lib
KolushovAlexandr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
.. image:: https://img.shields.io/badge/license-LGPL--3-blue.png | ||
:target: https://www.gnu.org/licenses/lgpl | ||
:alt: License: LGPL-3 | ||
|
||
============================ | ||
Pos Clientlist Scan Button | ||
============================ | ||
|
||
Adds scan button for some fields on clientlist screen | ||
|
||
Adds scan button for some fields on clientlist screen | ||
|
||
Credits | ||
======= | ||
|
||
Contributors | ||
------------ | ||
* `Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>`__: | ||
|
||
* :one::zero: init version of the module | ||
|
||
Sponsors | ||
-------- | ||
* `IT-Projects LLC <https://it-projects.info>`__ | ||
|
||
Maintainers | ||
----------- | ||
* `IT-Projects LLC <https://it-projects.info>`__ | ||
|
||
To get a guaranteed support | ||
you are kindly requested to purchase the module | ||
at `odoo apps store <https://apps.odoo.com/apps/modules/12.0/pos_clientlist_scan_button/>`__. | ||
|
||
Thank you for understanding! | ||
|
||
`IT-Projects Team <https://www.it-projects.info/team>`__ | ||
|
||
Further information | ||
=================== | ||
|
||
Demo: http://runbot.it-projects.info/demo/pos-addons/12.0 | ||
|
||
HTML Description: https://apps.odoo.com/apps/modules/12.0/pos_clientlist_scan_button/ | ||
|
||
Usage instructions: `<doc/index.rst>`_ | ||
|
||
Changelog: `<doc/changelog.rst>`_ | ||
|
||
Notifications on updates: `via Atom <https://github.com/it-projects-llc/pos-addons/commits/12.0/pos_clientlist_scan_button.atom>`_, `by Email <https://blogtrottr.com/?subscribe=https://github.com/it-projects-llc/pos-addons/commits/12.0/pos_clientlist_scan_button.atom>`_ | ||
|
||
Tested on Odoo 12.0 3d0f8d07a494997be96868dd609bf4cc2ccc750c |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Copyright 2019 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr> | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). | ||
|
||
{ | ||
"name": """pos_clientlist_scan_button""", | ||
"summary": """Adds scan button for some fields on clientlist screen""", | ||
"category": "Point of Sale", | ||
# "live_test_url": "http://apps.it-projects.info/shop/product/DEMO-URL?version=12.0", | ||
"images": [], | ||
"version": "12.0.1.0.0", | ||
"application": False, | ||
|
||
"author": "IT-Projects LLC, Kolushov Alexandr", | ||
"support": "[email protected]", | ||
"website": "https://apps.odoo.com/apps/modules/12.0/pos_clientlist_scan_button/", | ||
"license": "LGPL-3", | ||
# "price": 9.00, | ||
# "currency": "EUR", | ||
|
||
"depends": [ | ||
'pos_qr_scan', | ||
], | ||
"external_dependencies": {"python": [], "bin": []}, | ||
"data": [ | ||
'views/assets.xml', | ||
], | ||
"demo": [ | ||
], | ||
"qweb": [ | ||
'static/src/xml/clientlist.xml', | ||
], | ||
|
||
"post_load": None, | ||
"pre_init_hook": None, | ||
"post_init_hook": None, | ||
"uninstall_hook": None, | ||
|
||
"auto_install": False, | ||
"installable": True, | ||
|
||
# "demo_title": "pos_clientlist_scan_button", | ||
# "demo_addons": [ | ||
# ], | ||
# "demo_addons_hidden": [ | ||
# ], | ||
# "demo_url": "DEMO-URL", | ||
# "demo_summary": "Adds scan button for some fields on clientlist screen", | ||
# "demo_images": [ | ||
# "images/MAIN_IMAGE", | ||
# ] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
`1.0.0` | ||
------- | ||
|
||
- **Init version** | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
============================ | ||
Pos Clientlist Scan Button | ||
============================ | ||
|
||
Installation | ||
============ | ||
{Instruction about things to do before actual installation} | ||
|
||
* {OPTIONAL }`Activate longpolling <https://odoo-development.readthedocs.io/en/latest/admin/longpolling.html>`__ | ||
* {Additional notes if any} | ||
* `Install <https://odoo-development.readthedocs.io/en/latest/odoo/usage/install-module.html>`__ this module in a usual way | ||
|
||
Configuration | ||
============= | ||
|
||
{Instruction how to configure the module before start to use it} | ||
|
||
* `Log in as SUPERUSER <https://odoo-development.readthedocs.io/en/latest/odoo/usage/login-as-superuser.html>`__ | ||
* `Activate Developer Mode <https://odoo-development.readthedocs.io/en/latest/odoo/usage/debug-mode.html>`__ | ||
* Open menu ``[[ {Menu} ]] >> {Submenu} >> {Subsubmenu}`` | ||
* Click ``[{Button Name}]`` | ||
|
||
Usage | ||
===== | ||
|
||
{Instruction for daily usage. It should describe how to check that module works. What shall user do and what would user get.} | ||
|
||
* Open menu ``[[ {Menu} ]]>> {Submenu} >> {Subsubmenu}`` | ||
* Click ``[{Button Name}]`` | ||
* RESULT: {what user gets, how the modules changes default behaviour} | ||
|
||
Uninstallation | ||
============== | ||
|
||
{Optional section for uninstallation notes. Delete it if you don't have notes for uninstallation.} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* Copyright 2019 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr> | ||
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html). */ | ||
odoo.define('pos_clientlist_scan_button.pos', function (require) { | ||
"use strict"; | ||
|
||
var screens = require('point_of_sale.screens'); | ||
|
||
screens.ClientListScreenWidget.include({ | ||
|
||
display_client_details: function(visibility, partner, clickpos){ | ||
var self = this; | ||
this._super(visibility, partner, clickpos); | ||
var $buttons = this.$el.find('.button.scan').off(); | ||
if(visibility === 'edit'){ | ||
$buttons.on('click', function(ev) { | ||
var field = this.attributes.data.value; | ||
self.gui.show_popup('qr_scan', { | ||
read_callback: self.scan_callback, | ||
field: field, | ||
ClientListScreenWidget: self | ||
}); | ||
}); | ||
} | ||
}, | ||
|
||
scan_callback: function(value, method) { | ||
if (this.pos.debug){ | ||
console.log(method.toUpperCase() + ' scanned', value); | ||
} | ||
var $input = this.options.ClientListScreenWidget.$el.find('input.' + this.options.field); | ||
if ($input) { | ||
$input.val(value); | ||
} | ||
this.click_cancel(); | ||
}, | ||
}); | ||
|
||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!--Copyright 2019 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr> | ||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). --> | ||
<templates> | ||
|
||
<t t-extend="ClientDetailsEdit"> | ||
<t t-jquery="input.detail.barcode" t-operation="after"> | ||
<span class='button scan barcode' data="barcode"><i class='fa fa-qrcode' role="img" aria-label="Scan" title="Scan"/></span> | ||
</t> | ||
|
||
<t t-jquery="input.detail.vat" t-operation="after"> | ||
<span class='button scan' data="vat"><i class='fa fa-qrcode' role="img" aria-label="Scan" title="Scan"/></span> | ||
</t> | ||
</t> | ||
|
||
</templates> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!-- Copyright 2019 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr> | ||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). --> | ||
<odoo> | ||
|
||
<template id="pos" inherit_id="web.assets_backend"> | ||
<xpath expr="." position="inside"> | ||
<script type="text/javascript" src="/pos_clientlist_scan_button/static/src/js/pos.js"></script> | ||
</xpath> | ||
</template> | ||
|
||
</odoo> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). | ||
|
||
from . import models |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html) | ||
|
||
from . import pos_config |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright 2019 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr> | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). | ||
|
||
from odoo import api, fields, models | ||
|
||
|
||
class PosConfig(models.Model): | ||
_inherit = 'pos.config' | ||
|
||
use_only_qr_scan = fields.Boolean('Only QR scanning') | ||
use_only_barcode_scan = fields.Boolean('Only Barcode scanning') | ||
|
||
@api.onchange('use_only_qr_scan') | ||
def _onchange_use_only_qr_scan(self): | ||
if self.use_only_qr_scan: | ||
self.use_only_barcode_scan = False | ||
|
||
@api.onchange('use_only_barcode_scan') | ||
def _onchange_use_only_barcode_scan(self): | ||
if self.use_only_barcode_scan: | ||
self.use_only_qr_scan = False |
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.