Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
3863 Vizualizări
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)


Imagine profil
Abandonează

add your code snippet along with the post

Autor

/** @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

Autor

pls help with this

Autor Cel mai bun răspuns

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);

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
dec. 23
927
3
iun. 24
3362
0
ian. 23
1766
0
feb. 24
1646
1
dec. 24
3816