Hi,
You can try the following
js>>
import { registry } from '@web/core/registry';
import { formView } from '@web/views/form/form_view';
import { FormController } from '@web/views/form/form_controller';
export class FormClassController extends FormController {
setup() {
super.setup();
console.log(this,'FormClassController',this.template)
owl.onMounted(() => {
let textField = this.__owl__.bdom.el.querySelector('.text-field')
textField.innerHTML = 'Hello World';
})
}
}
registry.category('views').add('form_class', {
...formView,
Controller: FormClassController,
});
xml>>
<field name="model">project.task.details</field>
<field name="arch" type="xml">
<form js_class="form_class">
<div class="text-field"/>
</div>
</form>
</field>
Js_class
allows you to access the backend view and customize it according to
your needs. Now every time you create a form view just add the js_class
of 'form_class' and add a div of class 'text-field' or you can find an
alternative way to show your view using the `js_class`
Hope it helps