Browse Source

Merge PR #453 into 12.0

Signed-off-by legalsylvain
pull/461/head
OCA-git-bot 4 years ago
parent
commit
23822782b8
  1. 0
      pos_empty_home/__init__.py
  2. 24
      pos_empty_home/__manifest__.py
  3. 30
      pos_empty_home/i18n/ca.po
  4. 28
      pos_empty_home/i18n/fr.po
  5. 22
      pos_empty_home/i18n/pos_empty_home.pot
  6. 2
      pos_empty_home/readme/CONTRIBUTORS.rst
  7. 13
      pos_empty_home/readme/DESCRIPTION.rst
  8. BIN
      pos_empty_home/static/description/icon.png
  9. BIN
      pos_empty_home/static/description/pos_empty_home.png
  10. 11
      pos_empty_home/static/src/css/pos_empty_home.css
  11. 25
      pos_empty_home/static/src/js/db.js
  12. 26
      pos_empty_home/static/src/js/screens.js
  13. 19
      pos_empty_home/static/src/xml/pos_empty_home.xml
  14. 19
      pos_empty_home/views/assets.xml

0
pos_empty_home/__init__.py

24
pos_empty_home/__manifest__.py

@ -0,0 +1,24 @@
# Copyright (C) 2017-Today: La Louve (<http://www.lalouve.net/>)
# Copyright (C) 2020-Today: Druidoo (<https://www.druidoo.io>)
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Point of Sale - Empty Home',
'version': '12.0.1.0.0',
'category': 'Point Of Sale',
'summary': '''
Point of Sale - Hide products at the start of the Point of Sale''',
'author': 'La Louve, GRAP, Odoo Community Association (OCA)',
'website': 'https://github.com/OCA/pos',
'license': 'AGPL-3',
'depends': [
'point_of_sale',
],
'data': [
'views/assets.xml',
],
'qweb': [
'static/src/xml/pos_empty_home.xml',
],
}

30
pos_empty_home/i18n/ca.po

@ -0,0 +1,30 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_empty_home
#
# Translators:
# Marc Tormo i Bochaca <mtbochaca@gmail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-09 03:08+0000\n"
"PO-Revision-Date: 2017-06-09 03:08+0000\n"
"Last-Translator: Marc Tormo i Bochaca <mtbochaca@gmail.com>, 2017\n"
"Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n"
"Language: ca\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. module: pos_empty_home
#. openerp-web
#: code:addons/pos_empty_home/static/src/xml/pos_empty_home.xml:12
#, python-format
msgid ""
"To select a product, please scan a barcode or search products by category or "
"by name"
msgstr ""
"Per seleccionar un producte, si us plau llegiu un codi de barres o cerqueu "
"un producte per categoria o per nom. "

28
pos_empty_home/i18n/fr.po

@ -0,0 +1,28 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_empty_home
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0c\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-05-05 09:32+0000\n"
"PO-Revision-Date: 2017-05-05 09:32+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: pos_empty_home
#. openerp-web
#: code:addons/pos_empty_home/static/src/xml/pos_empty_home.xml:12
#, python-format
msgid ""
"To select a product, please scan a barcode or search products by category or "
"by name"
msgstr ""
"Pour sélectionner un produit, veuillez scanner un code barre, ou bien "
"réaliser une recherche de produits par catégorie ou par nom"

22
pos_empty_home/i18n/pos_empty_home.pot

@ -0,0 +1,22 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * pos_empty_home
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0c\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: pos_empty_home
#. openerp-web
#: code:addons/pos_empty_home/static/src/xml/pos_empty_home.xml:12
#, python-format
msgid "To select a product, please scan a barcode or search products by category or by name"
msgstr ""

2
pos_empty_home/readme/CONTRIBUTORS.rst

@ -0,0 +1,2 @@
* Sylvain LE GAL <https://twitter.com/legalsylvain>
* Druidoo <https://www.druidoo.io>

13
pos_empty_home/readme/DESCRIPTION.rst

@ -0,0 +1,13 @@
This module extends Odoo Point Of Sale features, displaying an empty home page
at the start of the Point of Sale, or when no search is done and no category
is selected. (when root category is selected)
This module is interesting to avoid to display useless products, when user did
not yet realized a search. (Default displayed products are just the first
eighty products)
It can limits errors to avoid users to select undesired product.
.. image:: ../static/description/pos_empty_home.png
:width: 800 px

BIN
pos_empty_home/static/description/icon.png

After

Width: 64  |  Height: 64  |  Size: 3.9 KiB

BIN
pos_empty_home/static/description/pos_empty_home.png

After

Width: 1220  |  Height: 590  |  Size: 48 KiB

11
pos_empty_home/static/src/css/pos_empty_home.css

@ -0,0 +1,11 @@
/*
Copyright (C) 2017-Today: La Louve (<http://www.lalouve.net/>)
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
*/
.product-list-empty-home {
text-align: center;
padding: 15%;
font-size: x-large;
}

25
pos_empty_home/static/src/js/db.js

@ -0,0 +1,25 @@
/*
Copyright (C) 2017-Today: La Louve (<http://www.lalouve.net/>)
Copyright (C) 2019-Today: Druidoo (<https://www.druidoo.io>)
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
*/
odoo.define('pos_empty_home.db', function (require) {
"use strict";
var PosDB = require('point_of_sale.DB');
PosDB.include({
get_product_by_category: function(category_id){
if (category_id != 0) {
return this._super(category_id);
} else {
return [];
}
},
});
return PosDB;
});

26
pos_empty_home/static/src/js/screens.js

@ -0,0 +1,26 @@
/*
Copyright (C) 2017-Today: La Louve (<http://www.lalouve.net/>)
Copyright (C) 2019-Today: Druidoo (<https://www.druidoo.io>)
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
*/
odoo.define('pos_empty_home.screens', function (require) {
"use strict";
var screens = require('point_of_sale.screens');
screens.ProductListWidget.include({
set_product_list: function(product_list){
this._super(product_list);
if (product_list.length) {
$(this.el.querySelector('.product-list-empty-home')).hide();
} else {
$(this.el.querySelector('.product-list-empty-home')).show();
}
},
});
return screens;
});

19
pos_empty_home/static/src/xml/pos_empty_home.xml

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017-Today: La Louve (<http://www.lalouve.net/>)
Copyright (C) 2019-Today: Druidoo (<https://www.druidoo.io>)
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<templates id="template" xml:space="preserve">
<t t-extend="ProductListWidget">
<t t-jquery=".product-list" t-operation="before">
<div class="product-list-empty-home">
To select a product, please scan a barcode or search products by category or by name
</div>
</t>
</t>
</templates>

19
pos_empty_home/views/assets.xml

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2017-Today: La Louve (<http://www.lalouve.net/>)
Copyright (C) 2019-Today: Druidoo (<https://www.druidoo.io>)
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
-->
<odoo>
<template id="assets_frontend" inherit_id="point_of_sale.assets">
<xpath expr="." position="inside">
<script type="text/javascript" src="/pos_empty_home/static/src/js/db.js"></script>
<script type="text/javascript" src="/pos_empty_home/static/src/js/screens.js"></script>
</xpath>
<xpath expr="//link[@id='pos-stylesheet']" position="after">
<link rel="stylesheet" href="/pos_empty_home/static/src/css/pos_empty_home.css" />
</xpath>
</template>
</odoo>
Loading…
Cancel
Save