-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Tutorials #1202
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?
Tutorials #1202
Changes from 4 commits
39c9e64
9448e18
c8a3e91
077ffd7
b266f26
1d80309
e9e2d4c
cde4aaf
5bc4790
f7a41c9
a4e18a2
6d77cf4
0b90b2f
f7402bc
d2011ff
286105a
80e0a16
c267b65
aa77f29
9ce82fb
dcdfb4c
55b2bc5
0edbed8
b1bc98e
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,12 @@ | ||
| { | ||
| "name": "Real Estate", | ||
| "version": "1.0", | ||
| "depends": ["base"], | ||
| "author": "Anmol Dhaliwal", | ||
| "category": "Category", | ||
| "data": [ | ||
| "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,43 @@ | ||||||
| from odoo import fields, models | ||||||
| from dateutil.relativedelta import relativedelta | ||||||
|
|
||||||
| class RecurringPlan(models.Model): | ||||||
| _name = "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. We typically use single quotes for strings, and reserve double quotes for user-facing text.
Suggested change
I'll let you modify it at other places |
||||||
| _description = "A specific property" | ||||||
|
|
||||||
| name = fields.Char(required=True) | ||||||
| description = fields.Text() | ||||||
| postcode = fields.Char() | ||||||
| date_availability = fields.Date('Date Available', copy=False, default=(fields.Date.today() + relativedelta(months=3))) | ||||||
|
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. You should use a lambda here; otherwise, this value will be evaluated at server start and remain static. |
||||||
| 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( | ||||||
| string='Garden Orientation', | ||||||
| selection=[ | ||||||
| ('north', 'North'), | ||||||
| ('east', 'East'), | ||||||
| ('south', 'South'), | ||||||
| ('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'), | ||||||
| ], | ||||||
| required=True, | ||||||
| copy=False, | ||||||
| default='new' | ||||||
| ) | ||||||
| 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 | ||||||
|
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. Missing new line 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.
Suggested change
|
||||||
| 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_property_menu_root" name="Estate Properties"> | ||||||
| <menuitem id="properties" name="Properties"> | ||||||
|
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.
Suggested change
|
||||||
| <menuitem id="estate_model_menu_action" action="estate_property_action"/> | ||||||
|
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.
Suggested change
|
||||||
| </menuitem> | ||||||
| </menuitem> | ||||||
| </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. Here too |
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <odoo> | ||
| <record id="estate_property_action" model="ir.actions.act_window"> | ||
| <field name="name">Action Button</field> | ||
| <field name="res_model">estate.property</field> | ||
| <field name="view_mode">list,form</field> | ||
| </record> | ||
| </odoo> |
Uh oh!
There was an error while loading. Please reload this page.