Skip to content
Permalink
Browse files

🚑 Added event handler for numpad-click;Added sudo rights for creating…

… session;Defined price for module;
  • Loading branch information...
fedoranvar committed Jul 24, 2019
1 parent b1b059d commit 9b286b8c6b5c12eeb56c2a9c3cc8d9de57bac8d2
@@ -14,6 +14,7 @@ Credits
Contributors
------------
* `Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>`__
* `Anvar Kildebekov <https://it-projects.info/team/fedoranvar>`__

Sponsors
--------
@@ -44,4 +45,4 @@ Changelog: `<doc/changelog.rst>`_

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

Tested on Odoo 10.0 49ca43d75cb9a97642c820c2466d454f1ce604cb
Tested on Odoo 10.0 2fc46a064d36d9de2c6debf9582976f938e3568b
@@ -1,21 +1,22 @@
# -*- coding: utf-8 -*-
# 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=10.0",
"images": ['images/pos_journal_pin.jpg'],
"version": "10.0.1.0.0",
"version": "10.0.1.0.1",
"application": False,

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

"depends": [
"pos_pin",
@@ -1,3 +1,9 @@
`1.0.1`
-------

- **Fix:** Adding first payment line by clicking numpad button, without asking manager's PIN, if first payment method in list require manager's PIN
- **Fix:** Creating sessions by non-administrators

`1.0.0`
-------

@@ -19,6 +19,7 @@ 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
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2018 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
@@ -25,7 +26,7 @@ def open_session_cb(self):

def init_pin_journal(self):
"""Init demo Journals for current company"""
demo_is_on = self.env['ir.module.module'].search([('name', '=', MODULE)]).demo
demo_is_on = self.env['ir.module.module'].sudo().search([('name', '=', MODULE)]).demo # Using sudo() for superuser-rights for creating pos-session
if not demo_is_on:
return
# Multi-company is not primary task for this module, but I copied this
@@ -1,4 +1,5 @@
// 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).
odoo.define('pos_journal_pin', function (require) {
'use_strict';
@@ -7,12 +8,18 @@ var core = require('web.core');
var models = require('point_of_sale.models');
var screens = require('point_of_sale.screens');

var QWeb = core.qweb;
var _t = core._t;

models.load_fields('account.journal', ['ask_manager']);

screens.PaymentScreenWidget.include({
click_numpad: function(button) {
var paymentlines = this.pos.get_order().get_paymentlines();
if (paymentlines.length || !this.pos.cashregisters[0].journal.ask_manager) {
return this._super(button);
}
this.click_paymentmethods(this.pos.cashregisters[0].journal_id[0]);
},
click_paymentmethods: function(id) {
var self = this;
var cashregister = null;

0 comments on commit 9b286b8

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