Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions estate/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
12 changes: 12 additions & 0 deletions estate/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "estate",
"depends": ["base"],
Comment thread
yoelfatihi marked this conversation as resolved.
Outdated
"application": True,
"author": "Yoelf",
"license": "LGPL-3",
"data": [
"security/ir.model.access.csv",
"views/estate_property_views.xml",
"views/estate_menus.xml",
],
}
Comment thread
yoelfatihi marked this conversation as resolved.
1 change: 1 addition & 0 deletions estate/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import estate_property
40 changes: 40 additions & 0 deletions estate/models/estate_property.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
from odoo import fields, models


class EstateProperty(models.Model):
_name = "estate.property"
_description = "properties managed by us"
name = fields.Char(required=True)
Comment thread
yoelfatihi marked this conversation as resolved.
description = fields.Text()
postcode = fields.Char()
date_availability = fields.Date(
copy=False, default=fields.Date.add(fields.Date.today(), months=3)
)
Comment thread
yoelfatihi marked this conversation as resolved.
expected_price = fields.Integer(required=True)
selling_price = fields.Integer(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(
string="orientation",
selection=[
("north", "North"),
("south", "South"),
("east", "East"),
("west", "West"),
],
)
active = fields.Boolean(default=True)
state = fields.Selection(
string="State",
selection=[
("new", "New"),
("offer_received", "Offer Received"),
("offer_accepted", "Offer Accepted"),
("sold", "Sold"),
("cancelled", "Cancelled"),
],
)
Comment thread
yoelfatihi marked this conversation as resolved.
2 changes: 2 additions & 0 deletions estate/security/ir.model.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
estate.access_estate_property,access_estate_property,estate.model_estate_property,base.group_user,1,1,1,1
Comment thread
yoelfatihi marked this conversation as resolved.
Outdated
Comment thread
yoelfatihi marked this conversation as resolved.
Outdated
8 changes: 8 additions & 0 deletions estate/views/estate_menus.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<odoo>
<menuitem id="estate_menu_root" name="Estate">
<menuitem id="estate_first_level_menu" name="Estate">
<menuitem id="estate_property_menu_action" action="estate_property_action"/>
Comment thread
yoelfatihi marked this conversation as resolved.
Outdated
</menuitem>
Comment on lines +7 to +10
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

XMLid naming is not correct here

</menuitem>
</odoo>
Comment thread
yoelfatihi marked this conversation as resolved.
Outdated
8 changes: 8 additions & 0 deletions estate/views/estate_property_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<odoo>
<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</field>
Comment thread
yoelfatihi marked this conversation as resolved.
Outdated
</record>
</odoo>
Comment thread
yoelfatihi marked this conversation as resolved.
Outdated