Skip to content
Permalink
Browse files

⬆️1️⃣1️⃣, pos_invoice_postponed

'models.py' - added pre-func 'list' to 'filter' of 'postponed_payments';
Deleted unused variables;
Edited commentaries in files (i.e. changed version from 10 to 11, added contributors etc.);
model
Given sudo-rights to users for creating pos-session
  • Loading branch information...
fedoranvar committed Jul 22, 2019
1 parent 9e12d72 commit 135edd25c20e1d932f073e03a3114dbc240fea4b
@@ -16,6 +16,7 @@ Credits
Contributors
------------
* `Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>`__
* `Kildebekov Anvar <https://it-projects.info/team/kildebekov>`__

Sponsors
--------
@@ -27,7 +28,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//>`__.
at `odoo apps store <https://apps.odoo.com/apps/modules/11.0//>`__.

Thank you for understanding!

@@ -36,14 +37,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_invoice_postponed/
HTML Description: https://apps.odoo.com/apps/modules/11.0/pos_invoice_postponed/

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

Tested on Odoo 10.0 49ca43d75cb9a97642c820c2466d454f1ce604cb
Tested on Odoo 11.0 06569efca35ef1eee119a1f9c3f73cf79fb70718
@@ -1,13 +1,13 @@
# -*- 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": "11.0.1.0.0",
"application": False,

"author": "IT-Projects LLC, Kolushov Alexandr",
@@ -36,7 +36,7 @@
"uninstall_hook": None,

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

# "demo_title": "Creation of Postponed invoices in POS",
# "demo_addons": [
@@ -1,5 +1,5 @@
# -*- 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
@@ -25,7 +25,8 @@ def _process_order(self, order):
if not float_is_zero(order['amount_paid'], account_precision):
acc_journal = self.env['account.journal']
payments = order.get('statement_ids')
postponed_payments = filter(lambda x: acc_journal.browse(x[2]['journal_id']).postponed_invoice, payments)
postponed_payments = list(filter(lambda x: acc_journal.browse(x[2]['journal_id']).postponed_invoice, payments))

if postponed_payments:
user_id = self.env['res.users'].browse(order['user_id'])
partner_id = self.env['res.partner'].browse(order['partner_id'])
@@ -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
if not demo_is_on:
return
# Multi-company is not primary task for this module, but I copied this
@@ -1,19 +1,14 @@
/* 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). */
odoo.define('pos_invoice_postponed.pos', function (require) {
"use strict";

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']);

@@ -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).

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--Copyright 2019 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).-->
<odoo>
<template id="assets" inherit_id="point_of_sale.assets">

0 comments on commit 135edd2

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