-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[ADD] estate: created new module #1020
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 19.0
Are you sure you want to change the base?
Conversation
Initializes the basic structure for the real estate module. - Creates the module scaffolding (manifest, init, and base directories). - Defines the initial 'estate.property' model. - Adds base fields (columns) to the new model.
Initializes the basic structure for the real estate module. - Creates the module scaffolding (manifest, init, and base directories). - Defines the initial 'estate.property' model. - Adds base fields (columns) to the new model.
- Set default values for estate.property model fields. - Apply additional field attributes (e.g., readonly, required). - Register menu items to access the tree and form views.
- added basic, list and form view - also added filter for new or offer received stage
- pincode feild name had spelling mistake in views/estate_property_views.xml
…nctionality -Developed and integrated list, form, and search views for the Real Estate module -Including support for group-by operations.
bit-odoo
left a comment
There was a problem hiding this 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 have left some remarks.
please update your commit message and title. you can refer this documentation :- https://www.odoo.com/documentation/19.0/contributing/development/git_guidelines.html#commit-message-full-description
estate/__manifest__.py
Outdated
| 'application': True, | ||
| 'installable': True, | ||
| 'author': 'Odoo S.A.', | ||
| 'category':'Tutorials', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 'category':'Tutorials', | |
| 'category': 'Tutorials', |
estate/__manifest__.py
Outdated
| 'views/estate_menus.xml', | ||
| ], | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An empty line should be without whitespace.
estate/models/estate_property.py
Outdated
| copy=False, | ||
| default='new' | ||
| ) | ||
|
No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An empty line should be without whitespace.
estate/models/estate_property.py
Outdated
| description = fields.Text("Description") | ||
| postcode = fields.Char("Postcode", required=True) | ||
| date_availability = fields.Date("Availability Date", default=fields.Date.today()+relativedelta(months=3)) | ||
| expected_price = fields.Float(required=True) | ||
| selling_price = fields.Float("Selling Price", readonly=True) | ||
| bedrooms = fields.Integer("Bedrooms", default=2) | ||
| living_area = fields.Integer("living_area(sqm)") | ||
| facades = fields.Integer("Facades") | ||
| garage = fields.Boolean("Garage") | ||
| garden = fields.Boolean("Garden") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By default, Odoo generates a string. If your string is the same as the technical name, then no need to add.
estate/views/estate_menus.xml
Outdated
| <menuitem id="estate_advertisement_menu" | ||
| name="Advertisements" | ||
| parent="estate_root_menu"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| <menuitem id="estate_advertisement_menu" | |
| name="Advertisements" | |
| parent="estate_root_menu"/> | |
| <menuitem id="estate_advertisement_menu" | |
| name="Advertisements" | |
| parent="estate_root_menu"/> |
| @@ -0,0 +1,90 @@ | |||
|
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary diff.
| <filter name="group_by_postcode" | ||
| string="Group by Postcode" | ||
| context="{'group_by': 'postcode'}"/> | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary diff.
| <search string="Search Properties"> | ||
| <field name="name"/> | ||
| <field name="postcode"/> | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary diff.
| <filter name="group_by_postcode" | ||
| string="Group by Postcode" | ||
| context="{'group_by': 'postcode'}"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
proper indentation needed.
| </record> | ||
|
|
||
|
|
||
| </odoo> No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be one empty line at the end of the file.
-Introduced Property Type and Property Tag models. -Added Buyer and Salesperson fields. -Implemented the Property Offer model.
-Added computed fields with inverse functions and onchange methods, -Improved real estate module with sold and cancel buttons to enhance the module functionality.
-Implemented new sql constraint method.
-Implemented new sql constraint method.
…Options. -Implemented inline views and widgets to enhance the user interface within the Real Estate module. -Introduced list-ordering functionality to improve the organization and sorting of listings. -Added attribute and option configurations to increase customization capabilities and overall flexibility for users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello!
Another round of review :)
I have made some comments; please have a look at them.
Please update your commit message Bootstrap new 'estate' module and PR title too.
| from dateutil.relativedelta import relativedelta | ||
| from odoo import models, fields, api | ||
| from odoo.exceptions import UserError, ValidationError | ||
| from odoo.tools.float_utils import float_compare, float_is_zero |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| from dateutil.relativedelta import relativedelta | |
| from odoo import models, fields, api | |
| from odoo.exceptions import UserError, ValidationError | |
| from odoo.tools.float_utils import float_compare, float_is_zero | |
| from dateutil.relativedelta import relativedelta | |
| from odoo import models, fields, api | |
| from odoo.exceptions import UserError, ValidationError | |
| from odoo.tools.float_utils import float_compare, float_is_zero |
estate/models/estate_property.py
Outdated
| if record.garden_area == 10: | ||
| record.garden_orientation = "north" | ||
| elif record.garden_area == 20: | ||
| record.garden_orientation = "east" | ||
| elif record.garden_area == 30: | ||
| record.garden_orientation = "west" | ||
| elif record.garden_area == 40: | ||
| record.garden_orientation = "south" | ||
| else: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary?
| <field name="bedrooms" /> | ||
| <field name="living_area" /> | ||
| <field name="facades" /> | ||
| <field name="garage" /> | ||
| <field name="garden" /> | ||
| <field name="garden_area" invisible="not garden" /> | ||
| <field name="garden_orientation" invisible="not garden" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part should be in the description tab.
estate/models/estate_property.py
Outdated
| _check_expected_price = models.Constraint( | ||
| 'CHECK(expected_price > 0)', | ||
| 'The expected price must be strictly positive.' | ||
| ) | ||
|
|
||
| _check_selling_price = models.Constraint( | ||
| 'CHECK(selling_price > 0)', | ||
| 'The selling price must be positive.' | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Constraints should be after the field declaration; you can take reference from the Odoo codebase.
| _check_offer_price = models.Constraint( | ||
| 'CHECK(price > 0)', | ||
| 'The price must be strictly positive.' | ||
| ) No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same and should be one empty line at the end of the file.
| _check_type_name_unique = models.Constraint( | ||
| 'UNIQUE(name)', | ||
| 'The name of the property type must be unique.' | ||
| ) No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be one empty line at the end of the file.
| decoration-success="status == 'accepted'" editable="bottom"> | ||
| <field name="price" /> | ||
| <field name="partner_id" /> | ||
| <field name="status" invisible="1" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why invisible in the list view? If it is invisible, then you can remove it from the list view.
-Introduced a stat button on Property Type to display related offer count. -Restricted property deletion to New or Cancelled states, set status to Offer Received on offer creation, and prevented creation of offers lower than existing ones.

Initializes the basic structure for the real estate module.