Browse Source

[MIG] pos_empty_home: Migration to 12.0

pull/453/head
Iván Todorovich 5 years ago
parent
commit
744184bb7f
  1. 60
      pos_empty_home/README.rst
  2. 1
      pos_empty_home/__init__.py
  3. 12
      pos_empty_home/__manifest__.py
  4. 2
      pos_empty_home/i18n/ca.po
  5. 2
      pos_empty_home/i18n/fr.po
  6. 2
      pos_empty_home/i18n/pos_empty_home.pot
  7. 2
      pos_empty_home/readme/CONTRIBUTORS.rst
  8. 13
      pos_empty_home/readme/DESCRIPTION.rst
  9. 7
      pos_empty_home/static/src/js/db.js
  10. 6
      pos_empty_home/static/src/js/screens.js
  11. 1
      pos_empty_home/static/src/xml/pos_empty_home.xml
  12. 10
      pos_empty_home/views/assets.xml

60
pos_empty_home/README.rst

@ -1,60 +0,0 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
==========================
Point of Sale - Empty Home
==========================
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:: /pos_empty_home/static/description/pos_empty_home.png
:width: 800 px
Usage
=====
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/184/9.0
Bug Tracker
===========
Bugs are tracked on `GitHub Issues
<https://github.com/OCA/pos/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smash it by providing detailed and welcomed feedback.
Credits
=======
Contributors
------------
* Sylvain LE GAL <https://twitter.com/legalsylvain>
Maintainer
----------
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
This module is maintained by the OCA.
OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.
To contribute to this module, please visit https://odoo-community.org.

1
pos_empty_home/__init__.py

@ -1 +0,0 @@
# -*- coding: utf-8 -*-

12
pos_empty_home/__openerp__.py → pos_empty_home/__manifest__.py

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

2
pos_empty_home/i18n/ca.po

@ -6,7 +6,7 @@
# Marc Tormo i Bochaca <mtbochaca@gmail.com>, 2017 # Marc Tormo i Bochaca <mtbochaca@gmail.com>, 2017
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Project-Id-Version: Odoo Server 12.0c\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-06-09 03:08+0000\n" "POT-Creation-Date: 2017-06-09 03:08+0000\n"
"PO-Revision-Date: 2017-06-09 03:08+0000\n" "PO-Revision-Date: 2017-06-09 03:08+0000\n"

2
pos_empty_home/i18n/fr.po

@ -4,7 +4,7 @@
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Project-Id-Version: Odoo Server 12.0c\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-05-05 09:32+0000\n" "POT-Creation-Date: 2017-05-05 09:32+0000\n"
"PO-Revision-Date: 2017-05-05 09:32+0000\n" "PO-Revision-Date: 2017-05-05 09:32+0000\n"

2
pos_empty_home/i18n/pos_empty_home.pot

@ -4,7 +4,7 @@
# #
msgid "" msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 9.0c\n"
"Project-Id-Version: Odoo Server 12.0c\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"

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

7
pos_empty_home/static/src/js/db.js

@ -1,5 +1,6 @@
/* /*
Copyright (C) 2017-Today: La Louve (<http://www.lalouve.net/>) 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) @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
*/ */
@ -12,13 +13,13 @@ odoo.define('pos_empty_home.db', function (require) {
PosDB.include({ PosDB.include({
get_product_by_category: function(category_id){ get_product_by_category: function(category_id){
console.log(this.config);
if (category_id != 0) { if (category_id != 0) {
return this._super(category_id); return this._super(category_id);
}
else{
} else {
return []; return [];
} }
}, },
}); });
return PosDB;
}); });

6
pos_empty_home/static/src/js/screens.js

@ -1,5 +1,6 @@
/* /*
Copyright (C) 2017-Today: La Louve (<http://www.lalouve.net/>) 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) @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
*/ */
@ -15,10 +16,11 @@ odoo.define('pos_empty_home.screens', function (require) {
this._super(); this._super();
if (this.product_list.length == 0) { if (this.product_list.length == 0) {
this.el.querySelector('.product-list-empty-home').style['display'] = 'block'; this.el.querySelector('.product-list-empty-home').style['display'] = 'block';
}
else{
} else {
this.el.querySelector('.product-list-empty-home').style['display'] = 'none'; this.el.querySelector('.product-list-empty-home').style['display'] = 'none';
} }
}, },
}); });
return screens;
}); });

1
pos_empty_home/static/src/xml/pos_empty_home.xml

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- <!--
Copyright (C) 2017-Today: La Louve (<http://www.lalouve.net/>) 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) @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
--> -->

10
pos_empty_home/static/src/xml/templates.xml → pos_empty_home/views/assets.xml

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