-
Notifications
You must be signed in to change notification settings - Fork 3k
[ADD] estate: set up real estate advertisement module(CH2,CH3 Done) #1187
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
base: 19.0
Are you sure you want to change the base?
Changes from all commits
42dea24
40b094e
de16474
694ab41
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| from . import models |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| { | ||
| 'name': 'RealEstate', | ||
| 'version': '1.0', | ||
| 'category': 'Real Estate/Brokerage', | ||
| 'summary': 'A module to manage real estate advertisements and property offers', | ||
| 'description': """A simple module to manage real estate ads.List your properties, track details like bedrooms and garden,let buyers make offers, and accept or reject them.""", | ||
| 'author': 'Pranjali Sangavekar(prsan)', | ||
| 'license': 'LGPL-3', | ||
| 'depends': ['base'], | ||
| 'application': True, | ||
| 'installable': True, | ||
| 'data': [ | ||
| 'security/security.xml', | ||
| 'security/ir.model.access.csv', | ||
| 'views/estate_property_views.xml', | ||
| 'views/estate_menus.xml', | ||
| ], | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| from . import estate_property |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| from dateutil.relativedelta import relativedelta | ||
| from odoo import models, fields | ||
|
Comment on lines
+1
to
+2
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please follow the import coding guidelines? |
||
|
|
||
|
|
||
| class Estate_Property(models.Model): | ||
| _name = "estate.property" #table name in DB = estate_property | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Writing a comment is good. But we can write a comment only when it is necessary, like a complex computation, etc. |
||
| _description = "Real estate system" | ||
|
|
||
| name = fields.Char(string="Property Name", required=True) | ||
| description = fields.Text() | ||
| postcode = fields.Char(string="Postal Code") | ||
| date_availability = fields.Date(copy=False, default=lambda self: fields.Date.today() + relativedelta(months=3)) | ||
| expected_price = fields.Float(string="Expected Price", 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(selection=[('north', 'North'), ('south', 'South'), ('east', 'East'), ('west', 'West')]) | ||
| active = fields.Boolean(default=True) | ||
| state = fields.Selection( | ||
| selection=[ | ||
| ('new', 'New'), | ||
| ('offer_received', 'Offer Received'), | ||
| ('offer_accepted', 'Offer Accepted'), | ||
| ('sold', 'Sold'), | ||
| ('cancelled', 'Cancelled'), | ||
| ], | ||
| required=True, copy=False, default='new' | ||
| ) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||
| access_estate_property_manager,estate.property manager,model_estate_property,estate.estate_group_manager,1,1,1,1 | ||
| access_estate_property_user,estate.property agent,model_estate_property,estate.estate_group_user,1,1,0,0 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be one empty line at the end of the file. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <odoo> | ||
| <data> | ||
| <record model="res.groups.privilege" id="groups_privilege_real_estate"> | ||
| <field name="name">Real Estate</field> | ||
| <field name="category_id" ref="base.module_category_real_estate_brokerage"/> | ||
| </record> | ||
|
|
||
| <record id="estate_group_user" model="res.groups"> | ||
| <field name="name">Agent</field> | ||
| <field name="privilege_id" ref="groups_privilege_real_estate"/> | ||
| </record> | ||
|
|
||
| <record id="estate_group_manager" model="res.groups"> | ||
| <field name="name">Manager</field> | ||
| <field name="privilege_id" ref="groups_privilege_real_estate"/> | ||
| <field name="implied_ids" eval="[Command.link(ref('estate_group_user'))]"/> | ||
| </record> | ||
| <record id="base.user_admin" model="res.users"> | ||
| <field name="group_ids" eval="[Command.link(ref('estate_group_manager'))]"/> | ||
| </record> | ||
| </data> | ||
| </odoo> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be one empty line at the end of the file. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <odoo> | ||
| <menuitem id="estate_menu_root" name="Real Estate"> | ||
| <menuitem id="estate_first_level_menu" name="Advertisements"> | ||
| <menuitem id="estate_property_menu_action" action="estate_property_action"/> | ||
| </menuitem> | ||
| </menuitem> | ||
| </odoo> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <odoo> | ||
| <record id="esatae_porpoerty_view_form" model="ir.ui.view"> | ||
| <field name="name">estate.property.form</field> | ||
| <field name="model">estate.property</field> | ||
| <field name="arch" type="xml"> | ||
| <form> | ||
| <sheet> | ||
| <h1> | ||
| <field name="name"/> | ||
| </h1> | ||
| <group> | ||
| <group> | ||
| <field name="postcode"/> | ||
| <field name="date_availability"/> | ||
| </group> | ||
| <group> | ||
| <field name="expected_price"/> | ||
| <field name="selling_price"/> | ||
| </group> | ||
| </group> | ||
| <notebook> | ||
| <page string="Description"> | ||
| <group> | ||
| <field name="description"/> | ||
| <field name="bedrooms"/> | ||
| <field name="living_area" string="Living Area (sqm)"/> | ||
| <field name="facades"/> | ||
| <field name="garage"/> | ||
| <field name="garden"/> | ||
| <field name="garden_area" string="Garden Area (sqm)"/> | ||
| <field name="garden_orientation"/> | ||
| </group> | ||
| </page> | ||
| </notebook> | ||
| </sheet> | ||
| </form> | ||
| </field> | ||
| </record> | ||
|
|
||
| <record id="estate_property_view_list" model="ir.ui.view"> | ||
| <field name="name">estate.property.list</field> | ||
| <field name="model">estate.property</field> | ||
| <field name="arch" type="xml"> | ||
| <list> | ||
| <field name="name" string="Title"/> | ||
| <field name="postcode" string="Postcode"/> | ||
| <field name="bedrooms"/> | ||
| <field name="living_area" string="Living Area (sqm)"/> | ||
| <field name="expected_price"/> | ||
| <field name="selling_price"/> | ||
| <field name="date_availability" string="Available From"/> | ||
| </list> | ||
| </field> | ||
| </record> | ||
| <record id="estate_property_action" model="ir.actions.act_window"> | ||
| <field name="name">Properties</field> | ||
| <field name="res_model">estate.property</field> | ||
| <field name="view_mode">list,form</field> | ||
| </record> | ||
| </odoo> |
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.
What is the use of
'installable': True,?