Author: |
Tecnativa, Odoo Community Association (OCA) |
License: |
AGPL-3 |
Branch: |
13.0-temp-web_pwa_cache |
Repository: |
Tecnativa/web |
Dependencies: |
queue_job,
web,
and
web_pwa_oca |
Languages: |
HTML (380, 3.2%),
JavaScript (8405, 70.5%),
Markdown (571, 4.8%),
PO File (416, 3.5%),
Python (1300, 10.9%),
Sass (9, 0.1%),
XML (749, 6.3%),
and
reStructuredText (97, 0.8%) |
Other branches: |
12.0-add-web_pwa_cache,
12.0-add-web_pwa_json,
13.0-add-web_pwa_cache,
and
13.0-temp-web_pwa_oca |
Other repositories: |
sergiocorato/web |
<h1 class="title">Web PWA Cache</h1>
<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/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/web/tree/13.0/web_pwa_cache"><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-13-0/web-13-0-web_pwa_cache"><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/13.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>Odoo Client Proxy</p>
<p>This module is used to add support to cache POST/GET requests. Can handle Odoo requests and responses to give an offline experience.</p>
<a name="cache-types"></a>
<h2>Cache Types</h2>
<ul class="simple">
<li>Model -> Gets records, related actions, views, default values and filters</li>
<li>Client QWeb -> Gets indepent client views (used by widgets)</li>
<li>function -> Cache function calls</li>
<li>Onchange -> Cache onchange calls</li>
<li>Onchange with formula -> Cache onchange calls using formulas</li>
<li>Post -> Cache indepent POST requests (used by widgets)</li>
<li>Get -> Cache indepent GET requests</li>
</ul>
<a name="how-works"></a>
<h2>How Works</h2>
<p>The module handle two modes:</p>
<ul class="simple">
<li>Normal: Runs Odoo as normal</li>
<li><dl class="first docutils">
<dt>Standalone: When the app starts you will request to set the mode (offline or online).</dt>
<dd><ul class="first last">
<li>Online: All requests except Create, Update and Delete operations goes from cache first, if not found, tries from network.</li>
<li>Offline: All requests goes from/to cache</li>
</ul>
</dd>
</dl>
</li>
</ul>
<p>When the user change to offline mode the module will start to prefetch all data and only recent records will be requested (write_date > last_cache_date)</p>
<p>The standalone mode is available only when install the PWA.</p>
<a name="to-developers"></a>
<h2>To Developers</h2>
<p>'onchange' prefetching works in a generic way... so, it uses the "main" form view to know the involved fields. If you trigger an onchange than uses a
field thas is not present in this view, you won't get any change related to the field.</p>
<p>If you want trigger an 'onchange' with</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#known-issues-roadmap" id="id1">Known issues / Roadmap</a></li>
<li><a class="reference internal" href="#bug-tracker" id="id2">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id3">Credits</a></li>
</ul>
</div>
<a name="known-issues-roadmap"></a>
<h3><a class="toc-backref" href="#id1">Known issues / Roadmap</a></h3>
<ul class="simple">
<li>'create_multi' is splitted in normal 'create' in offline mode</li>
<li>Improve 'onchange' and 'function' synchronization</li>
<li>Can't use domains with dotted leafs</li>
<li>one2many fields inside of one2many field don't work</li>
<li>Only supports mono-company instances</li>
<li>Sqlite doesn't have '=like' operator (all are case insensitive by default)</li>
</ul>
<a name="bug-tracker"></a>
<h3><a class="toc-backref" href="#id2">Bug Tracker</a></h3>
<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_cache%0Aversion:%2013.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>
<a name="credits"></a>
<h3><a class="toc-backref" href="#id3">Credits</a></h3>
<a name="authors"></a>
<h2>Authors</h2>
<ul class="simple">
<li>Tecnativa</li>
</ul>
<a name="contributors"></a>
<h2>Contributors</h2>
<ul>
<li><p class="first"><a class="reference external" href="https://www.tecnativa.com">Tecnativa</a>:</p>
<blockquote>
<ul class="simple">
<li>Alexandre Díaz</li>
<li>Pedro M. Baeza</li>
</ul>
</blockquote>
</li>
</ul>
<a name="maintainers"></a>
<h2>Maintainers</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>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/13.0/web_pwa_cache">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>