Skip to content
Permalink
Browse files

🚑 added sudo() in 'models.py' for non-administrators to create session;

  • Loading branch information...
fedoranvar committed Jul 24, 2019
1 parent b1b059d commit 4c63394a75bc256897eaea58690f6b8b3370e22d
@@ -16,6 +16,7 @@ Credits
Contributors
------------
* `Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>`__
* `Anvar Kildebekov <https://it-projects.info/team/fedoranvar>`__

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

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

Tested on Odoo 10.0 49ca43d75cb9a97642c820c2466d454f1ce604cb
Tested on Odoo 10.0 2fc46a064d36d9de2c6debf9582976f938e3568b
@@ -1,13 +1,14 @@
# -*- coding: utf-8 -*-
# Copyright 2019 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
# Copyright 2019 Anvar Kildebekov <https://it-projects.info/team/fedoranvar>
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
{
"name": """Creation of Postponed invoices in POS""",
"summary": """This module allows the usage of a regular POS order payment process to create an invoice to be paid later""",
"category": "Point of Sale",
# "live_test_url": "http://apps.it-projects.info/shop/product/DEMO-URL?version=10.0",
"images": ['images/postponed2.jpg'],
"version": "10.0.1.0.0",
"version": "10.0.1.0.1",
"application": False,

"author": "IT-Projects LLC, Kolushov Alexandr",
@@ -1,3 +1,8 @@
`1.0.1`
-------

- **Fix:** Creating of session by non-administrators

`1.0.0`
-------

@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2019 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
# Copyright 2019 Anvar Kildebekov <https://it-projects.info/team/fedoranvar>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

import copy
@@ -99,7 +100,7 @@ def open_session_cb(self):

def init_postponed_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
@@ -6,14 +6,8 @@ odoo.define('pos_invoice_postponed.pos', function (require) {
var models = require('point_of_sale.models');
var screens = require('point_of_sale.screens');
var core = require('web.core');
var gui = require('point_of_sale.gui');
var utils = require('web.utils');
var Model = require('web.DataModel');
var PopupWidget = require('point_of_sale.popups');

var QWeb = core.qweb;
var _t = core._t;
var round_pr = utils.round_precision;

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

0 comments on commit 4c63394

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