Nicolas Lempereur e8cb9c0e45 [FIX] base: better branding with view inheritance
To edit a view on the website, we use the branding mechanism.

This mechanism adds informations to node which can be edited about how
or where the change should be saved, for example:

```
  <template id="a">
    <div><b>hello</b></div>
  </template>
```

might be rendered to someone that can edit it:

  `<div data-oe-model="ir.ui.view" data-oe-id="5" data-oe-field="arch"
     data-oe-xpath="/div[1]"><b>hello</b></div>`

when something is changed: we will send the modified content, the view
id (eg. 5 for view `a`) and the xpath in this view of what is replaced.

If a view is overridden, there is mechanism to distribute the branding
to children, for example:

```
  <template id="b">
    <div>
      <b>hello</b>
    <div>
  </template>
  <template inherit_id="b">
    <div position="inside">
      <b>world</b>
    </div>
  </template>
```

The branding can't be on the parent div that will contain other content,
because the other content is in another template and should not be saved
in template `b`, so this would be rendered like this:

  `<div><b data-oe-model="ir.ui.view" data-oe-id="6" data-oe-field="arch"
    data-oe-xpath="/div[1]/b[1]">hello</b><b data-oe-model="ir.ui.view"
    data-oe-id="7" data-oe-field="arch" data-oe-xpath="/div[1]/b[1]"><b>
    world</b></div>`

This changeset fixes two issues:

- if we have a primary inheriting view: the xpath are wrong in the
  primary inheriting view part, they are computed on the view applied on
  its inherit_id; the part of the inherit_id view have the primary
  inheriting view ID instead of inherit_id view id.

- if we have `<div t-call="..."/>` in a view, the branding of view
  should be distributed to children and not affect t-call part: this was
  done for `<t t-call="..."/>` but not for `<anyothertag t-call/>`.

The added test failed on all assertions before the change:

- "test_branding_primary_inherit" would not distributed
- "test_call_no_branding" would distribute branding on `t-call`

opw-1937757
closes #31039
2019-02-20 12:05:05 +00:00
…
…
…
…
…
…
…

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, Purchase Management, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

Then follow the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%