Posts

Showing posts from March, 2024

Server Framework 101 - Solusi 12

Image
 solusi untuk tutorial  https://www.odoo.com/documentation/18.0/developer/tutorials/server_framework_101/13_other_module.html Buat modul baru dengan nama estate_account (Anda sudah melakukannya pada awal tutoral ini ketika membuat estate modul). file estate_account/__init__.py from . import estate_property file estate_account/__manifest__.py {     'name' : 'Estate Account' ,     'depends' :[         'estate' ,         'account' ,     ],     'auto_install' : True } file estate_account/models/__init__.py from . import estate_property file estate_account/models/estate_property.py # -*- coding: utf-8 -*- from odoo import models , Command class EstateProperty ( models . Model ):     # ---------------------------------------- Private Attributes ---------------------------------     _inherit = "estate.property"     # ---------------------------------------- Action M...

Server Framework 101 - Solusi 11

 solusi untuk tutorial  https://www.odoo.com/documentation/18.0/developer/tutorials/server_framework_101/12_inheritance.html file estate_property.py from dateutil.relativedelta import relativedelta from odoo import api, fields, models from odoo.exceptions import UserError, ValidationError from odoo.tools import float_compare, float_is_zero class EstateProperty ( models . Model ):     _name = "estate.property"     _description = "Estate property"     _order = "id desc"     _sql_constraints = [         ( "check_expected_price" , "CHECK(expected_price > 0)" , "Expected price should be positive." ),         ( "check_selling_price" , "CHECK(selling_price >= 0)" , "Selling price should be positive." )     ]     name = fields.Char( 'Estate Name' , required = True )     description = fields.Text( 'Description' )     postcode = fields.Char( 'Posc...

Server Framework 101 - Solusi 10

 solusi untuk tutorial https://www.odoo.com/documentation/18.0/developer/tutorials/server_framework_101/11_sprinkles.html file estate_property.py from dateutil.relativedelta import relativedelta from odoo import api, fields, models from odoo.exceptions import UserError, ValidationError from odoo.tools import float_compare, float_is_zero class EstateProperty ( models . Model ):     _name = "estate.property"     _description = "Estate property"     _order = "id desc"     _sql_constraints = [         ( "check_expected_price" , "CHECK(expected_price > 0)" , "Expected price should be positive." ),         ( "check_selling_price" , "CHECK(selling_price >= 0)" , "Selling price should be positive." )     ]     name = fields.Char( 'Estate Name' , required = True )     description = fields.Text( 'Description' )     postcode = fields.Char( 'Poscode' ) ...