Skip to content
Permalink
Browse files

⬆️1️⃣1️⃣ pos_journal_pin

handled in  'main.js' 'get_cashier()'
added string to docs, about entering developer mode
edited commentaries (i.e. added contributors, changed ver from 10 to 11 etc.)
deleted unusable variables
'model.py' - given superuser-rights for creating pos-session
'main.js' - redefined click-event on numpad in case if payment-line is empty
'manifest.py - defined price
  • Loading branch information...
fedoranvar committed Jul 17, 2019
1 parent 9e12d72 commit ee492799f3644221af5ce403c61dcd4446ae2d0e
@@ -14,6 +14,7 @@ Credits
Contributors
------------
* `Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>`__
* `Kildebekov Anvar <https://it-projects.info/team/kildebekov>`__

Sponsors
--------
@@ -25,7 +26,7 @@ Maintainers

To get a guaranteed support
you are kindly requested to purchase the module
at `odoo apps store <https://apps.odoo.com/apps/modules/10.0/pos_journal_pin/>`__.
at `odoo apps store <https://apps.odoo.com/apps/modules/11.0/pos_journal_pin/>`__.

Thank you for understanding!

@@ -34,14 +35,14 @@ Maintainers
Further information
===================

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

HTML Description: https://apps.odoo.com/apps/modules/10.0/pos_journal_pin/
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/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>`_
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 10.0 49ca43d75cb9a97642c820c2466d454f1ce604cb
Tested on Odoo 11.0 9e12d722238fafeeabc057f5a50f7d6012f9ea4
@@ -1,21 +1,21 @@
# -*- 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",
# "live_test_url": "http://apps.it-projects.info/shop/product/DEMO-URL?version=11.0",
"images": ['images/pos_journal_pin.jpg'],
"version": "10.0.1.0.0",
"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": 9.00,
# "currency": "EUR",
"price": 80.00,
"currency": "EUR",

"depends": [
"pos_pin",
@@ -36,7 +36,7 @@
"uninstall_hook": None,

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

# "demo_title": "Ask Manager to use journal",
# "demo_addons": [
@@ -13,12 +13,13 @@ 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/10.0/pos_pin/>`_ module.
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
@@ -1,10 +1,9 @@
# -*- coding: utf-8 -*-
# Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
# 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'


@@ -25,7 +24,9 @@ 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
# 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
@@ -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;
@@ -26,7 +33,7 @@ var _t = core._t;
return this._super(id);
}
var manager_group_id = this.pos.config.group_pos_manager_id[0];
var is_manager = _.include(this.pos.cashier.groups_id, manager_group_id);
var is_manager = _.include(this.pos.get_cashier().groups_id, manager_group_id);
if (is_manager) {
return this._super(id);
}
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).

from . import test_journal_pin
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2019 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).

0 comments on commit ee49279

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