Skip to content
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

Draft
wants to merge 12 commits into
base: 18.0
Choose a base branch
from

Conversation

kiga-odoo
Copy link

  • 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
@robodoo
Copy link

robodoo commented Jan 17, 2025

Pull request status dashboard

@kiga-odoo kiga-odoo force-pushed the 18.0-training-kiga branch 3 times, most recently from 5ff4f28 to e2a97d8 Compare January 17, 2025 10:33
Copy link

@adsh-odoo adsh-odoo left a 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

Comment on lines 113 to 121
# @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'

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

'view_mode': 'form',
'res_model': 'estate.property.make.offer',
'context': {
'default_property_ids': self.ids

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')

from odoo import models, fields, api, exceptions
from datetime import timedelta

Choose a reason for hiding this comment

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

Suggested change
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)

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

Comment on lines 13 to 23
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,
}
)

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)

Comment on lines 16 to 20

'data': [

],
'demo': [],

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
""",

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

@kiga-odoo kiga-odoo force-pushed the 18.0-training-kiga branch 2 times, most recently from efe54a3 to a47ce47 Compare January 18, 2025 15:14
- added pager (for pagination on the properties page)
- added single property page(s)
- added menu to the website.layout menus, to navigate to `/properties`
…lines

- add wizard to list order lines to distribute the cost
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