Skip to content

Commit

Permalink
Merge pull request #1 from angelmoya/9.0_ADD_stock_scanner_web
Browse files Browse the repository at this point in the history
WIP stock_scanner_web
  • Loading branch information
LoisRForgeFlow authored Nov 24, 2016
2 parents 11d4037 + 2bb3a02 commit a47ed8a
Show file tree
Hide file tree
Showing 12 changed files with 531 additions and 0 deletions.
75 changes: 75 additions & 0 deletions stock_scanner_web/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

=================
Stock Scanner Web
=================

This module extends the functionality of stock scanner play scenarios on web interface.

Configuration
=============

To configure this module, you need to:

#. Scanner Hardware

.. figure:: path/to/local/image.png
:alt: alternative description
:width: 600 px

Usage
=====

To use this module, you need to:

#. .../scanner_call/hardware_code

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/{repo_id}/{branch}

.. repo_id is available in https://github.com/OCA/maintainer-tools/blob/master/tools/repos_with_ids.txt
.. branch is "8.0" for example
Known issues / Roadmap
======================

* ...

Bug Tracker
===========

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/{project_repo}/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smashing it by providing a detailed and welcomed feedback.

Credits
=======

Images
------

* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.

Contributors
------------

* Angel Moya <[email protected]>

Maintainer
----------

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

This module is maintained by the OCA.

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

To contribute to this module, please visit https://odoo-community.org.
5 changes: 5 additions & 0 deletions stock_scanner_web/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Angel Moya <http://angelmoya.es>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import controllers
20 changes: 20 additions & 0 deletions stock_scanner_web/__openerp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Angel Moya <http://angelmoya.es>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Stock Scanner Web",
"summary": "Show scenarios from stock scanner on web app",
"version": "9.0.1.0.0",
"category": "Warehouse",
"website": "https://odoo-community.org/",
"author": "AngelMoya, Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"depends": [
"stock_scanner",
],
"data": [
"views/web_templates.xml",
],
}
5 changes: 5 additions & 0 deletions stock_scanner_web/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Angel Moya <http://angelmoya.es>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import main
41 changes: 41 additions & 0 deletions stock_scanner_web/controllers/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# -*- coding: utf-8 -*-
# Copyright 2016 Angel Moya <http://angelmoya.es>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from openerp import http
from openerp.http import request


class ScannerWeb(http.Controller):

@http.route([
'/scanner_call/<string:terminal_number>',
'/scanner_call/<string:terminal_number>/<string:action>',
'/scanner_call/<string:terminal_number>/<string:action>/<string:message>',
], website=True)
def scanner_call(self,
terminal_number='',
action='',
message=False,
type='http',
auth='public',
website=True):
scanner_hardware = request.env()['scanner.hardware'].sudo()
values = {}
try:
action = int(action)
except Exception as e:
pass
(code, result, value) = scanner_hardware.scanner_call(
terminal_number,
action,
message)
scenario = scanner_hardware.scanner_check(terminal_number)
values = {
'code': code,
'result': result,
'value': value,
'scenario': scenario,
'terminal_number': terminal_number
}
return http.request.render('stock_scanner_web.scanner_call', values)
Binary file added stock_scanner_web/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 79 additions & 0 deletions stock_scanner_web/static/description/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
124 changes: 124 additions & 0 deletions stock_scanner_web/static/description/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">Module name</h2>
<p>This module was written to extend the functionality of ... to support ... and allow you to ...</p>
</div>
</div>
</section>

<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">Installation</h2>
</div>
<div class="oe_span6">
<p class="oe_mt32">To install this module, you need to:
<ul>
<li>...</li>
</ul>
</p>
</div>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<a href="https://www.openerp.com/saas_master/demo?lang=en_US&module=crm">
<img src="crm_sc_01.png">
</a>
</div>
</div>
</div>
</section>

<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">Configuration</h2>
</div>
<div class="oe_span6">
<p class="oe_mt32">To configure this module, you need to:
<ul>
<li>...</li>
</ul>
</p>
</div>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<a href="https://www.openerp.com/saas_master/demo?lang=en_US&module=crm">
<img src="crm_sc_01.png">
</a>
</div>
</div>
</div>
</section>

<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">Usage</h2>
</div>
<div class="oe_span6">
<p class="oe_mt32">To use this module, you need to:
<ul>
<li>...</li>
</ul>
</p>
<p class="oe_mt32">For further information, please visit:
<ul>
<li><a href="https://www.odoo.com/forum/help-1">https://www.odoo.com/forum/help-1</a></li>
</ul>
</p>
</div>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<a href="https://www.openerp.com/saas_master/demo?lang=en_US&module=crm">
<img src="crm_sc_01.png">
</a>
</div>
</div>
</div>
</section>

<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">Known issues / Roadmap</h2>
</div>
<div class="oe_span6">
<p class="oe_mt32">
<ul>
<li>...</li>
</ul>
</p>
</div>
<div class="oe_span6">
<div class="oe_demo oe_picture oe_screenshot">
<a href="https://www.openerp.com/saas_master/demo?lang=en_US&module=crm">
<img src="crm_sc_01.png">
</a>
</div>
</div>
</div>
</section>

<section class="oe_container oe_dark">
<div class="oe_row">
<div class="oe_span12">
<h2 class="oe_slogan">Credits</h2>
</div>
<div class="oe_span12">
<h3>Contributors</h3>
<ul>
<li>Firstname Lastname &lt;<a href="mailto:[email protected]">[email protected]</a>&gt;</li>
</ul>
</div>
<div class="oe_span12">
<h3>Maintainer</h3>
<p>
This module is maintained by the OCA.<br/>
OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.<br/>
To contribute to this module, please visit <a href="http://odoo-community.org">http://odoo-community.org</a>.<br/>
<a href="http://odoo-community.org"><img class="oe_picture oe_centered" src="http://odoo-community.org/logo.png"></a>
</p>
</div>
</div>
</section>
6 changes: 6 additions & 0 deletions stock_scanner_web/static/src/css/stock_scanner_web.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/* Copyright <YEAR(S)> <AUTHOR(S)>
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */

.some-class {
font-size: 12pt;
}
7 changes: 7 additions & 0 deletions stock_scanner_web/static/src/js/stock_scanner_web.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/* Copyright <YEAR(S)> <AUTHOR(S)>
* License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). */

(function ($) {
"use strict";
// Script that will be loaded when document is ready
})(jQuery);
9 changes: 9 additions & 0 deletions stock_scanner_web/static/src/xml/module_name.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright <YEAR(S)> <AUTHOR(S)>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->

<template>
<t t-extend="other.qweb.template">
<!-- Your template extension -->
</t>
</template>
Loading

0 comments on commit a47ed8a

Please sign in to comment.