-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[ADD] estate: initial module setup #1330
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
dhsri-odoo
wants to merge
7
commits into
odoo:19.0
Choose a base branch
from
odoo-dev:19.0-tutorials-dhsri
base: 19.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
998d196
[ADD] estate: initial module setup
dhsri-odoo bdd73fa
[ADD] estate: add property model and basic fields
dhsri-odoo ea937d0
[ADD] estate: add access rights for estate properties
dhsri-odoo 7a81e69
[ADD] estate: resolve missing error of author and license
dhsri-odoo 46b5922
[ADD] estate: add property defaults and state tracking
dhsri-odoo 4512cff
[ADD] estate: implement basic views for estate properties
dhsri-odoo 2a9c4e2
[IMP] estate: add property offers and tags models and views & Add de…
dhsri-odoo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| from . import models | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| { | ||
| "name": "Estate", | ||
| "depends": ["base"], | ||
| "application": True, | ||
| "data": [ | ||
| "security/ir.model.access.csv", | ||
| "views/estate_property_views.xml", | ||
| "views/estate_menus.xml", | ||
| "views/estate_form_views.xml", | ||
| "views/estate_property_type_views.xml", | ||
| "views/estate_property_tag_views.xml", | ||
| "views/estate_property_offer_views.xml", | ||
| "data/estate_property_type.xml", | ||
| "data/estate_property_tag.xml", | ||
| "data/estate_property_demo.xml" | ||
|
|
||
| ], | ||
| "author": "dheer", | ||
| "license": "LGPL-3", | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <odoo noupdate="1"> | ||
| <record id="estate_property_1" model="estate.property"> | ||
| <field name="name">apartment-1</field> | ||
| <field name="postcode">12345</field> | ||
| <field name="bedrooms">2</field> | ||
| <field name="living_area">230</field> | ||
| <field name="expected_price">10000</field> | ||
| <field name="expected_price">30000</field> | ||
| <field name="tag_ids" eval="[ Command.set([ ref('estate.estate_property_tag_1'), ref('estate.estate_property_tag_3') ])]"/> | ||
| </record> | ||
| <record id="estate_property_2" model="estate.property"> | ||
| <field name="name">apartment-2</field> | ||
| <field name="postcode">1245</field> | ||
| <field name="bedrooms">2</field> | ||
| <field name="living_area">230</field> | ||
| <field name="expected_price">10000</field> | ||
| <field name="expected_price">30000</field> | ||
| <field name="tag_ids" eval="[ Command.set([ ref('estate.estate_property_tag_3'), ref('estate.estate_property_tag_2') ])]"/> | ||
|
|
||
| </record> | ||
| <record id="estate_property_3" model="estate.property"> | ||
| <field name="name">apartment-3</field> | ||
| <field name="postcode">12345</field> | ||
| <field name="bedrooms">2</field> | ||
| <field name="living_area">230</field> | ||
| <field name="expected_price">10000</field> | ||
| <field name="expected_price">30000</field> | ||
|
|
||
| </record> | ||
| <record id="estate_property_4" model="estate.property"> | ||
| <field name="name">apartment-4</field> | ||
| <field name="postcode">12345</field> | ||
| <field name="bedrooms">2</field> | ||
| <field name="living_area">230</field> | ||
| <field name="expected_price">10000</field> | ||
| <field name="expected_price">30000</field> | ||
|
|
||
| </record> | ||
| <record id="estate_property_5" model="estate.property"> | ||
| <field name="name">apartment-5</field> | ||
| <field name="postcode">127745</field> | ||
| <field name="bedrooms">82</field> | ||
| <field name="living_area">230</field> | ||
| <field name="expected_price">10000</field> | ||
| <field name="expected_price">399000</field> | ||
|
|
||
| </record> | ||
| </odoo> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| <odoo noupdate="1"> | ||
| <record id="estate_property_tag_1" model="estate.property.tag"> | ||
| <field name="name">filter</field> | ||
| </record> | ||
|
|
||
| <record id="estate_property_tag_2" model="estate.property.tag"> | ||
| <field name="name">reno</field> | ||
| </record> | ||
|
|
||
| <record id="estate_property_tag_3" model="estate.property.tag"> | ||
| <field name="name">remodeled</field> | ||
| </record> | ||
| </odoo> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <odoo noupdate="1"> | ||
| <record id="estate_property_type_1" model="estate.property.type"> | ||
| <field name="name">villa</field> | ||
| </record> | ||
| <record id="estate_property_type_2" model="estate.property.type"> | ||
| <field name="name">apartment</field> | ||
| </record> | ||
| <record id="estate_property_type_3" model="estate.property.type"> | ||
| <field name="name">balcony</field> | ||
| </record> | ||
| </odoo> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <odoo> | ||
| <record id="estate_property_offer_list" model="ir.ui.view"> | ||
| <field name="name">estate.property.offer.list</field> | ||
| <field name="model">estate.property.offer</field> | ||
| <field name="arch" type="xml"> | ||
| <list string="offers" editable="top"> | ||
| <field name="price" string="Price"/> | ||
| <field name="partner_id" string="Partner"/> | ||
| <field name="status" string="Status"/> | ||
| </list> | ||
| </field> | ||
| </record> | ||
| <record id="estate_property_offer_form" model="ir.ui.view"> | ||
| <field name="name">estate.property.offer.form</field> | ||
| <field name="model">estate.property.offer</field> | ||
| <field name="arch" type="xml"> | ||
| <form string="offer"> | ||
| <sheet> | ||
| <group> | ||
| <field name="price" string="Price"/> | ||
| <field name="partner_id" string="Partner"/> | ||
| <field name="status" string="Status"/> | ||
| </group> | ||
| </sheet> | ||
| </form> | ||
| </field> | ||
| </record> | ||
| </odoo> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| from . import estate_property | ||
| from . import estate_property_type | ||
| from . import estate_property_tag | ||
| from . import estate_property_offer | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| from odoo import models, fields | ||
| from dateutil.relativedelta import relativedelta | ||
|
|
||
| class EstateProperty(models.Model): | ||
| _name = "estate.property" | ||
| _description = "real state property" | ||
|
|
||
| property_type_id =fields.Many2one( | ||
| "estate.property.type", | ||
| string="Poperty Type" | ||
| ) | ||
| buyer_id= fields.Many2one( | ||
| "res.partner", string="buyer", copy=False | ||
| ) | ||
| salesperson_id = fields.Many2one( | ||
| "res.users" , string ="sales person" ,default=lambda self: self.env.user | ||
| ) | ||
|
|
||
| tag_ids = fields.Many2many( | ||
| "estate.property.tag", | ||
| string="Tags" | ||
| ) | ||
| offer_ids = fields.One2many( | ||
| "estate.property.offer", | ||
| 'property_id', | ||
| string="Offer" | ||
| ) | ||
|
|
||
|
|
||
|
|
||
|
|
||
| name = fields.Char(required=True) | ||
| active = fields.Boolean(default=True) | ||
|
|
||
| description = fields.Text() | ||
| postcode = fields.Char() | ||
| date_availability = fields.Date( | ||
| copy=False, default=fields.Date.today() + relativedelta(months=3) | ||
| ) | ||
|
|
||
| expected_price = fields.Float(required=True) | ||
| selling_price = fields.Float(readonly=True, copy=False) | ||
|
|
||
| bedrooms = fields.Integer(default=2) | ||
| living_area = fields.Integer() | ||
| facades = fields.Integer() | ||
| garage = fields.Boolean() | ||
| garden = fields.Boolean() | ||
|
|
||
| garden_area = fields.Integer() | ||
|
|
||
| garden_orientation = fields.Selection( | ||
| [ | ||
| ("north", "North"), | ||
| ("south", "South"), | ||
| ("east", "East"), | ||
| ("west", "West"), | ||
| ] | ||
| ) | ||
|
|
||
| state = fields.Selection( | ||
| [ | ||
| ("new", "New"), | ||
| ("offer_received", "Offer Received"), | ||
| ("offer_accepted", "Offer Accepted"), | ||
| ("sold", "Sold"), | ||
| ("cancelled", "Cancelled"), | ||
| ] | ||
| ) | ||
|
|
||
| language= fields.selection([ | ||
| ('language','Language'),('hindi','Hindi') | ||
| ]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| from odoo import models,fields | ||
|
|
||
| class EstatePropertyOffer(models.Model): | ||
| _name = "estate.property.offer" | ||
| _description= "Property Offer" | ||
|
|
||
| name= fields.Char(required= True) | ||
| price= fields.Float() | ||
| status= fields.Selection([ | ||
| ('accepted','Acccepted'),('refused','Refused') | ||
| ]) | ||
| partner_id =fields.Many2one('res.partner',required=True) | ||
| property_id= fields.Many2one('estate.property',required=True) | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| from odoo import models,fields | ||
|
|
||
| class EstatePropertyTag(models.Model): | ||
| _name ="estate.property.tag" | ||
| _description = "Phis model provides tags for estate property" | ||
|
|
||
| name= fields.Char(required=True) | ||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| from odoo import models,fields | ||
|
|
||
| class EstatePropertyType(models.Model): | ||
| _name= "estate.property.type" | ||
| _description = "model for estate property types" | ||
| name= fields.Char(required=True) | ||
|
|
||
|
|
||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink | ||
| access_estate_property,estate.property,model_estate_property,base.group_user,1,1,1,1 | ||
| access_estate_property_type,estate.property.type,model_estate_property_type,base.group_user,1,1,1,1 | ||
| access_estate_property_tag,estate.property.tag,model_estate_property_tag,base.group_user,1,1,1,1 | ||
| access_estate_property_offer,estate.property.offer,model_estate_property_offer,base.group_user,1,1,1,1 | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Please follow the coding guidelines.
https://www.odoo.com/documentation/19.0/contributing/development/coding_guidelines.html#python