-
Notifications
You must be signed in to change notification settings - Fork 3.3k
vibel - Technical Training #1384
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 8 commits
404841d
d88a5e6
6570e15
16a92c3
e87b554
470a5a7
1aeaf00
2a695bf
fe65c6e
f69c7ea
6760dd3
aa68943
e998054
f8082f9
8db5a91
b8b5eca
ffd399c
4040916
d0194c0
44f9335
1ee002f
6592312
a245293
845d23e
44d5801
966bc4c
cd8cbee
3c4b816
ec66507
9a349a2
3a20c40
d7bacdc
7ec6b6d
000a246
89adeae
2f47002
2042225
c9d7d54
285812a
c234eff
3a6f55a
9e28f16
2e5c516
9624419
dc83b5c
42b6b97
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,19 @@ | ||
| { | ||
| 'name': 'Real Estate', | ||
| 'version': '0.1', | ||
| 'sequence': 100, | ||
| 'summary': 'Real Estate Advertisement', | ||
| 'depends': [ | ||
| 'base' | ||
| ], | ||
| 'data': [ | ||
| 'views/estate_property_views.xml', | ||
| 'views/estate_menus.xml', | ||
| 'security/ir.model.access.csv' | ||
| ], | ||
| 'installable': True, | ||
| 'application': True, | ||
| 'assets': {}, | ||
| 'author': 'Odoo S.A.', | ||
| 'license': 'LGPL-3', | ||
| } | ||
| 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,36 @@ | ||
| from dateutil.relativedelta import relativedelta | ||
| from odoo import models, fields | ||
|
|
||
|
|
||
| class EstateProperty(models.Model): | ||
| _name = 'estate.property' | ||
| _description = 'Estate Property' | ||
|
|
||
| name = fields.Char('Title', required=True, translate=True) | ||
| description = fields.Text('Description', translate=True) | ||
| postcode = fields.Char('Postcode') | ||
| date_availability = fields.Date( | ||
| string='Available From', | ||
| default=lambda _: fields.Date.today() + relativedelta(months=3), | ||
| copy=False | ||
| ) | ||
| expected_price = fields.Float('Expected price', required=True) | ||
| selling_price = fields.Float('Selling price', readonly=True, copy=False) | ||
| bedrooms = fields.Integer('Bedrooms', default=2) | ||
| living_area = fields.Integer('Living area (sqm)') | ||
| facades = fields.Integer('Facades') | ||
| garage = fields.Boolean('Garage', default=False) | ||
| garden = fields.Boolean('Garden', default=False) | ||
| garden_area = fields.Integer('Garden area (sqm)') | ||
| garden_orientation = fields.Selection( | ||
| string='Garden orientation', | ||
| selection=[('north', 'North'), ('south', 'South'), ('east', 'East'), ('west', 'West')], | ||
| help='Garden orientation is important for determining how much sunlight and warmth the outdoor space receives' | ||
| ) | ||
| active = fields.Boolean('Active', default=False) | ||
| status = fields.Selection( | ||
| string='Status', | ||
| selection=[('new', 'New'), ('offer_received', 'Offer Received'), ('offer_accepted', 'Offer Accepted'), ('sold', 'Sold'), ('cancelled', 'Cancelled')], | ||
| default='new', | ||
| required=True, | ||
| ) |
| 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 | ||
| access_estate_property,estate.property access,model_estate_property,base.group_user,1,1,1,1 |
| 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_menu_advertisements" name="Advertisements"> | ||
| <menuitem id="estate_menu_properties_action" action="estate_properties_action"/> | ||
| </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. I think you already noticed and you changed it yourself multiple times. We have to add an empty line always in the end of each file
Author
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. Yes, I always forget it, I'll fix it asap! |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <odoo> | ||
| <data> | ||
| <record id="estate_properties_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> | ||
| </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. Same ☝️ |
||
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.
this normally should come first in this list as security is the most important to be loaded first to apply it to the view while installing the module