Skip to content
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

Closed
wants to merge 19 commits into from
Closed

Conversation

aaha-odoo
Copy link

No description provided.

Copy link

@vchu-odoo vchu-odoo left a 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.

Copy link

@vchu-odoo vchu-odoo left a 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.

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")

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.

Suggested change
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")

Comment on lines 29 to 30
('offer received', 'Offer Received'),
('offer accepted', 'Offer Accepted'),

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.

Suggested change
('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')]"/>

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:

Suggested change
<filter name="available" string="Available" domain="['|', ('state', '=', 'new'), ('state', '=', 'offer received')]"/>
<filter name="available" string="Available" domain="[('state', 'in', ('new', 'offer_received'))]"/>

@@ -0,0 +1,11 @@
# -*- coding: utf-8 -*-

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.

Suggested change
# -*- coding: utf-8 -*-

Copy link

@vchu-odoo vchu-odoo left a 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!

Comment on lines 39 to 43
<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>

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">

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

@AntoineVDV AntoineVDV closed this May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants