-
Notifications
You must be signed in to change notification settings - Fork 754
Technical Training - Alecc #72
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: master
Are you sure you want to change the base?
Conversation
…bility and state fields, and updating selling_price to be non-copyable. Introduce active field for property status management.
…ed', 'Offer Accepted', 'Sold', and 'Cancelled' to the state field selection.
…ls including name, postcode, bedrooms, living area, expected price, selling price, and date availability.
…ty entry, including fields for name, availability date, pricing, description, and various property features.
…y searching with quick search fields, filters, and grouping options.
…ws, and update estate property model to include property type relation. Enhance manifest and access control for new model.
…te property model to include many2many relationship for tags and enhance manifest and menu structure to support new functionality.
…tate property model to include one2many relationship for offers and enhance manifest to support new functionality.
…views to improve consistency and clarity in the user interface.
…d' instead of 'active_id' for improved data accuracy.
…odel, and implement validity and deadline fields in EstatePropertyOffer model. Update views to display new fields.
…Offer model, and implement onchange method for garden in EstateProperty model to automatically set garden area and orientation based on garden presence.
…yOffer model, and implement cancellation and sold state actions in EstateProperty model. Update views to include new action buttons for improved user interaction.
…ility conditions for 'Sold' and 'Cancel' actions.
…r 'Sold' and 'Cancel' actions to improve user interface clarity.
…just visibility conditions based on offer status for improved user experience.
…ty views, with icons and visibility conditions based on offer status to enhance user interaction.
…atePropertyOffer, EstatePropertyTag, and EstatePropertyType models for data integrity.
…sure expected and selling prices are positive, and enforce a minimum selling price threshold based on expected price for improved data integrity and user feedback.
…r, updating view definitions for improved data representation and user interaction. Implement ordering for offers and property types to streamline listings.
…conditions and enhance user interaction by simplifying the list display for offers.
…tion and interaction by allowing access to offer listings based on property type.
…ine view files and improve maintainability.
…ds and simplifying the structure to enhance maintainability and user experience.
…s to display related properties. Introduced a new notebook page for properties in the estate property type form for improved data organization and user interaction.
…ding delete behavior for property offers and ensuring related offers are removed upon property deletion to maintain data integrity.
…rtyType models, updating views accordingly for improved data organization and user interaction.
…ional decorations for property states, improving visual feedback for users.
… multiple offer states, enhancing visual feedback for users.
…w to include priority field for improved display order.
…r_accepted' state, enhancing visual distinction for users.
…d reference the view ID, improving visual organization and navigation.
…'offer_accepted' state, enhancing visual clarity for users.
…PropertyOffer, ensuring state consistency for new offers.
…sed on offer status, improving user interaction by preventing actions on accepted or refused offers.
- Introduced a One2many relationship for offers in the EstatePropertyType model. - Added a computed field to count the number of offers associated with each property type. - Updated the estate_property_offer_views.xml to include an action for managing offers. - Enhanced estate_property_type_views.xml to display offer count and provide a button for accessing offers, improving user interaction and data visibility.
…ntain clarity in view definitions.
…ead of 'active_id', ensuring correct offer filtering in the Offers action.
- Introduced a One2many relationship in the ResUsers model to link properties assigned to salespersons, filtered by state (New or Offer Received). - Updated the user form view to display the associated properties, enhancing user experience and property management capabilities. - Implemented business logic in EstatePropertyOffer to ensure offers are strictly higher than existing ones, maintaining data integrity.
- Created the estate_account module to link estate properties with accounting functionalities. - Implemented the EstateProperty model to handle invoice creation upon property sale, including commission and administrative fees. - Added module manifest with dependencies on estate and account modules.
- Introduced a minimal kanban view for estate properties to enhance visual representation and user interaction. - Updated the estate property action to include kanban in the view mode, allowing users to switch between kanban, list, and form views seamlessly.
…improved layout - Updated the kanban view to group by property type and made records non-draggable for better organization. - Added fields for expected price, best offer, selling price, and tags to provide more information at a glance. - Improved the visual layout of the kanban box for better user experience.
- Rearranged import statements for consistency. - Added SQL constraints to ensure expected and selling prices are valid. - Refactored action methods for setting properties as sold or cancelled to use `ensure_one()` for better safety. - Removed redundant SQL constraints from the model definition, streamlining the code.
jnc-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.
good job !
Only some minor comments
estate/__manifest__.py
Outdated
| # "views/estate_property_type_views.xml", | ||
| # "views/estate_property_tag_views.xml", | ||
| # "views/estate_property_offer_views.xml", |
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.
Commented code should be removed
estate/models/estate_property.py
Outdated
| active = fields.Boolean(string="Active", default=True) | ||
| state = fields.Selection( | ||
| selection=[ | ||
| ('new', '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.
We tend to use either single quote or double quote everywhere to keep a consistency
estate/models/estate_property.py
Outdated
|
|
||
| @api.depends("living_area", "garden_area") | ||
| def _compute_total_area(self) -> None: | ||
| for record in self: |
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.
| for record in self: | |
| for property in self: |
Usually we use a variable that reflect the model were are in to help the code reader
| def _compute_date_deadline(self) -> None: | ||
| for offer in self: | ||
| created = (offer.create_date or fields.Datetime.now()) | ||
| base_date = created.date() if hasattr(created, "date") else date.today() |
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 I am not mistaken: date is not defined ?
| created = (offer.create_date or fields.Datetime.now()) | ||
| base_date = created.date() if hasattr(created, "date") else date.today() |
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.
| created = (offer.create_date or fields.Datetime.now()) | |
| base_date = created.date() if hasattr(created, "date") else date.today() | |
| created = (offer.create_date or fields.Datetime.now()) | |
| base_date = created.date() |
I think that with your first line you would not have an error becasue created should be a datetime in any case ?
| return True | ||
|
|
||
| def action_refuse(self): | ||
| self.write({"status": "refused"}) |
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.
| self.write({"status": "refused"}) | |
| self.status = "refused" |
It is better to let the orm decide when the write should be applied
| for prop in props: | ||
| if prop.state in ("new", "offer_received"): | ||
| prop.state = "offer_received" |
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.
| for prop in props: | |
| if prop.state in ("new", "offer_received"): | |
| prop.state = "offer_received" | |
| props.filtered(lambda p: p.state == "new").state = "offer_receive" |
- Removed commented-out view entries in the manifest for better readability. - Simplified date handling in the EstatePropertyOffer model by eliminating redundant checks. - Updated action methods to directly set status values, enhancing code efficiency. - Refactored property iteration in the EstateProperty model for consistency and clarity.
No description provided.