Skip to Content
Menu
This question has been flagged
1 Reply
3851 Views
OwlError: An error occured in the owl lifecycle (see this Error's "cause" property)
    at handleError (http://localhost:8069/web/assets/debug/web.assets_web.js:9154:35)
    at App.handleError (http://localhost:8069/web/assets/debug/web.assets_web.js:13345:20)
    at Fiber._render (http://localhost:8069/web/assets/debug/web.assets_web.js:9300:30)
    at Fiber.render (http://localhost:8069/web/assets/debug/web.assets_web.js:9289:18)
    at ComponentNode.initiateRender (http://localhost:8069/web/assets/debug/web.assets_web.js:9954:23)

Caused by: TypeError: Cannot read properties of undefined (reading 'name')
    at Field.template (eval at compile (http://localhost:8069/web/assets/debug/web.assets_web.js:13107:20), :16:92)
    at Fiber._render (http://localhost:8069/web/assets/debug/web.assets_web.js:9297:38)
    at Fiber.render (http://localhost:8069/web/assets/debug/web.assets_web.js:9289:18)
    at ComponentNode.initiateRender (http://localhost:8069/web/assets/debug/web.assets_web.js:9954:23)


Avatar
Discard

add your code snippet along with the post

Author

/** @odoo-module */

import { standardFieldProps } from "@web/views/fields/standard_field_props";
import { Component, xml } from "@odoo/owl";
import { registry } from "@web/core/registry";

export class MyTextField extends Component {
setup(){
super.setup();

console.log('Hello')
}

/**
* @param {boolean} newValue
*/
onChange(newValue) {

this.props.update(newValue);
}
}

MyTextField.template = xml`
<input t-att-id="props.id" class="text-danger" t-att-value="props.value" onChange.bind="onChange" />
`;
MyTextField.props = {
...standardFieldProps,
};

registry.category("fields").add("my_text_field", MyTextField);

Simple example from odoo docs not working

Author

pls help with this

Author Best Answer

This is how above error is solved ... i dont know the reason
but i use the code from booleanfield widget 

export another const with object, where key is component and value is class 


export const activeCompanyToggleField = {    component: MyTextField ,};
registry.category("fields").add("active_company", activeCompanyToggleField);

Avatar
Discard
Related Posts Replies Views Activity
0
Dec 23
926
3
Jun 24
3324
0
Jan 23
1762
0
Feb 24
1627
1
Dec 24
3778