Skip to content

Comments

Sébastien Laurent commit tutorials Chapter 1 -> 4#1175

Open
selau-odoo wants to merge 9 commits intoodoo:19.0from
odoo-dev:19.0-tutorials-selau
Open

Sébastien Laurent commit tutorials Chapter 1 -> 4#1175
selau-odoo wants to merge 9 commits intoodoo:19.0from
odoo-dev:19.0-tutorials-selau

Conversation

@selau-odoo
Copy link

Please accept it

@robodoo
Copy link

robodoo commented Feb 16, 2026

Pull request status dashboard

@selau-odoo selau-odoo force-pushed the 19.0-tutorials-selau branch 2 times, most recently from 3b44f61 to 8c98d46 Compare February 16, 2026 14:16
@AlessandroLupo AlessandroLupo self-requested a review February 16, 2026 15:29
Copy link

@AlessandroLupo AlessandroLupo left a comment

Choose a reason for hiding this comment

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

Nice work! Just a few comments 👍

_description = "This is my first model"

name = fields.Char(required=True)
description = fields.Text()

Choose a reason for hiding this comment

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

It is not mandatory, but if you want you can add the string argument to every fields method, to describe that field (like you did for garden_orientation)

@@ -0,0 +1,6 @@
{
'name': 'Estate',

Choose a reason for hiding this comment

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

If you don't specify a license, you will get a warning in your console when you launch Odoo

'name': 'Estate',
'depends': ['base'],
'application': True,
'data': ['security/ir.model.access.csv']

Choose a reason for hiding this comment

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

Here you refer to the file ir.model.access.csv, but this file is created in the next commit. Try to move this line to the next commit too. (Feel free to ask for help with git if you need 😄 )

Copy link

@AlessandroLupo AlessandroLupo left a comment

Choose a reason for hiding this comment

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

Nice job! 👍
I added just a small comment. Also, note that your runbot is red, try to make it green by amending your commit. Let me know if you need help with git! ;)

Comment on lines 68 to 70
<group>
<field name="offer_ids" string="Offers"/>
</group>

Choose a reason for hiding this comment

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

At the moment you are getting the word "Offers" on the side of your offer list (see image).

Image

This happens because you are wrapping offer_ids, which is One2Many, with a group tag. If this is not wanted, you can just remove the group tags. ;)


class EstatePropertyOffer(models.Model):
_name = "estate.property.offer"
_description = "This is my fourth model"

Choose a reason for hiding this comment

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

Of course this is just a tutorial and it's ok to use whatever string you want. But for the future, consider that _description should be a string describing the model (for example, "Estate Property Offer"). This sting may even be shown to the user in some cases. 😄

@selau-odoo selau-odoo force-pushed the 19.0-tutorials-selau branch 5 times, most recently from dcf41e8 to 1ab4e50 Compare February 18, 2026 09:56
Comment on lines 10 to 24
<!-- <record id="estate_property_offer_view_form" model="ir.ui.view">
<field name="name">estate.property.offer.view.form</field>
<field name="model">estate.property.offer</field>
<field name="arch" type="xml">
<form string="Estate property offers">
<group>
<field name="price" string="Price"/>
<field name="status"/>
<field name="partner_id" string="Partner"/>
<field name="property_id" string="Property"/>
<field name="validity"/>
<field name="date_deadline"/>
</group>
</form>
</field>
</record>
</record> -->

Choose a reason for hiding this comment

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

You may want to remove from the history the commented snippets of code at some point. ;)

@selau-odoo selau-odoo force-pushed the 19.0-tutorials-selau branch 3 times, most recently from b436c8f to 8898583 Compare February 20, 2026 08:15
Copy link

@AlessandroLupo AlessandroLupo left a comment

Choose a reason for hiding this comment

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

Good work 👍 , just a couple of minor comments

Comment on lines +4 to +7
class ResUsers(models.Model):
_name = "res.users"
_description = "Adding fields for the user model"
_inherit = ['res.users']

Choose a reason for hiding this comment

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

Since we just want to extend the ResUser model, you could just use _inherit = 'res.users', without defining _name or _description.

'estate.property',
'salesman_id',
string="Estates",
domain="['|', ('state', '=', 'new'), ('state', '=', 'offer_received')]",

Choose a reason for hiding this comment

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

This domain is not going to work. It must be an actual list: domain=['|', ('state', '=', 'new'), ('state', '=', 'offer_received')] (not a string). ;)

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