Skip to content

ANZU - Technical Training #728

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

Open
wants to merge 22 commits into
base: 18.0
Choose a base branch
from
Open

Conversation

annzzu
Copy link

@annzzu annzzu commented Apr 22, 2025

No description provided.

@robodoo
Copy link

robodoo commented Apr 22, 2025

Pull request status dashboard

@annzzu annzzu force-pushed the 18.0-tutorial-anzu branch from 5223520 to beaeb92 Compare April 22, 2025 13:58
@annzzu annzzu force-pushed the 18.0-tutorial-anzu branch from 03a3238 to cba07ab Compare April 22, 2025 20:22
Ana Zurabashvili [anzu] added 8 commits April 22, 2025 22:30
- add estate.property
- add estate.property basic fields

[email protected]
- add estate.property menus, action
- add estate.property state selection field
- add estate.property field attributes

[email protected]
- add estate.property basic views
- ref estate.property field names

[email protected]
- Created property type, tag, and offer models.

- Added many2one (type, buyer, seller), many2many (tags), and one2many (offers) relations to property model.

[email protected]
- add computed fields: total_area, best_price, date_deadline.
- add Onchange: Default garden area and orientation.

[email protected]
- Add "Cancel" and "Sold" buttons to estate.property with state change logic and constraints.
- Add "Accept" and "Refuse" buttons to estate.property.offer.
- Accepting an offer sets the property's buyer and selling price.
- Added constraint that only one offer can be accepted per property.

[email protected]
- Add "Cancel" and "Sold" buttons to estate.property with state change logic and constraints.
- Add "Accept" and "Refuse" buttons to estate.property.offer.
- Accepting an offer sets the property's buyer and selling price.
- Added constraint that only one offer can be accepted per property.

[email protected]
@annzzu annzzu changed the title [ANZU] Technical Training ANZU - Technical Training Apr 22, 2025
Copy link

@SergeBayet SergeBayet left a comment

Choose a reason for hiding this comment

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

Great start @annzzu ! Some remarks, mainly linting problem.

.gitignore Outdated
@@ -127,3 +127,5 @@ dmypy.json

# Pyre type checker
.pyre/

.idea

Choose a reason for hiding this comment

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

@annzzu Missing blank line at the end of the file

@@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
from . import models

Choose a reason for hiding this comment

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

Same here

Choose a reason for hiding this comment

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

blank line still missing at the EOF

"views/estate_property_tag_views.xml",
"views/estate_menus.xml",
],
'license': 'AGPL-3'

Choose a reason for hiding this comment

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

Prefer the license "LGPL-3"

'author': "Odoo",
'website': "https://www.odoo.com/",
'category': 'Tutorials/Real Estate',
'version': '18.0.1.7.0',

Choose a reason for hiding this comment

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

The version of your module have to be applied. So, 1.0 should be consistent.

('accepted', "Offer Accepted"),
('sold', "Sold"),
('cancelled', "Cancelled"),
], required=True, copy=False, default='new',

Choose a reason for hiding this comment

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

This is not a list or a dict, they are arguments of the method Selection, no need to add a comma at the end.

Suggested change
], required=True, copy=False, default='new',
], required=True, copy=False, default='new'

estate.access_estate_property,access_estate_property,estate.model_estate_property,base.group_user,1,1,1,1
estate.access_estate_property_tag,access_estate_property_tag,estate.model_estate_property_tag,base.group_user,1,1,1,1
estate.access_estate_property_type,access_estate_property_type,estate.model_estate_property_type,base.group_user,1,1,1,1
estate.access_estate_property_offer,access_estate_property_offer,estate.model_estate_property_offer,base.group_user,1,1,1,1

Choose a reason for hiding this comment

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

blank line at the end of the file.

<menuitem id="menu_property_tag" action="estate_property_tag_action" name="Property Tags"/>
</menuitem>
</menuitem>
</odoo>

Choose a reason for hiding this comment

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

same here

<field name="view_mode">list,form</field>
</record>
</data>
</odoo>

Choose a reason for hiding this comment

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

same here

<field name="view_mode">list,form</field>
</record>
</data>
</odoo>

Choose a reason for hiding this comment

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

same here

<field name="search_view_id" ref="estate_property_search"/>
</record>
</data>
</odoo>

Choose a reason for hiding this comment

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

and same here

Copy link

@SergeBayet SergeBayet left a comment

Choose a reason for hiding this comment

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

You can remove all the utf-8 encoding at the top of your files. That's the default value.

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

Choose a reason for hiding this comment

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

Not necessary, you can remove it.

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

Choose a reason for hiding this comment

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

Not necessary.

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

Choose a reason for hiding this comment

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

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

@annzzu annzzu force-pushed the 18.0-tutorial-anzu branch from 664c01d to ca6f8e6 Compare April 23, 2025 08:32
@@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
from . import models

Choose a reason for hiding this comment

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

blank line still missing at the EOF

- Inline views
- Widgets & Attributes: Enhanced field display and behavior.
- List features: Configured default ordering and enabled quick edits.
- Search: Improved filtering options.
- Stat button: Added link to related offers.
- [REF] refactoring feedback

[email protected]
@annzzu annzzu force-pushed the 18.0-tutorial-anzu branch from ca6f8e6 to 43b8619 Compare April 23, 2025 08:36
@SergeBayet
Copy link

@annzzu You have 2 more linting problems: see below:

image

@SergeBayet
Copy link

Yeah! Congrats:
image

- Implemented Python inheritance to modify create and delete behavior.
- Extended res.users model to include salesperson properties.
- Modified user form view to display assigned properties.

[email protected]
property_id.write({
'state': 'received',
})
return super(EstatePropertyOffer, self).create(vals_list)

Choose a reason for hiding this comment

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

That's not necessary anymore with the recent version of Python:

super().create(vals_list)

Ana Zurabashvili [anzu] added 3 commits April 23, 2025 14:26
- Created estate_account link module, dependent on estate and account.
- Extended estate.property model to generate invoices on sale.
Implemented invoice creation, including invoice lines for sales commission (6%) and admin fees (100).

[email protected]
Copy link

@SergeBayet SergeBayet left a comment

Choose a reason for hiding this comment

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

Seems good to me. 👍

@SergeBayet
Copy link

@annzzu
Runbot is not happy:
image

@annzzu annzzu force-pushed the 18.0-tutorial-anzu branch from 0618f39 to 94c487e Compare April 28, 2025 20:06
Ana Zurabashvili [anzu] added 2 commits April 28, 2025 22:07
- Chapter 1: Owl components (Displaying a counter)

[email protected]
- Chapter 1.2: Owl components (Extract Counter in a sub component)

[email protected]
@annzzu annzzu force-pushed the 18.0-tutorial-anzu branch from a352b28 to 66382e7 Compare April 28, 2025 20:25
- Chapter 1.4: Owl components (Using markup to display html)

[email protected]
@annzzu annzzu force-pushed the 18.0-tutorial-anzu branch from 66382e7 to d3f94bb Compare April 28, 2025 20:37
Ana Zurabashvili [anzu] added 3 commits April 28, 2025 22:38
- Chapter 1.5: Owl components (Props validation)

[email protected]
- Chapter 1.6: Owl components (The sum of two Counter)

[email protected]
- Chapter 1.7: Owl components (A todo list)

[email protected]
@@ -3,11 +3,12 @@
const {markup, Component, useState} = owl;
import {Counter} from "./counter/counter";
import {Card} from "./card/card";
import {TodoList} from "./todo_list/todo_list";

Choose a reason for hiding this comment

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

In JS we put a blank space after the opening curly brace and before the closing one.
import { TodoList }
Check your linter (EsLint) 👍

Copy link

@SergeBayet SergeBayet left a comment

Choose a reason for hiding this comment

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

@annzzu Her's my review. Some remarks. Pay attention to the tab indentations in your xml files.

}

increment() {
this.state.value = this.state.value + 1;

Choose a reason for hiding this comment

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

you can use this.state.value++

increment() {
this.state.value = this.state.value + 1;
}
}

Choose a reason for hiding this comment

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

Blank line missing, and on the other files too.

@@ -127,3 +127,5 @@ dmypy.json

# Pyre type checker
.pyre/

.idea

Choose a reason for hiding this comment

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

This file should not be in your commit.

@@ -0,0 +1,10 @@
import {Component} from "@odoo/owl";

Choose a reason for hiding this comment

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

Suggested change
import {Component} from "@odoo/owl";
import { Component } from "@odoo/owl";

<div class="card d-inline-block m-2" style="width: 18rem;">
<div class="card-body">
<h5 class="card-title"><t t-out="props.title"/></h5>
<p class="card-text"><t t-out="props.content"/></p>

Choose a reason for hiding this comment

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

indentation here.

}

static props = {
onChange: {type: Function, optional: true}

Choose a reason for hiding this comment

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

Suggested change
onChange: {type: Function, optional: true}
onChange: { type: Function, optional: true }

Comment on lines +2 to +4
<templates xml:space="preserve">
<t t-name="awesome_owl.Counter">
<div class="m-2 p-2 border d-inline-block">

Choose a reason for hiding this comment

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

first indentation is 5 and the second one is 4. Intended?

Comment on lines +7 to +8
<Counter onChange.bind="incrementSum" />
<Counter onChange.bind="incrementSum" />

Choose a reason for hiding this comment

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

indentation... :)

shape: {
id: Number,
description: String,
isCompleted: Boolean

Choose a reason for hiding this comment

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

linting

Suggested change
isCompleted: Boolean
isCompleted: Boolean,

<!-- <field name="facades">4</field>-->
<!-- <field name="garage">False</field>-->
<!-- </record>-->

Choose a reason for hiding this comment

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

Why? 😆

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.

3 participants