Skip to content
Permalink
Browse files

Merge remote-tracking branch 'upstream/11.0' into 12.0-automerge-1127…

…f4f8d142b99fb8063e149f4963177d7025aa
  • Loading branch information...
root
root committed Aug 7, 2019
2 parents b9e93a0 + 1127f4f commit c39a74aabf8a94b205adec540dbf28b7b4247324
Showing with 750 additions and 30 deletions.
  1. +5 −0 .travis.yml
  2. +48 −0 pos_journal_pin/README.rst
  3. +3 −0 pos_journal_pin/__init__.py
  4. +51 −0 pos_journal_pin/__manifest__.py
  5. +4 −0 pos_journal_pin/doc/changelog.rst
  6. +39 −0 pos_journal_pin/doc/index.rst
  7. BIN pos_journal_pin/images/pos_journal_pin.jpg
  8. +3 −0 pos_journal_pin/models/__init__.py
  9. +100 −0 pos_journal_pin/models/models.py
  10. BIN pos_journal_pin/static/description/config.png
  11. BIN pos_journal_pin/static/description/icon.png
  12. +107 −0 pos_journal_pin/static/description/index.html
  13. BIN pos_journal_pin/static/description/payment.png
  14. +52 −0 pos_journal_pin/static/src/js/main.js
  15. +66 −0 pos_journal_pin/static/src/js/test_pos_journal_pin.js
  16. +3 −0 pos_journal_pin/tests/__init__.py
  17. +18 −0 pos_journal_pin/tests/test_journal_pin.py
  18. +15 −0 pos_journal_pin/views/assets.xml
  19. +15 −0 pos_journal_pin/views/views.xml
  20. +1 −1 pos_mobile/views/pos_mobile_template.xml
  21. +1 −1 pos_multi_session_sync/__manifest__.py
  22. BIN pos_multi_session_sync/images/pos_multi_session_sync.jpg
  23. +2 −0 pos_order_cancel/__init__.py
  24. +6 −0 pos_order_cancel/__manifest__.py
  25. +2 −0 pos_order_cancel/data/pos_cancelled_reason_demo.xml
  26. +2 −0 pos_order_cancel/models/__init__.py
  27. +5 −0 pos_order_cancel/models/models.py
  28. +3 −0 pos_order_cancel/security/security.xml
  29. +4 −0 pos_order_cancel/static/src/js/models.js
  30. +4 −0 pos_order_cancel/static/src/js/tour.js
  31. +5 −0 pos_order_cancel/static/src/js/widgets.js
  32. +3 −0 pos_order_cancel/static/src/xml/cancel_order.xml
  33. +2 −0 pos_order_cancel/tests/__init__.py
  34. +6 −0 pos_order_cancel/tests/test_default.py
  35. +2 −0 pos_order_cancel/views/assets_demo.xml
  36. +4 −0 pos_order_cancel/views/pos_config_view.xml
  37. +2 −0 pos_order_cancel/views/template.xml
  38. +4 −0 pos_order_cancel/views/views.xml
  39. +2 −0 pos_order_cancel_restaurant/__init__.py
  40. +2 −0 pos_order_cancel_restaurant/data/pos_cancelled_reason_demo.xml
  41. +2 −0 pos_order_cancel_restaurant/models/__init__.py
  42. +5 −0 pos_order_cancel_restaurant/models/models.py
  43. +3 −0 pos_order_cancel_restaurant/static/src/js/models.js
  44. +4 −0 pos_order_cancel_restaurant/static/src/js/tour.js
  45. +3 −0 pos_order_cancel_restaurant/static/src/js/widgets.js
  46. +2 −0 pos_order_cancel_restaurant/static/src/xml/cancel_order.xml
  47. +2 −0 pos_order_cancel_restaurant/tests/__init__.py
  48. +5 −0 pos_order_cancel_restaurant/tests/test_default.py
  49. +2 −0 pos_order_cancel_restaurant/views/template.xml
  50. +4 −0 pos_order_cancel_restaurant/views/views.xml
  51. +1 −0 pos_pin/__manifest__.py
  52. BIN pos_pin/images/pos_pin.jpg
  53. +2 −0 pos_product_available/__init__.py
  54. +3 −2 pos_product_available/__manifest__.py
  55. +3 −3 pos_product_available/doc/changelog.rst
  56. +2 −0 pos_product_available/models/__init__.py
  57. +10 −0 pos_product_available/models/models.py
  58. +3 −3 pos_product_available/static/src/xml/pos.xml
  59. +24 −0 pos_product_available/views/views.xml
  60. +4 −4 pos_product_available_negative/__manifest__.py
  61. +5 −3 pos_product_available_negative/doc/changelog.rst
  62. +10 −2 pos_product_available_negative/models.py
  63. +32 −3 pos_product_available_negative/static/src/js/pos.js
  64. +27 −7 pos_product_available_negative/views.xml
  65. +1 −1 pos_scan_ref/__manifest__.py
  66. BIN pos_scan_ref/images/pos_scan_ref.jpg
@@ -22,6 +22,7 @@ env:

matrix:
- LINT_CHECK="1"
- CHECK_TAGS="1"
- TESTS="1" ODOO_REPO="odoo/odoo" MAKEPOT="1"
- TESTS="1" ODOO_REPO="OCA/OCB""

@@ -40,3 +41,7 @@ after_success:

notifications:
email: false
webhooks:
on_failure: change
urls:
- "https://ci.it-projects.info/travis/on_failure/change"
@@ -0,0 +1,48 @@
.. image:: https://img.shields.io/badge/license-LGPL--3-blue.png
:target: https://www.gnu.org/licenses/lgpl
:alt: License: LGPL-3

===============================
POS Payments by Manager's PIN
===============================

The module requires POS manager's permission, which can be attained by entering PIN prior the usage of the journal.

Credits
=======

Contributors
------------
* `Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>`__
* `Kildebekov Anvar <https://it-projects.info/team/kildebekov>`__

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/11.0/pos_journal_pin/>`__.

Thank you for understanding!

`IT-Projects Team <https://www.it-projects.info/team>`__

Further information
===================

Demo: http://runbot.it-projects.info/demo/pos-addons/11.0

HTML Description: https://apps.odoo.com/apps/modules/11.0/pos_journal_pin/

Usage instructions: `<doc/index.rst>`_

Changelog: `<doc/changelog.rst>`_

Notifications on updates: `via Atom <https://github.com/it-projects-llc/pos-addons/commits/11.0/pos_journal_pin.atom>`_, `by Email <https://blogtrottr.com/?subscribe=https://github.com/it-projects-llc/pos-addons/commits/11.0/pos_journal_pin.atom>`_

Tested on Odoo 11.0 9e12d722238fafeeabc057f5a50f7d6012f9ea4
@@ -0,0 +1,3 @@
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).

from . import models
@@ -0,0 +1,51 @@
# Copyright 2019 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
# Copyright 2019 Kildebekov Anvar <https://it-projects.info/team/kildebekov>
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
{
"name": """POS Payments by Manager's PIN""",
"summary": """Ask for manager permission before use the journal""",
"category": "Point of Sale",
# "live_test_url": "http://apps.it-projects.info/shop/product/DEMO-URL?version=11.0",
"images": ['images/pos_journal_pin.jpg'],
"version": "11.0.1.0.0",
"application": False,

"author": "IT-Projects LLC, Kolushov Alexandr",
"support": "apps@it-projects.info",
"website": "https://it-projects.info/team/KolushovAlexandr",
"license": "LGPL-3",
"price": 80.00,
"currency": "EUR",

"depends": [
"pos_pin",
],
"external_dependencies": {"python": [], "bin": []},
"data": [
"views/assets.xml",
"views/views.xml",
],
"demo": [
],
"qweb": [
],

"post_load": None,
"pre_init_hook": None,
"post_init_hook": None,
"uninstall_hook": None,

"auto_install": False,
"installable": True,

# "demo_title": "Ask Manager to use journal",
# "demo_addons": [
# ],
# "demo_addons_hidden": [
# ],
# "demo_url": "DEMO-URL",
# "demo_summary": "Ask Manager to use journal",
# "demo_images": [
# "images/MAIN_IMAGE",
# ]
}
@@ -0,0 +1,4 @@
`1.0.0`
-------

- **Init version**
@@ -0,0 +1,39 @@
===============================
POS Payments by Manager's PIN
===============================

Installation
============
* `Install <https://odoo-development.readthedocs.io/en/latest/odoo/usage/install-module.html>`__ this module in a usual way


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

Manager's PIN
-------------

Set a PIN for a POS manager as it's explained in `Confirm POS action by PIN <https://apps.odoo.com/apps/modules/11.0/pos_pin/>`_ module.
As Administrator please follow next scenario:

Journal
-------

* `Activate Developer Mode <https://odoo-development.readthedocs.io/en/latest/odoo/usage/debug-mode.html>`__
* Open ``[[Point of Sale]] >> Payment Methods`` menu
* Choose a journal or create one, be sure the journal is active in POS
* Activate **Manager's Permission** field

Usage
=====

* Go to ``[[Point of Sale]]`` menu
* Open a POS session

* Click ``[Payment]``
* Select and click a payment method with enabled **Manager's Permission** option
* Select a POS manager from the appeared list
* Enter his/her password
* Click ``[Ok]``

* RESULT: Payment line with selected payment method is added.
Binary file not shown.
@@ -0,0 +1,3 @@
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).

from . import models
@@ -0,0 +1,100 @@
# Copyright 2019 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
# Copyright 2019 Kildebekov Anvar <https://it-projects.info/team/kildebekov>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

from odoo import models, fields, api

MODULE = 'pos_journal_pin'


class AccountInvoice(models.Model):
_inherit = 'account.journal'

ask_manager = fields.Boolean("Manager's permission", help="Ask for Manager's permission to use the journal in POS")


class PosConfig(models.Model):
_inherit = 'pos.config'

@api.multi
def open_session_cb(self):
res = super(PosConfig, self).open_session_cb()
self.init_pin_journal()
return res

def init_pin_journal(self):
"""Init demo Journals for current company"""
# Access rejection of demo user, "*.sudo().*" - superuser-rights for creating session
demo_is_on = self.env['ir.module.module'].sudo().search([('name', '=', MODULE)]).demo

if not demo_is_on:
return
# Multi-company is not primary task for this module, but I copied this
# code from pos_debt_notebook, so why not
journal_obj = self.env['account.journal']
user = self.env.user
pin_journal_active = journal_obj.search([
('company_id', '=', user.company_id.id),
('ask_manager', '!=', False),
])
if pin_journal_active:
return

pin_journal = self._create_pin_journal(dict(
sequence_name='Pin to Pay',
prefix='PINNED-- ',
journal_name='Pin to Pay',
code='PINNED',
noupdate=True,
type='cash',
write_statement=demo_is_on,
))
self.write({
'journal_ids': [(4, pin_journal.id)],
})
return

def _create_pin_journal(self, vals):
user = self.env.user
new_sequence = self.env['ir.sequence'].create({
'name': vals['sequence_name'] + str(user.company_id.id),
'padding': 3,
'prefix': vals['prefix'] + str(user.company_id.id),
})
self.env['ir.model.data'].create({
'name': 'journal_sequence' + str(new_sequence.id),
'model': 'ir.sequence',
'module': MODULE,
'res_id': new_sequence.id,
'noupdate': True, # If it's False, target record (res_id) will be removed while module update
})
pin_journal = self.env['account.journal'].create({
'name': vals['journal_name'],
'code': vals['code'],
'type': vals['type'],
'journal_user': True,
'sequence_id': new_sequence.id,
'ask_manager': True,
})
self.env['ir.model.data'].create({
'name': 'pin_journal_' + str(pin_journal.id),
'model': 'account.journal',
'module': MODULE,
'res_id': int(pin_journal.id),
'noupdate': True, # If it's False, target record (res_id) will be removed while module update
})
if vals['write_statement']:
self.write({
'journal_ids': [(4, pin_journal.id)],
})
current_session = self.current_session_id
statement = [(0, 0, {
'name': current_session.name,
'journal_id': pin_journal.id,
'user_id': user.id,
'company_id': user.company_id.id
})]
current_session.write({
'statement_ids': statement,
})
return pin_journal
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,107 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan" style="color:#875A7B;">POS Payments by Manager's PIN</h2>
<h3 class="oe_slogan">The module requires POS manager's permission, which can be attained by entering PIN prior the usage of the journal.</h3>
</div>
</div>
</section>

<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<p class="oe_mt32">
<div class="alert alert-warning" style="padding:0.3em 0.6em; font-size: 150%;">
This is a good solution if you want to restrict the option of choosing the payment methods by usual staff members to improve customer service and cost savings to business owners achieved by micro-controlling.
</div>
</p>
</div>
</div>
</section>

<section class="oe_container oe_dark">
<div class="oe_row oe_spaced">
<h3 class="oe_slogan">How It Works</h3>
<div class="oe_span12">
<p class="oe_mt32">
<font style="font-size: 120%;">
<ul>
<li>Set a PIN for a POS Manager</li>
<li>Activate Manager's Permission</li>
</ul>
</font>
</p>
</div>
<div class="oe_screenshot" align="center">
<img style="max-width: 60%" src="config.png"/>
</div>

<div class="oe_span12">
<p class="oe_mt32">
<font style="font-size: 120%;">
<ul>
<li>Select and click a payment method with enabled <i>Manager's Permission</i> option</li>
<li>Choose the Manager and enter his/her PIN and confirm</li>
<li><b>Payment line with selected payment method is added</b></li>
</ul>
</font>
</p>
</div>
<div class="oe_screenshot" align="center">
<img style="max-width: 70%" src="payment.png"/>
</div>
</div>
</section>

<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span8">
<h2>Need our service?</h2>
<p class="oe_mt32">Contact us by <a href="mailto:apps@it-projects.info">email</a> or fill out <a href="https://www.it-projects.info/page/website.contactus " target="_blank">request form</a></p>
<ul>
<li><a href="mailto:apps@it-projects.info">apps@it-projects.info <i class="fa fa-envelope-o"></i></a></li>
<li><a href="https://www.it-projects.info/page/website.contactus " target="_blank">https://www.it-projects.info/page/website.contactus <i class="fa fa-list-alt"></i></a></li>
<li><a href="https://m.me/itprojectsllc" target="_blank">https://m.me/itprojectsllc <i class="fa fa-facebook-square"></i></a></li>
<li>skype@it-projects.info <i class="fa fa-skype"></i></li>
</ul>
</div>
<div class="oe_span4">
<div class="stamp" style="width:200px;">
<div style="margin-top: 15px;
position: relative;
font-family:'Vollkorn', serif;
font-size: 16px;
line-height: 25px;
text-transform: uppercase;
font-weight: bold;
color: #75526b;
border: 3px dashed #75526b;
float: left;
padding: 4px 12px;
-webkit-transform: rotate(8deg);
-o-transform: rotate(8deg);
-moz-transform: rotate(8deg);
-ms-transform: rotate(8deg);">
Tested on Odoo<br/>10.0 community
</div>
<!--<div style="margin-top: 15px;
position: relative;
font-family:'Vollkorn', serif;
font-size: 16px;
line-height: 25px;
text-transform: uppercase;
font-weight: bold;
color: #75526b;
border: 3px dashed #75526b;
float: left;
padding: 4px 12px;
-webkit-transform: rotate(6deg);
-o-transform: rotate(6deg);
-moz-transform: rotate(6deg);
-ms-transform: rotate(6deg);">
Tested on Odoo<br/>10.0 enterprise
</div>-->
</div>
</div>
</div>
</section>
Binary file not shown.

0 comments on commit c39a74a

Please sign in to comment.
You can’t perform that action at this time.