Skip to content
Permalink
Browse files

🚑, pos_invoice_postponed:

added sudo() in 'models.py' for non-administrators to create session
refactoring
  • Loading branch information...
fedoranvar committed Jul 24, 2019
1 parent 6a47d10 commit 3a6ed5fd4343d310a35c37a40442a3c8ddcc8f64
@@ -16,6 +16,7 @@ Credits
Contributors
------------
* `Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>`__
* `Kildebekov Anvar <https://it-projects.info/team/kildebekov>`__

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 9998f3cd3a49429e153e4c673448f430405dc9e2
@@ -1,13 +1,14 @@
# -*- 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": """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 Kildebekov Anvar <https://it-projects.info/team/kildebekov>
# 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 3a6ed5f

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