Skip to content

19.0 tutorials ancha - #1357

Draft
ancha-odoo wants to merge 16 commits into
odoo:19.0from
odoo-dev:19.0-tutorials-ancha
Draft

19.0 tutorials ancha#1357
ancha-odoo wants to merge 16 commits into
odoo:19.0from
odoo-dev:19.0-tutorials-ancha

Conversation

@ancha-odoo

Copy link
Copy Markdown

PR containing the server framework tutorials

Add the basic structure for the estate module as part of
the Odoo Server Framework 101 training.
Setup and authenticated DB to have the estate_property table
created schema with initial fields for the same
this would configure the access of the estate property table and more.
We can add the rule row in the csv file
@robodoo

robodoo commented Jul 3, 2026

Copy link
Copy Markdown

Pull request status dashboard

@ancha-odoo
ancha-odoo requested a review from mash-odoo July 3, 2026 10:22
- add window action for estate.property
- create Real Estate menu hierarchy
- register XML views in the manifest
- add active and state fields
- configure default values and field attributes
- add window action for estate.property
- create Real Estate menu hierarchy
- register XML views in the manifest
- add active and state fields
- configure default values and field attributes
- Window action for properties
- Root and submenu entries
- List view for property records
- Form view for property details
- Search view with filters and group by options
Implement relational fields for the estate module by adding:
- Property types and tags
- Property offers
- One2many and Many2one relationships
- Offer management from the property form
- Configuration menus for property types and tags
@ancha-odoo
ancha-odoo force-pushed the 19.0-tutorials-ancha branch from cfc3c6d to ef8a011 Compare July 8, 2026 09:45
- compute the total-area of the property
- compute the best-price of the property using private methods
- compute the deadline from create_date and validity
- implement an inverse method to update validity from the deadline
- handle record creation by providing a fallback when create_date is not yet available
- display the new fields in the offer tree and form views
@ancha-odoo
ancha-odoo force-pushed the 19.0-tutorials-ancha branch from 7e1de5e to fa72d08 Compare July 28, 2026 12:22
This change allows users to:
- accept or refuse property offers.
- mark properties as sold or cancelled.
- keep the selling price in sync with the accepted offer.
- ensure the sales process follows the expected workflow.
@ancha-odoo
ancha-odoo force-pushed the 19.0-tutorials-ancha branch from fa72d08 to 7198b8c Compare July 28, 2026 12:27

@mash-odoo mash-odoo left a comment

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!!
Good beginning on the task..
I have added a few comments and questions..
Please have a look🐣
And if you can, please remove the .idea folder while pushing.
PS: Please change your PR title and description. Also add chapter number along with your commits.


@api.depends("living_area", "garden_area")
def _compute_total_area(self):
for realEstateProperty in self:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why do we need a for loop here?

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.

we need it because self is a recordset and it's length is not fixed.

Comment on lines +41 to +48
state = fields.Selection(
[
("new", "New"),
("offer_received", "Offer Received"),
("offer_accepted", "Offer Accepted"),
("sold", "Sold"),
("cancelled", "Cancelled"),
],

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
state = fields.Selection(
[
("new", "New"),
("offer_received", "Offer Received"),
("offer_accepted", "Offer Accepted"),
("sold", "Sold"),
("cancelled", "Cancelled"),
],
state = fields.Selection(
[
('new', "New"),
('offer_received', "Offer Received"),
('offer_accepted', "Offer Accepted"),
('sold', "Sold"),
('cancelled', "Cancelled"),
],

Try to keep the key i.e the technical strings in single quotes and the values which are to be displayed to the user in double quotes

def _compute_best_price(self):
self.best_price = max(self.offer_ids.mapped("price")) if self.offer_ids else 0

@api.onchange("garden")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can we pass multiple arguments here?

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.

in onchange() decorator we can pass multiple arguments but they must belong to the same object
e.g.
Image

Comment on lines +10 to +11
price = fields.Float(string="Price")
status = fields.Selection(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You don't need to explicitly pass string here if you want to have the string name same as the field name.
You can have a look at the codebase regarding how the string value is calculated if you do not pass explicitly.

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.

👍

<field name="partner_id"/>
<field name="validity"/>
<field name="date_deadline"/>
<button name="set_accepted" string="Accept" type="object" icon="fa-check"/>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What is the working of the attribute type?
What are the alternatives for the values?

<search>
<field name="name"/>
<filter name="group_by_bedrooms" string="Bedrooms" context="{'group_by':'bedrooms'}"/>
<filter name="filter" string="price" domain="[('expected_price', '>',5000)]"/>

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
<filter name="filter" string="price" domain="[('expected_price', '>',5000)]"/>
<filter name="filter" string="price" domain="[('expected_price', '>', 5000)]"/>

NIT

</field>
</record>

</odoo> 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.

Always leave an extra line at the end of the file.

Comment on lines +3 to +14
<menuitem
id="estate_menu_root"
name="Real Estate">

<menuitem
id="estate_first_level_menu"
name="Advertisements">

<menuitem
id="estate_property_menu_action"
action="estate_property_action"/>
</menuitem>

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
<menuitem
id="estate_menu_root"
name="Real Estate">
<menuitem
id="estate_first_level_menu"
name="Advertisements">
<menuitem
id="estate_property_menu_action"
action="estate_property_action"/>
</menuitem>
<menuitem
id="estate_menu_root"
name="Real Estate"
>
<menuitem
id="estate_first_level_menu"
name="Advertisements"
>
<menuitem
id="estate_property_menu_action"
action="estate_property_action"
/>
</menuitem>

Indentation issue

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why do we need to write this?

Comment thread estate/__manifest__.py
"base",
],
"application": True,
"author": "Ansh Chamriya",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

When you are working for a company, you should keep the author name as Odoo S.A. or just skip writing it.

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