Skip to content

Conversation

@vikri-odoo
Copy link

@vikri-odoo vikri-odoo commented Dec 16, 2025

Here I have created new add-on for on-boarding tutorial project

what I have done?

  1. Chapter 1: create new add-on for real estate project
  2. Chapter 2: Make your application available in apps
  3. Chapter 3: Created first model for real estate properties
  4. Chapter 4: Added the access rights and basic demo data for properties
  5. Chapter 5: Added Views to see something in action
  6. Chapter 6: Understand how list and form works and create views for properties
  7. Chapter 7: Create one2Many, many2many and many2one relations for properties with Types, tags and offers
  8. Chapter 8: Create methods for onChange and compute to auto set fields
  9. Chapter 9: Added actions for buttons to directly update the model values

@robodoo
Copy link

robodoo commented Dec 16, 2025

Pull request status dashboard

Copy link

@barracudapps barracudapps left a comment

Choose a reason for hiding this comment

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

Some comments here and there. Can you also please review your PR title and description following our guidelines (https://www.odoo.com/documentation/19.0/contributing/development/git_guidelines.html)?
A clear commit message is really important to describe what you did and why you did it.

@vikri-odoo vikri-odoo changed the title [ADD] new addon for real estate onboarding project 19.0 Estate tutorial (VIKRI) Dec 17, 2025
postcode = fields.Char(string="Postcode")
date_availability = fields.Datetime(string="Date Availability", default=_set_default_start_date(), copy=False)
date_availability = fields.Datetime(
string="Date Availability", default=_set_default_start_date(), copy=False

Choose a reason for hiding this comment

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

Add a trailing coma here so if someone has to add a new parameter on a new line, that person won't have to change your line (and change the git history)

<field name="description">Description 3</field>
<field name="postcode">1040</field>
<field name="date_availability" eval="DateTime.now()" />
<field name="date_availability" eval="DateTime.now()"/>

Choose a reason for hiding this comment

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

date_availability is already pre-defined in your model with your default value

state = fields.Selection(
string="State",
selection=[
("new", "New"),

Choose a reason for hiding this comment

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

Use double quotes (") only for non-technical strings.
Please check all your files

access_estate_property,access.estate.property,model_estate_property,base.group_user,1,1,1,1
access_estate_property_type,access.estate.property.type,model_estate_property_type,base.group_user,1,1,1,1
access_estate_property_type,access.estate.property.type,model_estate_property_type,base.group_user,1,1,1,1
access_estate_property_tags,access.estate.property.tags,model_estate_property_tags,base.group_user,1,1,1,1

Choose a reason for hiding this comment

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

Don't forget Unix conventions on text files' structure based on a line definition (cf. https://peps.python.org/pep-0008/ and https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206)

Check other files too

Comment on lines 3 to 8
<menuitem
id="estate_menu_action"
action="test_model_action"
parent="estate_menu_root"
sequence="1"
/>

Choose a reason for hiding this comment

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

You can keep this on a single line. It's not always easy to know when to write multiple lines but the basic rule is that you try to optimize readability AND number of lines

<?xml version="1.0"?>
<odoo>
<!-- Root menuitem action which will help us to see the default action window-->
<!-- Root menuitem action which will help us to see the default action window-->

Choose a reason for hiding this comment

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

This comment is useless as the majority of the developers will easily know what your code is doing

Copy link

@barracudapps barracudapps left a comment

Choose a reason for hiding this comment

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

Thanks for the module !
Still some small suggestions but LGTM 👍

You can mark as ready (kind of message you'll get in R&D but cannot be applied here)

def action_set_sold(self):
for record in self:
if record.state == 'cancelled':
raise UserError("This property cannot be sold.")

Choose a reason for hiding this comment

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

Mark your strings as translatable using self.env._ method

Comment on lines 12 to 15
_name_uniq = models.Constraint(
'unique (name)',
"This tag is already available",
)

Choose a reason for hiding this comment

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

Probably fits a single line



class EstatePropertyType(models.Model):
_name = "estate.property.type"

Choose a reason for hiding this comment

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

These are tech strings 😉

<field name="name">estate.property.list</field>
<field name="model">estate.property</field>
<field name="arch" type="xml">
<list string="Estate" decoration-success="state=='offered' or state=='accepted'" decoration-bf="state=='accepted'" decoration-muted="state=='sold'">

Choose a reason for hiding this comment

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

Try using in to check multiple possible values (instead of or)

<field name="postcode"/>
<filter name="available" string="Available" domain="['|', ('state', '=', 'new'), ('state', '=', 'offer_received')]"/>
<filter name="inactive" string="Archived" domain="[('active', '=', False)]"/>
<field name="living_area" string="Living Area (sqm)" filter_domain="[('living_area', '>=', self)]"/>

Choose a reason for hiding this comment

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

Would prefer this for stability

Suggested change
<field name="living_area" string="Living Area (sqm)" filter_domain="[('living_area', '>=', self)]"/>
<field name="living_area" string="Living Area (sqm)" filter_domain="[('living_area', '&gt;=', self)]"/>

@vikri-odoo vikri-odoo force-pushed the 19.0-fix-onboarding-vikri branch from 73abd92 to 235ae6d Compare December 23, 2025 12:17
Copy link

@barracudapps barracudapps left a comment

Choose a reason for hiding this comment

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

LGTM 👍
Small nits

def unlink(self):
for record in self:
if record.state not in ('new', 'cancelled'):
raise UserError("This property cannot be deleted.")

Choose a reason for hiding this comment

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

Please make your strings translatable using the self.env._ method

</xpath>
</field>
</record>
</odoo> No newline at end of file

Choose a reason for hiding this comment

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

Add a newline here

@vikri-odoo vikri-odoo force-pushed the 19.0-fix-onboarding-vikri branch from 235ae6d to 99dcd74 Compare December 23, 2025 12:40
[ADD] add the new model for property types

Completed till chapter 7 many to one

[LINT] format the code using ruff

Added new tags model to understand many2many

[REF] address the PR comments and resole it

Check the style guide and resolve the issues

[REF] update the default availability method to lamda

[ADD] created new model for estate offers

1.create new model and view for offers
2.complete chapter 7

[ADD] chapter 9: action added for buttons

1. Sold and cancel button and actions added
2. Accept and reject button added with actions for offers

[LINT] format the code to fix the ci\style issue

[FIX] typo fix the string parameter to lower case for property_type in estate_property.py

[ADD] constrains added for selling and expected prices

expected and offer price must be strictly positive
Selling price must be positive
Tag name should be unique

[ADD] complete the chapter 11

1.use status bar widget to show the state of the property
2. add default sorting order for the models
3. add colors for tag model
4. add invisible in the needed places as mentioned in the task
5. make the offer and tag editable in list view

[REM] unused print statement removed

[ADD] new estate account module created

1. As accounting is option for estate module we create new module and inherited from estate
2. created kanban view for the properties

[FIX] run-bot to make it green
1. use private _ondelete method instead of using unlink in estate_property.py

[REF] use "in" for multiple possible value instead of "of"

[REF] use "self.env._" to make the strings translatable
@vikri-odoo vikri-odoo force-pushed the 19.0-fix-onboarding-vikri branch from 99dcd74 to 4c47a4b Compare December 23, 2025 12:52
@vikri-odoo vikri-odoo changed the title 19.0 Estate tutorial (VIKRI) [ADD] new addon for real estate onboarding project Dec 23, 2025
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