Skip to content

Technical Training - kymag - 19.0-server-framework-tutorial #1200

Open
kiro6 wants to merge 29 commits intoodoo:19.0from
kiro6:19.0-server-framework-tutorial-kymag
Open

Technical Training - kymag - 19.0-server-framework-tutorial #1200
kiro6 wants to merge 29 commits intoodoo:19.0from
kiro6:19.0-server-framework-tutorial-kymag

Conversation

@kiro6
Copy link
Copy Markdown

@kiro6 kiro6 commented Mar 16, 2026

No description provided.

@robodoo
Copy link
Copy Markdown

robodoo commented Mar 16, 2026

Pull request status dashboard

@kiro6 kiro6 changed the title Chapter 2 (kymag) Technical Training - kymag - 19.0-server-framework-tutorial - Mar 16, 2026
@kiro6 kiro6 changed the title Technical Training - kymag - 19.0-server-framework-tutorial - Technical Training - kymag - 19.0-server-framework-tutorial Mar 16, 2026
Copy link
Copy Markdown

@lost-odoo lost-odoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, Good Job 😄! I already made a small review. Feel free to ask me anything if needed.

@@ -0,0 +1 @@
from . import estate_property No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello do not forget to make the runbot green please 😄
Also github complains when you do not add the final newline ^^



class EstateProperty(models.Model):
_name = "estate.property"
Copy link
Copy Markdown

@lost-odoo lost-odoo Mar 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We typically use single quotes for strings, and reserve double quotes for user-facing text.

Suggested change
_name = "estate.property"
_name = 'estate.property'


class EstateProperty(models.Model):
_name = "estate.property"
_description = "Estate Property model"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
_description = "Estate Property model"
_description = 'Estate Property'

_name = "estate.property"
_description = "Estate Property model"

name = fields.Char("Name", required=True)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ry to always use keys inside parameters for better readability.

Suggested change
name = fields.Char("Name", required=True)
name = fields.Char(string="Name", required=True)

date_availability = fields.Date(
string="Available From",
copy=False,
default=fields.Date.add(fields.Date.today(), days=90),
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good but you should use a lambda here as this value is evaluated at server start and does not change unless the server restarts ^^

@@ -0,0 +1,2 @@
id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink
access_estate_property,access_estate_property,model_estate_property,base.group_user,1,1,1,1 No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also missing final newline here

Comment on lines +5 to +10
<record id="estate_property_action" model="ir.actions.act_window">
<field name="name">Properties</field>
<field name="res_model">estate.property</field>
<field name="view_mode">list,form</field>
</record>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am pretty sure this is not the right place where it should be 😄

Copy link
Copy Markdown

@lost-odoo lost-odoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

God Job! 😄 I have made another review, be careful about the use of double and single quotes ^^

Comment on lines +10 to +11
_description = 'Estate Property'
_order = "id desc"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be careful about your double and single quotes 😄

name = fields.Char("Name", required=True)
description = fields.Text("description")
name = fields.Char(string="Name", required=True)
description = fields.Text(string='Description')
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here it should be double quotes ^^

postcode = fields.Char()
date_availability = fields.Date(
string="Available From",
string='Available From',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too

string="Status",
default='new'
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Useless spacing here ci/style should tell it I think 😄


if float_compare(record.selling_price, limit_price, precision_digits=2) == -1:
raise ValidationError(
("The selling price cannot be lower than 90% of the expected price!"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a double parenthesis here maybe you are missing the translation function ? (You should use the translation function see: self.env._)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s a way to write the string over two lines without adding an actual \n to the string itself. Since the bot is complaining, I’ll change it.

from odoo import models, fields


class EstatePropertyType(models.Model):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not an Estate Property Type but a tag ^^

Comment on lines +4 to +6



Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😱

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try to avoid adding arbitrary spaces throughout the files 😄

At least I mean in data files 3 empty lines is useless, one line to make it clearer is ok ^^

<field name="model">estate.property</field>
<field name="arch" type="xml">
<kanban default_group_by="property_type_id" records_draggable="false" >
<field name="name" />
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be removed as it is already defined at the bottom

'description': """
Description text
""",
'application': True,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget the key auto_install as it auto installs the module when all the dependencies are installed.

Copy link
Copy Markdown

@lost-odoo lost-odoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

God Job! 😄 I have made another review, be careful about the use of double and single quotes ^^

@kiro6 kiro6 force-pushed the 19.0-server-framework-tutorial-kymag branch from 843a124 to d89fc64 Compare March 23, 2026 12:59
@kiro6
Copy link
Copy Markdown
Author

kiro6 commented Mar 24, 2026

ci/style should be good, however i still need to fix ci/tutorial

@kiro6 kiro6 force-pushed the 19.0-server-framework-tutorial-kymag branch from 88dfc9f to b73ea4f Compare March 26, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants