Hi all,
I create my dashboard, I add a list box containing product list.
I load products from product_template model to the list box, all products are loaded successfully when I run dashboard. But when I select an item from the list box all items are removed.
I do not understand why. Help me please.
Thank you very much
Below is my code:
import { registry } from "@web/core/registry"
import { loadJS } from "@web/core/assets"
import { useService } from "@web/core/utils/hooks"
const { Component, onWillStart, useState, onWillUpdateProps, useEffect, onWillUnmount } = owl
import { session } from "@web/session";
export class OwlApplicationDashboard extends Component {
setup(){
this.state = useState({
product: {},
})
this.orm = useService("orm")
this.actionService = useService("action")
onWillStart(async ()=>{
await this.fetchProduct()
})
}
async fetchProduct() {
this.state.product = await this.orm.silent.searchRead('product.template', [], [], {})
}
}