Skip to content

[ADD] real_estate : add real estate property and create invoice #845

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

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

Conversation

rodh-odoo
Copy link

firstly create real_estate module and add estate property in property module, add offers in property and also sales person and buyer name .
add business logic to validate offer amount, compute deadline and manage status.
generate invoice when successful sale property and also show in buyer(user) profile

rodh-odoo added 6 commits July 3, 2025 14:18
one model created real estate and display in app. one table created for estate
property in database with dome database .
variable of table like name, description, date etc.
first i add data with csv file in module and after that with xml file code
 i add data that display on frontend in list view and form view both
also disable selling price so anyone cannot change it
…or property

implement Sold and Cancel button in estate property with validation
add offer option in property with accept and refused button
automatic update selling price when buyer accept offer
only one buyer can accept one offer through validation
…or offers

Added stat button on property type to show related offers with domain filtering
Applied decorations on offer and property list views for status indication
Made 'offer' and 'tag' list views editable and added optional availability field
Set default filter for 'Available' properties, improved living area search logic
…ritance

Added logic to create a customer invoice when a property is marked as Sold
Invoice includes 6% commission and ₹100 administrative fees
Display property in user which buy by them
only can delete property if it is in new or cancelled state
 fixed check style and tutorial changes in estate_account and estate_property
@robodoo
Copy link

robodoo commented Jul 9, 2025

Pull request status dashboard

improve code and change file name according to guidelines
rename model name same as the record name
Copy link

@deso-odoo deso-odoo left a comment

Choose a reason for hiding this comment

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

Here is the review!

Some comments:

Follow commit message guidelines. This tool can be helpful.

  1. Last 2 Commits are useless you should use commit amend and fix it in the original commit.
  2. Commit messages should be objective, concise, and written in the third person, focusing on what was changed rather that who did it or how. eg: phrases like: "I added...", "I did...", "First I did X, then I did Y", etc should be avoided.
  3. Can you have a look at linting in all your files. I see too many linting issues.

@@ -0,0 +1 @@
from . import models

Choose a reason for hiding this comment

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

Try to always add a EOL in each file so that when someone adds lines in the future, the last line of the previous devs is not in the diff. Also github shows a red marker for it.

'name': 'real_estate',
'depends': [
'base_setup',
],

Choose a reason for hiding this comment

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

Shouldn't the dependency be base. Also Linting.
You change from base_setup to base in commit 2 better to use base from commit 1 itself.

@@ -0,0 +1,28 @@

Choose a reason for hiding this comment

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

Unnecessary empty line.


class EstateProperty(models.Model):
_name = "estate.property"
_description = "Estate"

Choose a reason for hiding this comment

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

Description could be little better. How about "Real Estate Property".

from odoo import fields, models

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

Choose a reason for hiding this comment

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

Module is named real_estate, but model is estate.property. It's better to be consistent either both should use real_estate as prefix or stick to "Estate" as name.

@@ -0,0 +1,48 @@
from odoo import models, fields, api

Choose a reason for hiding this comment

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

Sort them alphabetically.

<!-- Action Menu -->
<menuitem id="menu_estate_property_action" action="action_estate_property" parent="menu_real_estate_properties"/>

<menuitem id="setting"

Choose a reason for hiding this comment

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

Linting.

@api.depends('living_area', 'garden_area')
def _compute_total_area(self):
for record in self:
record.total_area = (record.living_area or 0.0) + (record.garden_area or 0.0)

Choose a reason for hiding this comment

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

Unnecessary diffs, better to keep these empty lines.

Comment on lines +22 to +26
property_type_id = fields.Many2one(
related="property_id.property_type_id",
store=True,
readonly=True
)

Choose a reason for hiding this comment

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

What will be the co-model for this?

if not record.selling_price:
raise UserError("Please set a Selling Price before generating an invoice.")

journal = self.env['account.journal'].search([('type', '=', 'sale')], limit=1)

Choose a reason for hiding this comment

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

This should be moved outside of for loop. Can you tell me the reason why?

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