summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/fields/basic_fields.js
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2019-02-12 15:21:48 +0000
committerNicolas Lempereur <nle@odoo.com>2019-02-20 12:05:05 +0000
commite8cb9c0e45962fc11a91fc9bc9bc5c1892525fd2 (patch)
tree49e02232dd4b1856c1b0797c85e526f2f189c095 /addons/web/static/src/js/fields/basic_fields.js
parent3e5ab60cf258b7d2f3265fa3967ac4ad0b1b1b33 (diff)
[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
Diffstat (limited to 'addons/web/static/src/js/fields/basic_fields.js')
0 files changed, 0 insertions, 0 deletions