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
aaha - Technical Training #49
Conversation
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.
Great work!
You managed to finish a setup.
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.
You are doing well!
Here are some small suggestions.
estate/models/estate_property.py
Outdated
name = fields.Char(required=True, string="Title") | ||
description = fields.Text(string="Description") | ||
postcode = fields.Char(string="Postcode") | ||
date_availability = fields.Date(default=fields.Date.add(fields.Date.today(), days=90), copy=False, string="Available From") |
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.
Not all months consist of 30 days, so to be more precise you can use months
option.
date_availability = fields.Date(default=fields.Date.add(fields.Date.today(), days=90), copy=False, string="Available From") | |
date_availability = fields.Date(default=fields.Date.add(fields.Date.today(), months=3), copy=False, string="Available From") |
estate/models/estate_property.py
Outdated
('offer received', 'Offer Received'), | ||
('offer accepted', 'Offer Accepted'), |
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.
By convention we use pyhon-like style.
('offer received', 'Offer Received'), | |
('offer accepted', 'Offer Accepted'), | |
('offer_received', 'Offer Received'), | |
('offer_accepted', 'Offer Accepted'), |
<field name="bedrooms"/> | ||
<field name="living_area"/> | ||
<field name="facades"/> | ||
<filter name="available" string="Available" domain="['|', ('state', '=', 'new'), ('state', '=', 'offer received')]"/> |
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.
As an alternative way you can write:
<filter name="available" string="Available" domain="['|', ('state', '=', 'new'), ('state', '=', 'offer received')]"/> | |
<filter name="available" string="Available" domain="[('state', 'in', ('new', 'offer_received'))]"/> |
estate/__manifest__.py
Outdated
@@ -0,0 +1,11 @@ | |||
# -*- coding: utf-8 -*- |
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.
Since recently it is not needed to add this line anymore.
# -*- coding: utf-8 -*- |
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.
Nice work, you are almost there!
<header> | ||
<button name="action_set_sold" type="object" string="SOLD" invisible="state == 'sold'"/> | ||
<button name="action_set_canceled" type="object" string="CANCEL" invisible="state == 'sold'"/> | ||
<field name="state" widget="statusbar" statusbar_visible="new,offer_received,offer_accepted,sold"/> | ||
</header> |
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.
header should be before sheet
according to the tutorial
@@ -0,0 +1,104 @@ | |||
<?xml version="1.0"?> | |||
<odoo> | |||
<record id="estate_property_action" model="ir.actions.act_window"> |
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.
usually we put actions after the views declaration
No description provided.