Hi there,
Am trying to inherit a <templates id="template" xml:space="preserve">, but no succedd in almost a full week. What was fun to learn, bcamed a nightmare, just bcause of this, so far.
I have done the following come (below). Can someone pleeeeaaassseee, have a look and let me know what am I doing wrong?
I want to inherit the SEO widget. to add a new field, but for a full week I couldn't touch that popup window. It's on odoo 12.
So,
- I have added the js file (ad_jas.xml)
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="inherit_seo" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/fk_website_seo/static/js/extend_seo_widget.js"></script>
</xpath>
</template>
</odoo>
- the content of the js file (extend_seo_widget.js)
odoo.define('fk_website_seo.extend_seo_widget', function (require) {
'use strict';
var core = require('web.core');
var ajax = require('web.ajax');
var qweb = core.qweb;
ajax.loadXML('/fk_website_seo/static/src/xml/extend_seo_widget.xml', qweb);
});
- added the xml extension to manifest as qweb
'qweb': [
'static/src/xml/extend_seo_widget.xml'
],
'data': [
'views/add_jas.xml',
],
- and tried to inherit the SEO widget, with extend_seo_widget.xml
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<templates id="template" xml:space="preserve">
<t t-name="website.seo_preview" t-extend="website.seo_preview">
<t t-jquery=".oe_seo_preview_g" t-operation="after">
<h1>TEST TEST TEST TSET</h1>
<label for="test">Frequency</label>
<field name="test"/>
</t>
</t>
</templates>
</odoo>
- and inherited the website.seo.metadata model, as follow
class inheritedSEOwidget(models.Model):
# this website.seo.metadata is an Abstract model, andthe only way I could inherited it it was using models.Model...
_inherit = 'website.seo.metadata'
_name = "extended.website.seo.metadata"
test = fields.Char(string="Test")
I'm not getting any errors, but still nothing changed there.
that is driving me crazy.
Can you have a look pls?
What am I doing wrong? Google it a lot, and tested everything I got..nothing worked o far.
pls and thank you