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: Added new real estate property management module #110

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

Conversation

akya-odoo
Copy link

Added real estate module for training

The new module includes:
- Model: estate.property with fields such as name, description, selling_price,
availability_date, bedrooms, state, and active.
- Views: Tree and form views for managing estate properties.
- Security: Access rights defined in ir.model.access.csv.
The new module includes:
- Model: estate.property with fields such as name, description, selling_price,
availability_date, bedrooms, state, and active.
- Views: Tree and form views for managing estate properties.
- Security: Access rights defined in ir.model.access.csv.
The new module includes:
- Model: estate.property with fields such as name, description, selling_price,
availability_date, bedrooms, state, and active.
- Views: Tree and form views for managing estate properties.
- Security: Access rights defined in ir.model.access.csv.
The new module includes:
- Model: estate.property with fields such as name, description, selling_price,
availability_date, bedrooms, state, and active.
- Views: Tree and form views for managing estate properties.
- Security: Access rights defined in ir.model.access.csv.
The new module includes:
- Model: estate.property with fields such as name, description, selling_price,
availability_date, bedrooms, state, and active.
- Views: Tree and form views for managing estate properties.
- Security: Access rights defined in ir.model.access.csv.
@akya-odoo akya-odoo force-pushed the 17.0-training-akya branch 4 times, most recently from 6aa9cca to 28a53ce Compare August 7, 2024 12:42
Enhanced estate module by updating estate_property model and views, adding new m
odels for estate_property_offer, estate_property_tag, and estate_property_type,
and refining access control and menus. Improved estate_property_views functional
ity for better user experience.
Update UI elements for improved user experience.
- Added SQL and python constraints.
- Enhanced User interface of the module.
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 @akya-odoo

I have added some remarks to cleanup the code.
Can you please have a look?

Thanks!!

@@ -0,0 +1 @@
from . import estate_property, estate_property_type, estate_property_tag, estate_property_offer, res_users

Choose a reason for hiding this comment

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

Suggested change
from . import estate_property, estate_property_type, estate_property_tag, estate_property_offer, res_users
from . import estate_property
from . import estate_property_offer
from . import estate_property_tag
from . import estate_property_type
from . import res_users

Generally, we import every model in new lines.

Comment on lines 53 to 56




Choose a reason for hiding this comment

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

Suggested change

Comment on lines 1 to 2
from odoo import models, fields, api
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
from datetime import timedelta
from datetime import timedelta
from odoo import api, fields, model

Generally we follow a convention in which we first we import all the external libraries and then the import of odoos in alphabetical order.

</record>


</odoo>

Choose a reason for hiding this comment

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

Need a blank line at EOF

</p>
</field>
</record>

Choose a reason for hiding this comment

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

Suggested change

Same for below also

Comment on lines 86 to 89
_sql_constraints = [
('check_expected_price', 'CHECK(expected_price > 0)', 'The expected price must be strictly positive.'),
('check_selling_price', 'CHECK(selling_price >= 0)', 'The selling price must be positive.')
]

Choose a reason for hiding this comment

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

Generally we define constraints just after field defination.

self.status = 'refused'
return True

_sql_constraints = [

Choose a reason for hiding this comment

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

same here for constraints

Comment on lines 28 to 29
<button type="action" name="estate.action_estate_property_offer" string="Offers" class="oe_stat_button" icon="fa-archive" style= "align: right;">
</button>

Choose a reason for hiding this comment

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

Suggested change
<button type="action" name="estate.action_estate_property_offer" string="Offers" class="oe_stat_button" icon="fa-archive" style= "align: right;">
</button>
<div name="button_box">
<button class="oe_stat_button" type="action" name="%(estate.action_estate_property_offer)d"
icon="fa-pencil-square-o">
<field string="Offers" name="offer_count" widget="statinfo"/>
</button>
</div>

I think we can do something like this inside sheet instead of header to properly format the stat button.

<sheet>
<div>
<h1><field name="name"/></h1>
<field name="offer_count" readonly="1"/>

Choose a reason for hiding this comment

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

No need for this after applying the previous comment.

self.state = "canceled"
elif self.state == "sold":
raise UserError("This property can't be canceled as it is sold already")
return True

Choose a reason for hiding this comment

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

Suggested change
return True

I think it is not necessary check for all the actions.

Comment on lines 21 to 25
for record in self:
if record.create_date:
record.date_deadline = record.create_date + timedelta(days=record.validity)
else:
record.date_deadline = fields.Date.today() + timedelta(days=record.validity)

Choose a reason for hiding this comment

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

Suggested change
for record in self:
if record.create_date:
record.date_deadline = record.create_date + timedelta(days=record.validity)
else:
record.date_deadline = fields.Date.today() + timedelta(days=record.validity)
record.deadline_date = record.property_id.create_date + relativedelta(
days=record.validity
)

Comment on lines 29 to 33
if record.date_deadline and record.create_date:
create_date_date = record.create_date.date()
record.validity = (record.date_deadline - create_date_date).days
else:
record.validity = 0

Choose a reason for hiding this comment

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

Suggested change
if record.date_deadline and record.create_date:
create_date_date = record.create_date.date()
record.validity = (record.date_deadline - create_date_date).days
else:
record.validity = 0
record.validity = (record.deadline_date - record.property_id.create_date.date()).days

Can you give it a try? Make sure to check all possible cases.
same for compute also

- Updated data files to reflect recent changes in property and offer models.
- Enhanced security for estate-related models.
- Added security rules to ensure proper access levels for different user roles.
- Implemented patient form with linked guarantor information (phone, email, etc)
- Added functionality to handle invoicing for dental treatments
- Updated UI elements for better user experience and accessibility
Implemented patient details page for Dental module. Added controller route to di
splay patient-specific information with sections for Personal, Medical History,
Medical Aid, and Dental History. Integrated responsive design with Bootstrap car
ds and breadcrumbs navigation.
Created a module for managing installments, including a cron job for invoices.
Added a settings section specifically for installments.
Implemented a wizard for adding EMI (Equated Monthly Installments).
Introduced a button to redirect to the document module.
Implemented an invoice schedule that triggers when the delay process exceeds the
 specified days.
Added a smart button for document upload requests.
Developed a wizard for document requests related to sales orders.
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.

2 participants