Posts

Showing posts from April, 2024

Build Dashboard - Bagian Layout

solusi untuk tutorial  https://www.odoo.com/documentation/18.0/developer/tutorials/discover_js_framework/02_build_a_dashboard.html bagian pertama (layout) file static/src/dashboard/dashboard.js /** @odoo-module **/ import { Component } from "@odoo/owl" ; import { registry } from "@web/core/registry" ; import { Layout } from "@web/search/layout" ; class AwesomeDashboard extends Component {     static template = "awesome_dashboard.AwesomeDashboard" ;     static components = { Layout }; } registry . category ( "actions" ). add ( "awesome_dashboard.dashboard" , AwesomeDashboard ); file static/src/dashboard/dashboard.xml <? xml version = "1.0" encoding = "UTF-8" ?> < templates xml:space = "preserve" >     < t t-name = "awesome_dashboard.AwesomeDashboard" >         < Layout display = "display" className = "'o_dashboard h-100...

Solusi Tutorial Owl Components - Todo List

Solusi untuk tutorial  https://www.odoo.com/documentation/18.0/developer/tutorials/discover_js_framework/01_owl_components.html  untuk bagian Todo List. buat file static/src/todo_list/todo_list.js import { Component , useState } from "@odoo/owl" ; import { TodoItem } from "./todo_item" ; import { useAutofocus } from "../utils" ; export class TodoList extends Component {     static template = "awesome_owl.TodoList" ;     static components = { TodoItem };     setup () {         this . nextId = 0 ;         this . todos = useState ([]);         useAutofocus ( "input" )     }     addTodo ( ev ) {         if ( ev . keyCode === 13 && ev . target . value != "" ) {             this . todos . push ({                 id: this . nextId ++ ,   ...

Solusi Tutorial Owl Components - Card and Sum

 solusi untuk tutorial  https://www.odoo.com/documentation/18.0/developer/tutorials/discover_js_framework/01_owl_components.html bagian card dan sum Card: Buat file baru card/card.js import { Component , useState } from "@odoo/owl" ; export class Card extends Component {     static template = "awesome_owl.Card" ;     static props = {         title : String ,         slots : {             type : Object ,             shape : {                 default : true             },         }     };     setup () {         this . state = useState ({ isOpen : true });     }     toggleContent () {         this . state . isOpen = ! this . state . isOpen ;     } } buat file ...

Solusi Tutorial Owl Components - Counter

 Solusi untuk tutorial Owl Components bagian Counter Link tutorial  https://www.odoo.com/documentation/18.0/developer/tutorials/discover_js_framework/01_owl_components.html Buat file awesome_owl/static/src/counter/counter.js /** @odoo-module **/ import { Component , useState } from "@odoo/owl" ; export class Counter extends Component {     static template = "awesome_owl.Counter" ;     static props = {         onchange : { type : Function , optional : true }     };     setup () {         this . state = useState ({ value : 0 });     }     increment () {         this . state . value ++ ;         if ( this . props . onchange ){             this . props . onchange ();         }     } } Buat file awesome_owl/static/src/counter/counter.xml <? xml version = "1.0" ...

Server Framework 101 - Solusi 13

Solusi untuk tutorial  https://www.odoo.com/documentation/18.0/developer/tutorials/server_framework_101/14_qwebintro.html file estate_property.xml <? xml version = "1.0" encoding = "utf-8" ?> < odoo >     < record id = "estate_property_action" model = "ir.actions.act_window" >         < field name = "name" > Estate Property </ field >         < field name = "res_model" > estate.property </ field >         < field name = "view_mode" > list,kanban,form </ field >         < field name = "context" > {'search_default_avaliable': True} </ field >         < field name = "help" type = "html" >             < p class = "o_view_nocontent_smiling_face" >                 Create a property advertisement         ...