Search 1.9 billion lines of Odoo code on GitHub

web_qweb_diff

Author: bloopark systems GmbH & Co. KG ,
License: no license
Branch: 9.0-qweb-diff
Repository: Adel-Magebinary/website-1
Dependencies: base, and web_editor
Languages: Python (175, 81.0%), XML (24, 11.1%), and reStructuredText (17, 7.9%)
Other repositories: AMhadhbi/website-1, KIKOU2016/website-1, LiberTang0/website, VbossEkat/website, alanljj/website, alex-magebinary/website, ateijelo/website, blooparksystems/website, cristinamartinrod/website-1, etech-hary/website, and kardec-web/website

<h1 class="title">Web Qweb Diff</h1> <a name="provides-a-different-way-to-save-changes-in-qweb-views"></a> <h2>Provides a different way to save changes in Qweb views</h2> <p>...</p> <a name="features"></a> <h2>Features</h2> <p>For the main feature of this module we need to consider two important moments:</p> <ol class="arabic simple"> <li>Save an updated view.</li> <li>Render a view taking into account the changes saved.</li> </ol> <p>These moments mainly involves the models ir.ui.view and ir.qweb, then we list the issues according to this.</p> <p><strong>Model View (ir.ui.view)</strong></p> <ul class="simple"> <li><em>Store only the difference between the original view and the updated view</em>. Use library diff_match_patch. The view model should have a one to many relation with a new model (ir.ui.view.diff) where the difference will be saved. In current Odoo solution the view model has a method save which is called from the interface to store each of the sections of the view, this method allows us to get each part of the view updated.</li> <li><em>Track the changes of the view</em>. With a datetime field in the diff model we can check the order of the changes in a view, then we can reset to the last change or reset all changes to get the original view. Maybe we can consider to export changes to a file and later restore them in other database.</li> <li><em>Store version without publish</em> Save changes as versions of a page and publish in other moment, when the user got the design desired.</li> </ul> <p><strong>Model Qweb (ir.qweb)</strong></p> <ul class="simple"> <li><em>Render the requested view dynamically</em>. Look for all the diff saved for an specific view and apply to the requested view in the moment of render. This behavior should take into account the inherited views, the database could have more than one record for the same key view.</li> <li><em>Save in cache the views rendered</em>. Maybe use cache to avoid processing of rendering views and applying patches a lot of times without new updates.</li> </ul>