Merge PR #1616 into 12.0

Signed-off-by legalsylvain
pull/1623/head
OCA-git-bot 2020-06-07 15:48:22 +00:00
commit da5922bf73
25 changed files with 38 additions and 935 deletions

View File

@ -1,127 +0,0 @@
===========================
Progressive web application
===========================
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
:target: https://github.com/OCA/web/tree/12.0/web_pwa
:alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_pwa
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/162/12.0
:alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5|
Make Odoo an installable Progressive Web Application.
Progressive Web Apps provide an installable, app-like experience on desktop and mobile that are built and delivered directly via the web.
They're web apps that are fast and reliable. And most importantly, they're web apps that work in any browser.
If you're building a web app today, you're already on the path towards building a Progressive Web App.
**Table of contents**
.. contents::
:local:
Installation
============
After having installed this module, browsing your odoo on mobile you will be able to install it as a PWA.
It is strongly recommended to use this module with a responsive layout, like the one provided by web_responsive.
This module is intended to be used by Odoo back-end users (employees).
When a Progressive Web App is installed, it looks and behaves like all of the other installed apps.
It launches from the same place that other apps launch. It runs in an app without an address bar or other browser UI.
And like all other installed apps, it's a top level app in the task switcher.
In Chrome, a Progressive Web App can either be installed through the three-dot context menu.
This module also provides a "Install PWA" link in Odoo user menu.
Configuration
=============
The following system parameters con be set to customize the appearance of the application
* pwa.manifest.name (defaults to "Odoo PWA")
* pwa.manifest.short_name (defaults to "Odoo PWA")
* pwa.manifest.icon128x128 (defaults to "/web_pwa/static/img/icons/icon-128x128.png")
* pwa.manifest.icon144x144 (defaults to "/web_pwa/static/img/icons/icon-144x144.png")
* pwa.manifest.icon152x152 (defaults to "/web_pwa/static/img/icons/icon-152x152.png")
* pwa.manifest.icon192x192 (defaults to "/web_pwa/static/img/icons/icon-192x192.png")
* pwa.manifest.icon256x256 (defaults to "/web_pwa/static/img/icons/icon-256x256.png")
* pwa.manifest.icon512x512 (defaults to "/web_pwa/static/img/icons/icon-512x512.png")
Known issues / Roadmap
======================
* Evaluate to extend ``FILES_TO_CACHE``
* Evaluate to use a normal JS file for service worker and download data from a normal JSON controller
* Integrate `Notification API <https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/showNotification>`_
* Integrate `Web Share API <https://web.dev/web-share/>`_
* Create ``portal_pwa`` module, intended to be used by front-end users (customers, suppliers...)
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/web/issues/new?body=module:%20web_pwa%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues.
Credits
=======
Authors
~~~~~~~
* TAKOBI
Contributors
~~~~~~~~~~~~
* `TAKOBI <https://takobi.online>`_:
* Lorenzo Battistini
Maintainers
~~~~~~~~~~~
This module is maintained by the OCA.
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
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.
.. |maintainer-eLBati| image:: https://github.com/eLBati.png?size=40px
:target: https://github.com/eLBati
:alt: eLBati
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
|maintainer-eLBati|
This module is part of the `OCA/web <https://github.com/OCA/web/tree/12.0/web_pwa>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@ -1,160 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_pwa
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2020-06-03 20:19+0000\n"
"Last-Translator: Hans Henrik Gabelgaard <hhg@gabelgaard.org>\n"
"Language-Team: none\n"
"Language: da\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"
"X-Generator: Weblate 3.10\n"
#. module: web_pwa
#: model_terms:ir.ui.view,arch_db:web_pwa.manifest
msgid "\",\n"
" \"sizes\": \"128x128\",\n"
" \"type\": \"image/png\"\n"
" }, {\n"
" \"src\": \""
msgstr ""
#. module: web_pwa
#: model_terms:ir.ui.view,arch_db:web_pwa.manifest
msgid "\",\n"
" \"sizes\": \"144x144\",\n"
" \"type\": \"image/png\"\n"
" }, {\n"
" \"src\": \""
msgstr ""
#. module: web_pwa
#: model_terms:ir.ui.view,arch_db:web_pwa.manifest
msgid "\",\n"
" \"sizes\": \"152x152\",\n"
" \"type\": \"image/png\"\n"
" }, {\n"
" \"src\": \""
msgstr ""
#. module: web_pwa
#: model_terms:ir.ui.view,arch_db:web_pwa.manifest
msgid "\",\n"
" \"sizes\": \"192x192\",\n"
" \"type\": \"image/png\"\n"
" }, {\n"
" \"src\": \""
msgstr ""
#. module: web_pwa
#: model_terms:ir.ui.view,arch_db:web_pwa.manifest
msgid "\",\n"
" \"sizes\": \"256x256\",\n"
" \"type\": \"image/png\"\n"
" }, {\n"
" \"src\": \""
msgstr ""
#. module: web_pwa
#: model_terms:ir.ui.view,arch_db:web_pwa.manifest
msgid "\",\n"
" \"sizes\": \"512x512\",\n"
" \"type\": \"image/png\"\n"
" }],\n"
" \"start_url\": \"/web\",\n"
" \"display\": \"standalone\",\n"
" \"background_color\": \""
msgstr ""
#. module: web_pwa
#: model_terms:ir.ui.view,arch_db:web_pwa.manifest
msgid "\",\n"
" \"icons\": [{\n"
" \"src\": \""
msgstr ""
#. module: web_pwa
#: model_terms:ir.ui.view,arch_db:web_pwa.manifest
msgid "\",\n"
" \"short_name\": \""
msgstr ""
#. module: web_pwa
#: model_terms:ir.ui.view,arch_db:web_pwa.manifest
msgid "\",\n"
" \"theme_color\": \""
msgstr ""
#. module: web_pwa
#: model_terms:ir.ui.view,arch_db:web_pwa.service_worker
msgid "';\n"
"const FILES_TO_CACHE = ["
msgstr ""
#. module: web_pwa
#: model_terms:ir.ui.view,arch_db:web_pwa.service_worker
msgid "'use strict';\n"
"const CACHE_NAME = '"
msgstr ""
#. module: web_pwa
#. openerp-web
#: code:addons/web_pwa/static/src/xml/pwa_install.xml:5
#, python-format
msgid "Install PWA"
msgstr "Installer PWA"
#. module: web_pwa
#: model_terms:ir.ui.view,arch_db:web_pwa.service_worker
msgid "];\n"
"self.addEventListener('install', function (evt) {\n"
" console.log('[ServiceWorker] Install');\n"
" evt.waitUntil(\n"
" caches.open(CACHE_NAME).then(function (cache) {\n"
" console.log('[ServiceWorker] Pre-caching offline page');\n"
" return cache.addAll(FILES_TO_CACHE);\n"
" })\n"
" );\n"
" self.skipWaiting();\n"
"});\n"
"self.addEventListener('activate', function(evt) {\n"
" console.log('[ServiceWorker] Activate');\n"
" evt.waitUntil(\n"
" caches.keys().then(function(keyList) {\n"
" return Promise.all(keyList.map(function(key) {\n"
" if (key !== CACHE_NAME) {\n"
" console.log('[ServiceWorker] Removing old cache', key);\n"
" return caches.delete(key);\n"
" }\n"
" }));\n"
" })\n"
" );\n"
" self.clients.claim();\n"
"});\n"
"self.addEventListener('fetch', function(evt) {\n"
" if (evt.request.cache === 'only-if-cached' &amp;&amp; evt.request.mode !== 'same-origin') {\n"
" return;\n"
" }\n"
" console.log('[ServiceWorker] Fetch', evt.request.url);\n"
" evt.respondWith(\n"
" caches.open(CACHE_NAME).then(function(cache) {\n"
" return cache.match(evt.request)\n"
" .then(function(response) {\n"
" return response || fetch(evt.request);\n"
" });\n"
" })\n"
" );\n"
"});"
msgstr ""
#. module: web_pwa
#: model_terms:ir.ui.view,arch_db:web_pwa.manifest
msgid "{\n"
" \"name\": \""
msgstr ""

View File

@ -1,158 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * web_pwa
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\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: web_pwa
#: model_terms:ir.ui.view,arch_db:web_pwa.manifest
msgid "\",\n"
" \"sizes\": \"128x128\",\n"
" \"type\": \"image/png\"\n"
" }, {\n"
" \"src\": \""
msgstr ""
#. module: web_pwa
#: model_terms:ir.ui.view,arch_db:web_pwa.manifest
msgid "\",\n"
" \"sizes\": \"144x144\",\n"
" \"type\": \"image/png\"\n"
" }, {\n"
" \"src\": \""
msgstr ""
#. module: web_pwa
#: model_terms:ir.ui.view,arch_db:web_pwa.manifest
msgid "\",\n"
" \"sizes\": \"152x152\",\n"
" \"type\": \"image/png\"\n"
" }, {\n"
" \"src\": \""
msgstr ""
#. module: web_pwa
#: model_terms:ir.ui.view,arch_db:web_pwa.manifest
msgid "\",\n"
" \"sizes\": \"192x192\",\n"
" \"type\": \"image/png\"\n"
" }, {\n"
" \"src\": \""
msgstr ""
#. module: web_pwa
#: model_terms:ir.ui.view,arch_db:web_pwa.manifest
msgid "\",\n"
" \"sizes\": \"256x256\",\n"
" \"type\": \"image/png\"\n"
" }, {\n"
" \"src\": \""
msgstr ""
#. module: web_pwa
#: model_terms:ir.ui.view,arch_db:web_pwa.manifest
msgid "\",\n"
" \"sizes\": \"512x512\",\n"
" \"type\": \"image/png\"\n"
" }],\n"
" \"start_url\": \"/web\",\n"
" \"display\": \"standalone\",\n"
" \"background_color\": \""
msgstr ""
#. module: web_pwa
#: model_terms:ir.ui.view,arch_db:web_pwa.manifest
msgid "\",\n"
" \"icons\": [{\n"
" \"src\": \""
msgstr ""
#. module: web_pwa
#: model_terms:ir.ui.view,arch_db:web_pwa.manifest
msgid "\",\n"
" \"short_name\": \""
msgstr ""
#. module: web_pwa
#: model_terms:ir.ui.view,arch_db:web_pwa.manifest
msgid "\",\n"
" \"theme_color\": \""
msgstr ""
#. module: web_pwa
#: model_terms:ir.ui.view,arch_db:web_pwa.service_worker
msgid "';\n"
"const FILES_TO_CACHE = ["
msgstr ""
#. module: web_pwa
#: model_terms:ir.ui.view,arch_db:web_pwa.service_worker
msgid "'use strict';\n"
"const CACHE_NAME = '"
msgstr ""
#. module: web_pwa
#. openerp-web
#: code:addons/web_pwa/static/src/xml/pwa_install.xml:5
#, python-format
msgid "Install PWA"
msgstr ""
#. module: web_pwa
#: model_terms:ir.ui.view,arch_db:web_pwa.service_worker
msgid "];\n"
"self.addEventListener('install', function (evt) {\n"
" console.log('[ServiceWorker] Install');\n"
" evt.waitUntil(\n"
" caches.open(CACHE_NAME).then(function (cache) {\n"
" console.log('[ServiceWorker] Pre-caching offline page');\n"
" return cache.addAll(FILES_TO_CACHE);\n"
" })\n"
" );\n"
" self.skipWaiting();\n"
"});\n"
"self.addEventListener('activate', function(evt) {\n"
" console.log('[ServiceWorker] Activate');\n"
" evt.waitUntil(\n"
" caches.keys().then(function(keyList) {\n"
" return Promise.all(keyList.map(function(key) {\n"
" if (key !== CACHE_NAME) {\n"
" console.log('[ServiceWorker] Removing old cache', key);\n"
" return caches.delete(key);\n"
" }\n"
" }));\n"
" })\n"
" );\n"
" self.clients.claim();\n"
"});\n"
"self.addEventListener('fetch', function(evt) {\n"
" if (evt.request.cache === 'only-if-cached' &amp;&amp; evt.request.mode !== 'same-origin') {\n"
" return;\n"
" }\n"
" console.log('[ServiceWorker] Fetch', evt.request.url);\n"
" evt.respondWith(\n"
" caches.open(CACHE_NAME).then(function(cache) {\n"
" return cache.match(evt.request)\n"
" .then(function(response) {\n"
" return response || fetch(evt.request);\n"
" });\n"
" })\n"
" );\n"
"});"
msgstr ""
#. module: web_pwa
#: model_terms:ir.ui.view,arch_db:web_pwa.manifest
msgid "{\n"
" \"name\": \""
msgstr ""

View File

@ -1,10 +0,0 @@
The following system parameters con be set to customize the appearance of the application
* pwa.manifest.name (defaults to "Odoo PWA")
* pwa.manifest.short_name (defaults to "Odoo PWA")
* pwa.manifest.icon128x128 (defaults to "/web_pwa/static/img/icons/icon-128x128.png")
* pwa.manifest.icon144x144 (defaults to "/web_pwa/static/img/icons/icon-144x144.png")
* pwa.manifest.icon152x152 (defaults to "/web_pwa/static/img/icons/icon-152x152.png")
* pwa.manifest.icon192x192 (defaults to "/web_pwa/static/img/icons/icon-192x192.png")
* pwa.manifest.icon256x256 (defaults to "/web_pwa/static/img/icons/icon-256x256.png")
* pwa.manifest.icon512x512 (defaults to "/web_pwa/static/img/icons/icon-512x512.png")

View File

@ -1,465 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<title>Progressive web application</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="progressive-web-application">
<h1 class="title">Progressive web application</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/web/tree/12.0/web_pwa"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/web-12-0/web-12-0-web_pwa"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/162/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>Make Odoo an installable Progressive Web Application.</p>
<p>Progressive Web Apps provide an installable, app-like experience on desktop and mobile that are built and delivered directly via the web.
Theyre web apps that are fast and reliable. And most importantly, theyre web apps that work in any browser.
If youre building a web app today, youre already on the path towards building a Progressive Web App.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#installation" id="id1">Installation</a></li>
<li><a class="reference internal" href="#configuration" id="id2">Configuration</a></li>
<li><a class="reference internal" href="#known-issues-roadmap" id="id3">Known issues / Roadmap</a></li>
<li><a class="reference internal" href="#bug-tracker" id="id4">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id5">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id6">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id7">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id8">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="installation">
<h1><a class="toc-backref" href="#id1">Installation</a></h1>
<p>After having installed this module, browsing your odoo on mobile you will be able to install it as a PWA.</p>
<p>It is strongly recommended to use this module with a responsive layout, like the one provided by web_responsive.</p>
<p>This module is intended to be used by Odoo back-end users (employees).</p>
<p>When a Progressive Web App is installed, it looks and behaves like all of the other installed apps.
It launches from the same place that other apps launch. It runs in an app without an address bar or other browser UI.
And like all other installed apps, its a top level app in the task switcher.</p>
<p>In Chrome, a Progressive Web App can either be installed through the three-dot context menu.</p>
<p>This module also provides a “Install PWA” link in Odoo user menu.</p>
</div>
<div class="section" id="configuration">
<h1><a class="toc-backref" href="#id2">Configuration</a></h1>
<p>The following system parameters con be set to customize the appearance of the application</p>
<ul class="simple">
<li>pwa.manifest.name (defaults to “Odoo PWA”)</li>
<li>pwa.manifest.short_name (defaults to “Odoo PWA”)</li>
<li>pwa.manifest.icon128x128 (defaults to “/web_pwa/static/img/icons/icon-128x128.png”)</li>
<li>pwa.manifest.icon144x144 (defaults to “/web_pwa/static/img/icons/icon-144x144.png”)</li>
<li>pwa.manifest.icon152x152 (defaults to “/web_pwa/static/img/icons/icon-152x152.png”)</li>
<li>pwa.manifest.icon192x192 (defaults to “/web_pwa/static/img/icons/icon-192x192.png”)</li>
<li>pwa.manifest.icon256x256 (defaults to “/web_pwa/static/img/icons/icon-256x256.png”)</li>
<li>pwa.manifest.icon512x512 (defaults to “/web_pwa/static/img/icons/icon-512x512.png”)</li>
</ul>
</div>
<div class="section" id="known-issues-roadmap">
<h1><a class="toc-backref" href="#id3">Known issues / Roadmap</a></h1>
<ul class="simple">
<li>Evaluate to extend <tt class="docutils literal">FILES_TO_CACHE</tt></li>
<li>Evaluate to use a normal JS file for service worker and download data from a normal JSON controller</li>
<li>Integrate <a class="reference external" href="https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerRegistration/showNotification">Notification API</a></li>
<li>Integrate <a class="reference external" href="https://web.dev/web-share/">Web Share API</a></li>
<li>Create <tt class="docutils literal">portal_pwa</tt> module, intended to be used by front-end users (customers, suppliers…)</li>
</ul>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id4">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/web/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20web_pwa%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#id5">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#id6">Authors</a></h2>
<ul class="simple">
<li>TAKOBI</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#id7">Contributors</a></h2>
<ul class="simple">
<li><a class="reference external" href="https://takobi.online">TAKOBI</a>:<ul>
<li>Lorenzo Battistini</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id8">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>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.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external" href="https://github.com/eLBati"><img alt="eLBati" src="https://github.com/eLBati.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/12.0/web_pwa">OCA/web</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
</div>
</body>
</html>

View File

@ -25,36 +25,42 @@ class PWA(Controller):
version_list.append(url.split('/')[3])
cache_version = '-'.join(version_list)
mimetype = 'text/javascript;charset=utf-8'
content = qweb.render('web_pwa.service_worker', {
content = qweb.render('web_pwa_oca.service_worker', {
'pwa_cache_name': cache_version,
'pwa_files_to_cache': urls,
})
return request.make_response(content, [('Content-Type', mimetype)])
@route('/web_pwa/manifest.json', type='http', auth="public")
@route('/web_pwa_oca/manifest.json', type='http', auth="public")
def manifest(self):
qweb = request.env['ir.qweb'].sudo()
config_param = request.env['ir.config_parameter'].sudo()
pwa_name = config_param.get_param("pwa.manifest.name", "Odoo PWA")
pwa_short_name = config_param.get_param("pwa.manifest.short_name", "Odoo PWA")
icon128x128 = config_param.get_param(
"pwa.manifest.icon128x128", "/web_pwa/static/img/icons/icon-128x128.png")
"pwa.manifest.icon128x128",
"/web_pwa_oca/static/img/icons/icon-128x128.png")
icon144x144 = config_param.get_param(
"pwa.manifest.icon144x144", "/web_pwa/static/img/icons/icon-144x144.png")
"pwa.manifest.icon144x144",
"/web_pwa_oca/static/img/icons/icon-144x144.png")
icon152x152 = config_param.get_param(
"pwa.manifest.icon152x152", "/web_pwa/static/img/icons/icon-152x152.png")
"pwa.manifest.icon152x152",
"/web_pwa_oca/static/img/icons/icon-152x152.png")
icon192x192 = config_param.get_param(
"pwa.manifest.icon192x192", "/web_pwa/static/img/icons/icon-192x192.png")
"pwa.manifest.icon192x192",
"/web_pwa_oca/static/img/icons/icon-192x192.png")
icon256x256 = config_param.get_param(
"pwa.manifest.icon256x256", "/web_pwa/static/img/icons/icon-256x256.png")
"pwa.manifest.icon256x256",
"/web_pwa_oca/static/img/icons/icon-256x256.png")
icon512x512 = config_param.get_param(
"pwa.manifest.icon512x512", "/web_pwa/static/img/icons/icon-512x512.png")
"pwa.manifest.icon512x512",
"/web_pwa_oca/static/img/icons/icon-512x512.png")
background_color = config_param.get_param(
"pwa.manifest.background_color", "#2E69B5")
theme_color = config_param.get_param(
"pwa.manifest.theme_color", "#2E69B5")
mimetype = 'application/json;charset=utf-8'
content = qweb.render('web_pwa.manifest', {
content = qweb.render('web_pwa_oca.manifest', {
'pwa_name': pwa_name,
'pwa_short_name': pwa_short_name,
'icon128x128': icon128x128,

View File

@ -0,0 +1,10 @@
The following system parameters con be set to customize the appearance of the application
* pwa.manifest.name (defaults to "Odoo PWA")
* pwa.manifest.short_name (defaults to "Odoo PWA")
* pwa.manifest.icon128x128 (defaults to "/web_pwa_oca/static/img/icons/icon-128x128.png")
* pwa.manifest.icon144x144 (defaults to "/web_pwa_oca/static/img/icons/icon-144x144.png")
* pwa.manifest.icon152x152 (defaults to "/web_pwa_oca/static/img/icons/icon-152x152.png")
* pwa.manifest.icon192x192 (defaults to "/web_pwa_oca/static/img/icons/icon-192x192.png")
* pwa.manifest.icon256x256 (defaults to "/web_pwa_oca/static/img/icons/icon-256x256.png")
* pwa.manifest.icon512x512 (defaults to "/web_pwa_oca/static/img/icons/icon-512x512.png")

View File

@ -11,3 +11,10 @@ And like all other installed apps, it's a top level app in the task switcher.
In Chrome, a Progressive Web App can either be installed through the three-dot context menu.
This module also provides a "Install PWA" link in Odoo user menu.
In case you previously installed `web_pwa`, run the following steps with `odoo shell`, after having installed `openupgradelib`:
>>> from openupgradelib import openupgrade
>>> openupgrade.update_module_names(env.cr, [('web_pwa', 'web_pwa_oca')], merge_modules=False)
>>> env.cr.commit()

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View File

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

View File

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

View File

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -1,4 +1,4 @@
odoo.define('web_pwa.systray.install', function (require) {
odoo.define('web_pwa_oca.systray.install', function (require) {
"use strict";
var core = require('web.core');

View File

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates>
<t t-name="web_pwa.systray.install">
<t t-name="web_pwa_oca.systray.install">
<a href="#" role="menuitem" id="pwa_install_button" data-menu="installpwa" class="dropdown-item" hidden="1">Install PWA</a>
</t>
<t t-extend="UserMenu.Actions">
<t t-jquery="a[data-menu='settings']" t-operation="after">
<t t-call="web_pwa.systray.install"/>
<t t-call="web_pwa_oca.systray.install"/>
</t>
</t>

View File

@ -3,19 +3,19 @@
<template id="web_layout_pwa" name="Web layout PWA" inherit_id="web.layout">
<xpath expr="//meta[@name='viewport']" position="after">
<!-- Add link rel manifest -->
<link rel="manifest" href="/web_pwa/manifest.json"/>
<link rel="manifest" href="/web_pwa_oca/manifest.json"/>
<!-- Add iOS meta tags and icons -->
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<meta name="apple-mobile-web-app-title" content="Odoo PWA"/>
<link rel="apple-touch-icon" href="/web_pwa/static/img/icons/icon-152x152.png"/>
<link rel="apple-touch-icon" href="/web_pwa_oca/static/img/icons/icon-152x152.png"/>
<!-- Add meta theme-color -->
<meta name="theme-color" content="#2E69B5" />
</xpath>
</template>
<template id="assets_backend" name="PWA assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/web_pwa/static/src/js/pwa_install.js"/>
<script type="text/javascript" src="/web_pwa_oca/static/src/js/pwa_install.js"/>
</xpath>
</template>
<template id="service_worker" name="PWA service worker">