Files
odoo_source/addons/website
Romain Derie"Romain Derie <rde@odoo.com>""Jérémy Kersten <jke@openerp.com>"
ef03db9edd [FIX] website: restore reset_templates functionality
Since AST was introduced to compile Qweb templates, the reset templates
functionality is not working anymore.
Actually, it does not even appear anymore as the conditions to trigger and show
the reset view behavior can't be True anymore.
Indeed, the code is still importing the old QWebException from odoo.exceptions
which is now just an empty class.
The QWebException that should now be used is the one from odoo.base.models.qweb

More than just a wrong import, the QWebException properties have completely
changed.

Since its last working version (Odoo 9.0), a lot of changes occured, mostly:
  - Odoo 11.0: new model website.page, which completely changed the pages
    behavior and changed the models.
  - Odoo 12.0: multi-website, which introduced the Copy On Write (COW) that
    redefined how we write on view in a website context. We now need to reset
    copied/specific views that have no model_data_id.

This fix is for a stable version. There is some flows that can't be fixed
without a refactoring or new fields (mainly because of the arch_fs being
erased when writing on `arch`, plus we can't introduce a module reload in
stable).
The goal of this commit is to fix the basic and standard case of broken views,
which is when non-technical users are breaking the views through HTML editor.

To reset the views, we will read the original arch in the XML file, as the
dev mode is doing.
To be eligible for the reset, the broken view need an `arch_fs` set. If the
view arch has been modified anywhere else than the frontend, the `arch_fs`
will be erased and the view wont be able to be reset.
As the broken views will be specific views, we will simply read the generic
view in the XML file and write it on the specific. We can't simply remove the
specific view as we might be on a specific tree.

Specific case, in case of custom views create dropping a snippet in an oe_struc
we just delete this inehrited view to allow end user to have their page back.

In some case of bad compilation in sub template, we try to guess which inherited
view, t-called view is broken by string matching based on 'last_path_node' xpath.

Add new module test_website to add tests, it will be usefull for futur test of
install/uninstall and ...

Todo in master:
  - try to track on QWebException the real template that is broken and not only
    the last node from the main template.

Co-authored-by: "Romain Derie <rde@odoo.com>"
Co-authored-by: "Jérémy Kersten <jke@openerp.com>"

closes odoo/odoo#29957
2019-02-13 20:33:18 +00:00
..
…
…

Odoo Website Builder

Get an awesome and free website, easily customizable with the Odoo website builder.

Create enterprise grade website with our super easy builder. Use finely designed building blocks and edit everything inline.

Benefit from out-of-the-box business features; e-Commerce, events, blogs, jobs announces, customer references, call-to-actions, etc.

Edit Anything Inline

Create beautiful websites with no technical knowledge. Odoo's unique 'edit inline' approach makes website creation surprisingly easy. No more complex backend; just click anywhere to change any content.

"Want to change the price of a product? or put it in bold? Want to change a blog title?" Just click and change. What you see is what you get. Really.

Awesome. Astonishingly Beautiful.

Odoo's building blocks allow to design modern websites that are not possible with traditional WYSIWYG page editors.

Whether it's for products descriptions, blogs or static pages, you don't need to be a professioanl designer to create clean contents. Just drag and drop and customize predefined building blocks.

Enterprise-Ready, out-of-the-box

Activate ready-to-use enterprise features in just a click; e-commerce, call-to-actions, jobs announces, events, customer references, blogs, etc.

Traditional eCommerce and CMS have poorly designed backends as it's not their core focus. With the Odoo integration, you benefit from the best management software to follow-up on your orders, your jobs applicants, your leads, etc.

A Great Mobile Experience

Get a mobile friendly website thanks to our responsive design based on bootstrap. All your pages adapt automatically to the screen size. (mobile phones, tablets, desktop) You don't have to worry about mobile contents, it works by default.

SEO tools at your finger tips

The Promote tool suggests keywords according to Google most searched terms. Search Engine Optimization tools are ready to use, with no configuration required.

Google Analytics tracks your shopping cart events by default. Sitemap and structured content are created automatically for Google indexation.

Multi-Languages Made Easy

Get your website translated in multiple languages with no effort. Odoo proposes and propagates translations automatically across pages, following what you edit on the master page.

Benefit from professional translators to translate all your contents automatically with the Gengo integration. Update any part of your website and the translated versions are pushed automatically in a few hours.

Designer-Friendly Templates

Templates are awesome and easy to design. You don't need to develop to create new pages, themes or building blocks. We use a clean HTML structure, a bootstrap CSS.

Customize every page on the fly with the integrated template editor. Distribute your work easily as an Odoo module.

Fluid Grid Layouting

Design perfect pages by drag and dropping building blocks. Move and scale them to fit the layout you are looking for.

Building blocks are based on a responsive, mobile friendly fluid grid system that appropriately scales up to 12 columns as the device or viewport size increases.

Professional Themes

Design a custom theme or reuse pre-defined themes to customize the look and feel of your website.

Test new color scheme easily; you can change your theme at any time in just a click.

Integrated With Odoo Apps

e-Commerce

Promote products, sell online, optimize visitors' shopping experience.

Blogs

Write news, attract new visitors, build customer loyalty.

Online Events

Schedule, organize, promote or sell events online; conferences, trainings, webinars, etc.