From 12b959279daf32724b695de7b7829bf480c9e2a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Honor=C3=A9?= Date: Fri, 28 Aug 2020 08:18:47 +0200 Subject: [PATCH] [IMP] pos_timeout: black, isort, prettier --- pos_timeout/__init__.py | 1 - pos_timeout/__manifest__.py | 18 ++++-------------- pos_timeout/models/__init__.py | 1 - pos_timeout/models/pos_config.py | 9 +++++---- pos_timeout/static/src/js/pos_timeout.js | 14 ++++++-------- pos_timeout/views/templates.xml | 10 +++++----- pos_timeout/views/view_pos_config.xml | 9 +++------ setup/.setuptools-odoo-make-default-ignore | 2 ++ setup/README | 2 ++ setup/pos_timeout/odoo/__init__.py | 1 + setup/pos_timeout/odoo/addons/__init__.py | 1 + setup/pos_timeout/odoo/addons/pos_timeout | 1 + setup/pos_timeout/setup.py | 6 ++++++ 13 files changed, 36 insertions(+), 39 deletions(-) create mode 100644 setup/.setuptools-odoo-make-default-ignore create mode 100644 setup/README create mode 100644 setup/pos_timeout/odoo/__init__.py create mode 100644 setup/pos_timeout/odoo/addons/__init__.py create mode 120000 setup/pos_timeout/odoo/addons/pos_timeout create mode 100644 setup/pos_timeout/setup.py diff --git a/pos_timeout/__init__.py b/pos_timeout/__init__.py index a0fdc10f..0650744f 100644 --- a/pos_timeout/__init__.py +++ b/pos_timeout/__init__.py @@ -1,2 +1 @@ -# -*- coding: utf-8 -*- from . import models diff --git a/pos_timeout/__manifest__.py b/pos_timeout/__manifest__.py index e6ceedbb..269549ad 100644 --- a/pos_timeout/__manifest__.py +++ b/pos_timeout/__manifest__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (C) 2017 - Today: GRAP (http://www.grap.coop) # Copyright (C) 2017 - Today: Akretion (http://www.akretion.com) # @author: Sylvain LE GAL (https://twitter.com/legalsylvain) @@ -12,18 +11,9 @@ "website": "https://odoo-community.org/", "author": "GRAP, Odoo Community Association (OCA)", "license": "AGPL-3", - "depends": [ - "point_of_sale", - ], - "images": [ - "static/description/pos_config.png", - ], - "data": [ - "views/view_pos_config.xml", - "views/templates.xml", - ], - 'qweb': [ - 'static/src/xml/pos_timeout.xml', - ], + "depends": ["point_of_sale",], + "images": ["static/description/pos_config.png",], + "data": ["views/view_pos_config.xml", "views/templates.xml",], + "qweb": ["static/src/xml/pos_timeout.xml",], "installable": True, } diff --git a/pos_timeout/models/__init__.py b/pos_timeout/models/__init__.py index e77b6015..db8634ad 100644 --- a/pos_timeout/models/__init__.py +++ b/pos_timeout/models/__init__.py @@ -1,2 +1 @@ -# -*- coding: utf-8 -*- from . import pos_config diff --git a/pos_timeout/models/pos_config.py b/pos_timeout/models/pos_config.py index dba806ba..1e2ff029 100644 --- a/pos_timeout/models/pos_config.py +++ b/pos_timeout/models/pos_config.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright (C) 2018 - Today: GRAP (http://www.grap.coop) # @author: Sylvain LE GAL (https://twitter.com/legalsylvain) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). @@ -7,10 +6,11 @@ from odoo import fields, models class PosConfig(models.Model): - _inherit = 'pos.config' + _inherit = "pos.config" pos_order_timeout = fields.Integer( - string='PoS Order(s) Timeout', help="Defines the value of the" + string="PoS Order(s) Timeout", + help="Defines the value of the" " client-side timeout for the creation of PoS Order(s)" " from the POS UI.\n" " The value is expressed in seconds, for a single order.\n" @@ -19,4 +19,5 @@ class PosConfig(models.Model): " (after a long disconnection period for example, or if the previous" " call raised the timeout),\n the effective timeout value applied will" " be equal to the defined timeout value multiplied by the number of" - " orders.\n") + " orders.\n", + ) diff --git a/pos_timeout/static/src/js/pos_timeout.js b/pos_timeout/static/src/js/pos_timeout.js index a1a8787c..bf29872f 100644 --- a/pos_timeout/static/src/js/pos_timeout.js +++ b/pos_timeout/static/src/js/pos_timeout.js @@ -1,21 +1,20 @@ -/****************************************************************************** +/** **************************************************************************** Copyright (C) 2018 - Today: GRAP (http://www.grap.coop) @author: Sylvain LE GAL (https://twitter.com/legalsylvain) License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). *****************************************************************************/ -'use strict'; +"use strict"; -odoo.define('pos_timeout.models', function (require) { +odoo.define("pos_timeout.models", function(require) { + var models = require("point_of_sale.models"); - var models = require('point_of_sale.models'); - - /************************************************************************* + /** *********************************************************************** Extend module.PosModel: Overload _save_to_server to alter the timeout */ var PosModelParent = models.PosModel.prototype; models.PosModel = models.PosModel.extend({ - _save_to_server: function (orders, options) { + _save_to_server: function(orders, options) { // Get PoS Config Settings var timeout = this.config.pos_order_timeout; if (timeout > 0 && orders && orders.length) { @@ -24,5 +23,4 @@ odoo.define('pos_timeout.models', function (require) { return PosModelParent._save_to_server.apply(this, arguments); }, }); - }); diff --git a/pos_timeout/views/templates.xml b/pos_timeout/views/templates.xml index c3ed6738..49377246 100644 --- a/pos_timeout/views/templates.xml +++ b/pos_timeout/views/templates.xml @@ -1,11 +1,11 @@ - - + -