Hello everybody here,
Still an strange mystery today... Look at this example.
My goal : replace a <title> tag with xpath
Example 1 : See code and image. the new title is after the original one. It is what we want.
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="index" inherit_id='point_of_sale.index' name="Index AS"><!DOCTYPE html>
<xpath expr="//title" position="after">
<title>Odoo POS - AS</title>
</xpath>
<xpath expr="//link[@id='pos-stylesheet']" position="after">
<link rel="stylesheet" href="/pos_lapagept/static/src/css/pos_as.css" />
</xpath>
</template>
<template id="assets_backend" name="point_of_sale assets" inherit_id="point_of_sale.assets_backend">
<xpath expr="//script[contains(@src,'widget_base.js')]" position="replace">
<script type="text/javascript" src="/pos_lapagept/static/src/js/widget_base.js"></script>
</xpath>
</template>
</data>
</openerp>
Example 2 : See code and image. the new title DOESN'T REPLACE the original one. It is NOT what we want. ?????????
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="index" inherit_id='point_of_sale.index' name="Index - AS"><!DOCTYPE html>
<xpath expr="//title" position="replace">
<title>Odoo POS AS</title>
</xpath>
<xpath expr="//link[@id='pos-stylesheet']" position="after">
<link rel="stylesheet" href="/pos_lapagept/static/src/css/pos_as.css" />
</xpath>
</template>
<template id="assets_backend" name="point_of_sale assets" inherit_id="point_of_sale.assets_backend">
<xpath expr="//script[contains(@src,'widget_base.js')]" position="replace">
<script type="text/javascript" src="/pos_lapagept/static/src/js/widget_base.js"></script>
</xpath>
</template>
</data>
</openerp>
What is the problem? Why could we not replace the title correctly?