-
Notifications
You must be signed in to change notification settings - Fork 2k
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
base: 18.0
Are you sure you want to change the base?
Conversation
5223520
to
beaeb92
Compare
- initialization of Real estate module [email protected]
03a3238
to
cba07ab
Compare
- add estate.property - add estate.property basic fields [email protected]
- add estate.property security access [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]
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 start @annzzu ! Some remarks, mainly linting problem.
.gitignore
Outdated
@@ -127,3 +127,5 @@ dmypy.json | |||
|
|||
# Pyre type checker | |||
.pyre/ | |||
|
|||
.idea |
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.
@annzzu Missing blank line at the end of the file
estate/__init__.py
Outdated
@@ -0,0 +1,2 @@ | |||
# -*- coding: utf-8 -*- | |||
from . import models |
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.
Same here
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.
blank line still missing at the EOF
estate/__manifest__.py
Outdated
"views/estate_property_tag_views.xml", | ||
"views/estate_menus.xml", | ||
], | ||
'license': 'AGPL-3' |
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.
Prefer the license "LGPL-3"
estate/__manifest__.py
Outdated
'author': "Odoo", | ||
'website': "https://www.odoo.com/", | ||
'category': 'Tutorials/Real Estate', | ||
'version': '18.0.1.7.0', |
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.
The version of your module have to be applied. So, 1.0 should be consistent.
estate/models/estate_property.py
Outdated
('accepted', "Offer Accepted"), | ||
('sold', "Sold"), | ||
('cancelled', "Cancelled"), | ||
], required=True, copy=False, default='new', |
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 is not a list or a dict, they are arguments of the method Selection, no need to add a comma at the end.
], required=True, copy=False, default='new', | |
], required=True, copy=False, default='new' |
estate/security/ir.model.access.csv
Outdated
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 |
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.
blank line at the end of the file.
estate/views/estate_menus.xml
Outdated
<menuitem id="menu_property_tag" action="estate_property_tag_action" name="Property Tags"/> | ||
</menuitem> | ||
</menuitem> | ||
</odoo> |
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.
same here
<field name="view_mode">list,form</field> | ||
</record> | ||
</data> | ||
</odoo> |
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.
same here
<field name="view_mode">list,form</field> | ||
</record> | ||
</data> | ||
</odoo> |
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.
same here
<field name="search_view_id" ref="estate_property_search"/> | ||
</record> | ||
</data> | ||
</odoo> |
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.
and same here
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 can remove all the utf-8 encoding at the top of your files. That's the default value.
estate/__manifest__.py
Outdated
@@ -0,0 +1,25 @@ | |||
# -*- 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.
Not necessary, you can remove it.
estate/__init__.py
Outdated
@@ -0,0 +1,2 @@ | |||
# -*- 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.
Not necessary.
estate/models/__init__.py
Outdated
@@ -0,0 +1,6 @@ | |||
# -*- 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.
# -*- coding: utf-8 -*- |
664c01d
to
ca6f8e6
Compare
estate/__init__.py
Outdated
@@ -0,0 +1,2 @@ | |||
# -*- coding: utf-8 -*- | |||
from . import models |
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.
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]
ca6f8e6
to
43b8619
Compare
@annzzu You have 2 more linting problems: see below: |
- 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) |
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.
That's not necessary anymore with the recent version of Python:
super().create(vals_list)
- 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]
- Basic Kanban View for estate.property [email protected]
- Creating objects from xml [email protected]
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.
Seems good to me. 👍
@annzzu |
- refactoring the code [email protected]
0618f39
to
94c487e
Compare
- Chapter 1: Owl components (Displaying a counter) [email protected]
- Chapter 1.2: Owl components (Extract Counter in a sub component) [email protected]
a352b28
to
66382e7
Compare
- Chapter 1.4: Owl components (Using markup to display html) [email protected]
66382e7
to
d3f94bb
Compare
- 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"; |
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.
In JS we put a blank space after the opening curly brace and before the closing one.
import { TodoList }
Check your linter (EsLint) 👍
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.
@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; |
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 can use this.state.value++
increment() { | ||
this.state.value = this.state.value + 1; | ||
} | ||
} |
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.
Blank line missing, and on the other files too.
@@ -127,3 +127,5 @@ dmypy.json | |||
|
|||
# Pyre type checker | |||
.pyre/ | |||
|
|||
.idea |
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 file should not be in your commit.
@@ -0,0 +1,10 @@ | |||
import {Component} from "@odoo/owl"; |
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.
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> |
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.
indentation here.
} | ||
|
||
static props = { | ||
onChange: {type: Function, optional: true} |
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.
onChange: {type: Function, optional: true} | |
onChange: { type: Function, optional: true } |
<templates xml:space="preserve"> | ||
<t t-name="awesome_owl.Counter"> | ||
<div class="m-2 p-2 border d-inline-block"> |
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.
first indentation is 5 and the second one is 4. Intended?
<Counter onChange.bind="incrementSum" /> | ||
<Counter onChange.bind="incrementSum" /> |
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.
indentation... :)
shape: { | ||
id: Number, | ||
description: String, | ||
isCompleted: Boolean |
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.
linting
isCompleted: Boolean | |
isCompleted: Boolean, |
<!-- <field name="facades">4</field>--> | ||
<!-- <field name="garage">False</field>--> | ||
<!-- </record>--> | ||
|
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.
Why? 😆
No description provided.