-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[ADD] estate: created estate module #1022
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?
Conversation
89b75bc to
dddb04b
Compare
bit-odoo
left a comment
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.
Hello!
Nice work.
i have added some comments please have a look.
Can you please adapt your commit message and you need to add PR title and description.
you can take reference from here for commit message and title :- https://www.odoo.com/documentation/19.0/contributing/development/git_guidelines.html#commit-message-full-description
| @@ -0,0 +1,78 @@ | |||
| #!/usr/bin/env python3 | |||
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.
It is not necessary to add.
dddb04b to
63624e0
Compare
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.
Hello,
I have added some comments.
Can you please adapt your commit messages as I informed you in the first review?
d90aff1 to
52a72e8
Compare
e9fbfd7 to
d1e1228
Compare
|
Hello @danal-odoo Can you please explain it to me why you push a separate commit for this type of changes? |
1516839 to
081eea5
Compare
added estate module. created __init__.py and __manifest__.py files.
created estate property model. added all required fields in model.
added security CSV file in security folder. added estate_property model access to user in csv file.
added action view in estate property. created menuitems and linked action to that menuitems. updated manifest file to link all created file.
implemented form in views and added model fields in estate_property model. modified views and menuitem names.
…ality. added estate property form and list view. added search with filter and group_by functionality.
added estate_property_offer model and created required fields. added estate_property_tag model and created required fields. added estate_property_type model and created required fields. added models acces to user.
added @api.depends() decorator to calculate total area and best prrice. added @api.onchange() decorator to auto fill garden_area and orientation on garden change.
added action method on sold and cancel button. added UserError() to prevent sold property to cancel. added UserError() to prevent cancelled property to be sold.
…er view [FIX] estate: code formatting and rename compute method Improved code readability by applying consistent formatting. Renamed compute method for best_price to follow naming conventions. changed discription position after name in manifest file.
added stat button in property type to show quick offer list. added inline views in property types to get related fields from other model. added order method in models, views, manual. improved some logic in percentage calculation. code formation.
added python inheritance, model inheritance, view inheritance. added create function to change state from 'new' to 'offer_received'. separated all property action to it's own views file.
created Estate Account module and necessary files. added invoicing functionality by using inherit method. added UserError on sold button if no offer are accepted.
added kanban view in property default group by types. fixed state button to show offers in number with proper format. added option attr to all numerical field to prevent user error. added group by state in search.
… component. added counter button and component in playground xml. created counter and card component with it's xml and js files. added property field in sales order form using inheritance.
added markup() to render html element from component. added props validation in content in Card component. added calculateSum function to calculate sum of counter.
081eea5 to
ff459f4
Compare
added todo component and created todolist and todoitem. created function to add todo item by user. fixed layout to be look more organize.
created todo component and in that component created todoitem and todolist. added todoitem in todolist to get all created todoitem with todolist using props. added todolist in playground.js to render all todolist. made card component dynamic by using slots prop by seting type to object. added card toogle button to show card content or not. made offer action button invisible if one offer is accepted.
added layout component in dashboard.js. created dashboard.scss to use className in xml. added display prop in layout.
added customers and leads button in controlpanel layout. linked onclick in button function to call view action for customers and leads.
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.
Hello,
I have added some suggestions.
| @@ -1,8 +1,47 @@ | |||
| <?xml version="1.0" encoding="UTF-8" ?> | |||
| <templates xml:space="preserve"> | |||
|
|
|||
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.
unneccary diff.
| </div> | ||
| </Layout> | ||
| </t> | ||
|
|
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.
unneccary diff.
|
|
||
| increment() { | ||
| this.state.value++; | ||
| if (this.props.onChange){ |
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.
| if (this.props.onChange){ | |
| if (this.props.onChange) { |
awesome_owl/static/src/playground.js
Outdated
| } | ||
|
|
||
| calculateSum(newValue) { | ||
| if (newValue > 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.
| if (newValue > 0){ | |
| if (newValue > 0) { |
awesome_owl/static/src/playground.js
Outdated
| if (newValue > 0){ | ||
| this.state.sum++; | ||
| } | ||
| if (newValue < 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.
| if (newValue < 0){ | |
| if (newValue < 0) { |
| @@ -1,10 +1,41 @@ | |||
| <?xml version="1.0" encoding="UTF-8" ?> | |||
| <templates xml:space="preserve"> | |||
|
|
|||
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.
unneccary diff.
| </Card> | ||
| </div> | ||
| </t> | ||
|
|
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.
unneccary diff.
| removeTodo: Function | ||
| }; | ||
|
|
||
| toggleIsCompleted(){ |
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.
| toggleIsCompleted(){ | |
| toggleIsCompleted() { |
| todo.isCompleted = !todo.isCompleted; | ||
| } | ||
|
|
||
| removeTodo(id){ |
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.
| removeTodo(id){ | |
| removeTodo(id) { |
|
|
||
| removeTodo(id){ | ||
| const index = this.todos.findIndex((elem) => elem.id === id); | ||
| if (index >= 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.
| if (index >= 0){ | |
| if (index >= 0) { |
1cb7a42 to
a7b2f9e
Compare
estate/models/estate_property.py
Outdated
| _check_expected_price = models.Constraint( | ||
| "CHECK(expected_price > 0)", | ||
| "A property expected price must be strictly positive.", | ||
| ) | ||
| _check_selling_price = models.Constraint( | ||
| "CHECK(selling_price >= 0)", "A property selling price must be positive." | ||
| ) |
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.
It is good that we can declare it after the fields.
estate/models/estate_property.py
Outdated
| self.garden_area = 10 | ||
| self.garden_orientation = "north" | ||
| if not self.garden: |
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 multiple times change the value if the garden is not true?. It is unnecessarily writing a value.
Can you please explain it to me?
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.
so i used inverse condition to avoid use of else in this function but now i understand my mistake if i don't use else then it will first store garden_area = 10 and then orientation = "north" every time this onchange function is called so i have to use if else condition to avoid extra db write.
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 do you want to avoid the else condition?. Could you please explain it?
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.
to reduce check condition and make code faster
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.
Is else reduce performance? I don't think it is right.
Currently, your code causes performance issues.
Can you please elaborate properly? So I can understand your thought.
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.
yes sir current code is causing performance issue cause it is writing 2 fields without any reason those extra write can give huge impact on busy server and i totally forgot about that performance issue in db i focused on making current function more optimized but it was not space efficient and in db it is very important to use every ORM carefully to reduce impact on dbservers i have revert back to my original optimized logic to fix performance issue.
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.
Can you please explain to me what you wrote here #1022 (comment)
make code faster.
How else cause the performance issue?
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.
like it will not check if condition first then it is false and then run else instead it will directly assign garden_area = 10 and orientation to "north" cause at first garden is by default false so second condition will not run but will cause issue when garden change from True to False it will rewrite those true condition again so will query 4 time after change of garden so yes it is not faster.
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.
Can you please explain to me what you wrote here #1022 (comment)
make code faster.How
elsecause the performance issue?
no sir, else does not reduce performance and it was my mistake to remove else. infect in this case it increase performance by reducing db query.
a7b2f9e to
86496fb
Compare
added DashboardItem component. added slot props in DashboardItem and created a dynamic card in xml. added rpc call in onWillStart(). render all return values in it's separate card in dashboard.xml. added state as 'badge' widget in kanban view in estate module. refined garden onchange logic.
86496fb to
ced1c9f
Compare
created service to load rpc call and load rpc data. added interval for rpc call to refresh data every 10 minuets. added Chart to show t-shirt size in chart view. load dashboard as lazy-loading by register that Component to lazy-components.
added a settings icon near Dashboard in Layout component. added popup form to select which item to show/hide in Dashboard. added function which will store those settings in Browser's local storage.
77277ba to
38cc6e5
Compare
added onchange on offer_ids if len(offer_ids) is zero then will change state to 'new'. fixed state button layout was in header first shifted to context menu. added sold button disabled when there is no offer accepted and if offer is accepted then will show in highlight color.
3733b88 to
5d27874
Compare

Create new module estate module for manage estate property with feature like create new property manage buy and sell with usererror and database constraint to reduce miss matched data to be enter in DB.
Create Card, Counter and Todo component.
add customers and leads button in layout and added dynamic card layout to render items with chartcard and numbercard. dashboard data will be refresh every 10 mins and added lazyloading to Dashboard.