Skip to content

Conversation

@danal-odoo
Copy link

@danal-odoo danal-odoo commented Nov 11, 2025

  1. estate module
    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.
  2. Awesome OWL
    Create Card, Counter and Todo component.
  3. Awesome Dashboard
    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.

@robodoo
Copy link

robodoo commented Nov 11, 2025

Pull request status dashboard

@danal-odoo danal-odoo marked this pull request as draft November 13, 2025 12:30
@danal-odoo danal-odoo force-pushed the 19.0-tutorial-danal branch 2 times, most recently from 89b75bc to dddb04b Compare November 13, 2025 13:44
Copy link

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

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.

@danal-odoo danal-odoo changed the title 19.0 tutorial danal [ADD] estate: Created new module Nov 14, 2025
@danal-odoo danal-odoo changed the title [ADD] estate: Created new module [ADD] estate: created new module Nov 14, 2025
Copy link

@bit-odoo bit-odoo left a 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?

@danal-odoo danal-odoo changed the title [ADD] estate: created new module created estate module Nov 15, 2025
@danal-odoo danal-odoo force-pushed the 19.0-tutorial-danal branch 3 times, most recently from e9fbfd7 to d1e1228 Compare November 18, 2025 18:03
@bit-odoo
Copy link

Hello @danal-odoo
I already informed you twice, but you haven't changed your commit message and PR title.

Can you please explain it to me why you push a separate commit for this type of changes?
Like this - 1a3bc65, cc1dabd

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.
@danal-odoo danal-odoo changed the title created estate module [ADD] estate: created estate module Nov 20, 2025
  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.
Copy link

@bit-odoo bit-odoo left a 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">

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>

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

Choose a reason for hiding this comment

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

Suggested change
if (this.props.onChange){
if (this.props.onChange) {

}

calculateSum(newValue) {
if (newValue > 0){

Choose a reason for hiding this comment

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

Suggested change
if (newValue > 0){
if (newValue > 0) {

if (newValue > 0){
this.state.sum++;
}
if (newValue < 0){

Choose a reason for hiding this comment

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

Suggested change
if (newValue < 0){
if (newValue < 0) {

@@ -1,10 +1,41 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">

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>

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(){

Choose a reason for hiding this comment

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

Suggested change
toggleIsCompleted(){
toggleIsCompleted() {

todo.isCompleted = !todo.isCompleted;
}

removeTodo(id){

Choose a reason for hiding this comment

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

Suggested change
removeTodo(id){
removeTodo(id) {


removeTodo(id){
const index = this.todos.findIndex((elem) => elem.id === id);
if (index >= 0){

Choose a reason for hiding this comment

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

Suggested change
if (index >= 0){
if (index >= 0) {

Comment on lines 12 to 18
_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."
)

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.

Comment on lines 82 to 84
self.garden_area = 10
self.garden_orientation = "north"
if not self.garden:

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?

Copy link
Author

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.

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?

Copy link
Author

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

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.

Copy link
Author

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.

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?

Copy link
Author

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.

Copy link
Author

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?

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.

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