Skip to content

Conversation

chkh-odoo
Copy link

Created a new module named Estate.

Created a new module named Estate. Completed till the basic ui of the module.
Created relational models, Computed fields, and On Changes.
Completed 8 modules out of 15.
Cleaned the code according to the coding standards
Completed 8 modules out of 15.
Completed the module along with the coding standards
When trying to delete a property, there was a validation issue which is resolved
in this commit.
Cleaned the code according to the coding conventions.
Made changes in the estate property schema as well
Implemented access rules for the users.
Added a new field named company_id in the estate property model.
@robodoo
Copy link

robodoo commented Dec 17, 2024

Pull request status dashboard

Copy link

@aktr-odoo aktr-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 a few changes. Can you please have a look?

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="estate_property_type_id1" model="estate.property.type">

Choose a reason for hiding this comment

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

Try to give proper names. Avoid _id1

Comment on lines 2 to 4
from . import estate_property_type
from . import estate_property_tags
from . import estate_property_offer

Choose a reason for hiding this comment

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

Arrange in alphabetical order

Comment on lines +9 to +15
user_id = fields.Many2one(
"res.users",
string="Salesperson",
index=True,
tracking=True,
default=lambda self: self.env.user,
)

Choose a reason for hiding this comment

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

Use proper formatting

Comment on lines 29 to 42
garden_orientation = fields.Selection(
[("north", "North"), ("south", "South"), ("east", "East"), ("west", "West")],
"Garden Orientation"
)
state = fields.Selection(
[
("new", "New"),
("offer_received", "Offer Received"),
("offer_accepted", "Offer Accepted"),
("sold", "Sold"),
("cancelled", "Cancelled"),
],
default="new",
)

Choose a reason for hiding this comment

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

Use proper formatting

Comment on lines +51 to +62
_sql_constraints = [
(
"check_expected_price",
"CHECK(expected_price >= 0)",
"A property expected price must be strictly positive",
),
(
"check_selling_price",
"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.

Use proper formatting

"You cannot delete a property that is not in New or Cancelled state."
)

def action_change_state(self):

Choose a reason for hiding this comment

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

Try to have separate functions


@api.model
def create(self, vals):
property_id = vals.get("property_id")

Choose a reason for hiding this comment

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

This wont work if multiple records are created. i.e. getting list of dict in vals

Copy link
Author

Choose a reason for hiding this comment

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

We don't have the functionality to add multiple offers for one property at a time, so do we need to implement this in our module?

Choose a reason for hiding this comment

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

but what if someone creates property by importing a file that has multiple offers

Comment on lines 2 to 9
1,access_estate_property,model_estate_property,estate.estate_group_manager,1,1,1,1
2,access_estate_property_type,model_estate_property_type,estate.estate_group_manager,1,1,1,1
3,access_estate_property_tags,model_estate_property_tags,estate.estate_group_manager,1,1,1,1
4,access_estate_property_offer,model_estate_property_offer,estate.estate_group_manager,1,1,1,1
5,access_estate_property,model_estate_property,estate.estate_group_user,1,1,1,0
6,access_estate_property_type,model_estate_property_type,estate.estate_group_user,1,0,0,0
7,access_estate_property_tags,model_estate_property_tags,estate.estate_group_user,1,0,0,0
8,access_estate_property_offer,model_estate_property_offer,estate.estate_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.

ids as 1,2,3?
Refer codebase and correct it

</list>
</field>
</record>

Choose a reason for hiding this comment

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

Remove extra space

<field name="res_model">estate.property</field>
<field name="view_mode">list,form,kanban</field>
<field name="context">{'search_default_active': True, 'search_default_current': True}</field>
</record>

Choose a reason for hiding this comment

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

add a blank line here

… and users.

This commit includes:
1) Implementation of a wizard to add a single offer to multiple properties.
2) Download reports for multiple properties and users.
3) Code cleaning according to the coding conventions.
Features added:
1) User can create their WhatsApp templates.
2) A WhatsApp message will be sent to the buyer when the property
is sold.
Specification:
1) Different warranty configurations can be created. Example- 1 year, 2 year.
2) Warranty can be added for products in the sales order.
What I have fixed:
1) If the user deletes the product from the sale order line, the attached
warranty will also be deleted.
2) If a product is attached with a warranty it will not show in the wizard list.
Changes made:
1) removed the wizard_id field as there was a pre-created field in the sale order
line i.e. linked_line_id.
Before this commit:
The warranty was not being deleted on the click of the delete button for the
sale order line or related product.

After This commit:
The warranty is deleted on the click of the delete button for the
sale order line or related product.
@chkh-odoo chkh-odoo closed this Jan 8, 2025
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