-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[ADD] estate: add real estate module #226
base: 18.0
Are you sure you want to change the base?
Conversation
kiga-odoo
commented
Jan 17, 2025
- create real estate module module for training purpose
Added real estate module base, with basic functionalities i.e., property, their types and tags, buyer, seller, and offers
- improved views - altered models
- inherited and altered `res.users` model and `view_users_form` view
and added basic Kanban view to `estate_property`
refactored the folder structure (because security files were misplaced) added XMLs and CSVs to data & demo to load master and demo data.
added report actions and templates for printing the record for - property's offers' reports - user(seller)-wise reports
added access rules for different group users to limit the access to them
added bulk offer wizard: to add offers to multiple properties, at the same time added basic web view: to list the properties on a web page
5ff4f28
to
e2a97d8
Compare
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 kiga-odoo
Some comments.
Thanks
estate/models/estate_property.py
Outdated
# @api.constrains('offer_ids') | ||
# def _check_offers(self): | ||
# for record in self: | ||
# if record.offer_ids: | ||
# if record.state == 'new': | ||
# record.state = 'offer_received' | ||
# else: | ||
# if record.state != 'cancelled': | ||
# record.state = 'new' |
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.
Try to avoid pushing commented code
estate/models/estate_property.py
Outdated
'view_mode': 'form', | ||
'res_model': 'estate.property.make.offer', | ||
'context': { | ||
'default_property_ids': self.ids |
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.
No need for this we can use something like this self.env.context.get('active_ids')
estate/models/estate_property.py
Outdated
from odoo import models, fields, api, exceptions | ||
from datetime import timedelta |
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 odoo import models, fields, api, exceptions | |
from datetime import timedelta | |
from datetime import timedelta | |
from odoo import api, fields, models, | |
from odoo.exceptions import UserError |
Generally we first make external imports and then we import from odoo in alphabetical order.
Need to adapt in all files
_name = "estate.property.make.offer" | ||
_description = "wizard to make offers in bulk." | ||
|
||
property_ids = fields.Many2many("estate.property", string="Properties", required=True) |
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.
No need to link this wizard with estate property
for property in self.property_ids: | ||
try: | ||
self.env["estate.property.offer"].create( | ||
{ | ||
"price": self.offer_price, | ||
"property_id": property.id, | ||
"partner_id": self.partner_id.id, | ||
"validity": self.validity, | ||
} | ||
) |
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.
adapt this implementation using active_ids(previous comment)
estate_account/__manifest__.py
Outdated
|
||
'data': [ | ||
|
||
], | ||
'demo': [], |
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.
No need for this
'description': """ | ||
Estate App | ||
""", | ||
|
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 lines need to check in other files also
efe54a3
to
a47ce47
Compare
- added pager (for pagination on the properties page) - added single property page(s) - added menu to the website.layout menus, to navigate to `/properties`
a47ce47
to
eab7acb
Compare
…lines - add wizard to list order lines to distribute the cost
f641cca
to
09b75b0
Compare