-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
18.0 - Technical Onboarding - AHSL #364
base: 18.0
Are you sure you want to change the base?
18.0 - Technical Onboarding - AHSL #364
Conversation
apply the instructions by which I declare a new app. add the necessary configurations in manifest to let it show up in the apps list without further filtering.
…chapter-2 change the version to refer to mdoule's version instead of Odoo's version. add a license as it was missing.
added the estate.property model to manage properties in the estate module. it includes all the essential fields like name, price, bedrooms, .. etc, with some options for the user to choose the garden orientation. chapter-3
add access security access rules under the security directory to make the module accessible. add the idea config files to gitignore not to be included in the upcoming commits. chapter-4
create action to add the basic functionality of viewing and adding estate properties. implement menus to better visualize and access the properties. Add attributes to previously set fields to prevent copying, set default values, and prevent modifications. Add more predefined reserved fields to enable more functionalities (state, active). chapter-5
3f0897f
to
1545697
Compare
add file end empty line in __init__ files to align with coding style conventions. add a comma after the last record in lists for better extensibility options. remove .idea ignore from local .gitignore and move it to global ignore file. fix alignment in estate_menus.
add empty missing empty lines in xml and csv files to align with coding style conventions.
create a custom form for properties for better visuals and to suit business needs. create a notebook to be able to separate related fields together in one page. add a custom search bar to better search in relevant fields related to properties, group properties by postcode, or filter them depending on availability or active status. set a new suitable title for the action. chapter-6
add a new model enabling users to specify a tag for each property. implement menus to simplify accessing property tags represented in settings and property tags. create access rules for the new model. add a views file describing the related action, and list and form views. link the model to the __init__ file for the module. add views file to __manifest__ to be recognized and loaded. add two new fields for the estate.property model to be able to access the buyer and seller in the form, and search. chapter-7
create an estate property tag model to be added to properties specifying more context about them. create a new menu to simplify accessing tags. add a field to estate.property to show and add related tags to the property. create some views and an action to suite viewing, creating and accessing tags. add new views file to __manifest__ to be loaded when the server starts. chapter-7
create a new estate.property.offer model to manage offers for specific properties. create list, and form views for the offer to manage how it looks. add offer_ids field to estate.property model to be able to view offers from inside the property form. create a new page in the notebook form view for the estate.property for simplifying accessing the offers. link views file to manifest to be loaded when starting the server. add access rules for the new model. rename estate_property_tag file to estate_property_tag_views to meet the convention. chapter-7
create computed fields to estate.property to compute the total area automatically when the user changes one of the two summed values. add a onchange behavior for the garden toggling that changes garden_rea and garden_orientation's values either by resetting them when toggled off and putting a default value when toggled on. implement a computed field and inverse method in property offer model to be able to see the validity days when changing the deadline while updating the validity when changing the deadline as well. change the form and list views for offers to reflect the changes. chapter-8
create two buttons for selling and canceling a property and automtaing the process of changing the state. handle the logic of not selling a cancelled property and not canceling a sold property. add two buttons for offers to accept and refuse them, handle setting the buyer and selling price for the property upon acceptance. handle the logic of not accepting more than one offer at the same time for the same property. implement logic for clearing buyer and selling price data upon refusing a previously accepted offer to enable accepting another offer. chapter-9
for record in self: | ||
if record.create_date and record.date_deadline: | ||
create_date = fields.Date.from_string(record.create_date) | ||
deadline_date = fields.Date.from_string(record.date_deadline) | ||
record.validity = (deadline_date - create_date).days |
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: | |
if record.create_date and record.date_deadline: | |
create_date = fields.Date.from_string(record.create_date) | |
deadline_date = fields.Date.from_string(record.date_deadline) | |
record.validity = (deadline_date - create_date).days | |
for record in self: | |
record.validity = (record.date_deadline - fields.Date.today()).days |
This should do the same right ? They are already dates, we don't need to convert them.
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 create_date field isn't always set to today's date (fields.Date.today()), so I used it to calculate the actual difference. Additionally, on of them is a date, while the other value is a datetime, causing a type mismatch error when subtracting them.
add sql constraints to estate property to ensure expected price and selling price are positive and raise errors of that wasn't the case. add sql constrains to estate property offer to ensure the offered price is always positive. attach a sql constraint check on both type and tag to ensure they are always unique and provide an error message otherwise. implement python constrains check to estate property to check the selling price being at least 90% of the expected one. use float utils from odoo to better deal with floats. define a couple of constants describing the values of the threshold should be met for the selling price and the epsilon when rounding floats in estate properties to achieve a readable and clean code avoiding magic numbers. chapter-10
spread the imports in __init__ file into multiple lines for better extensibility. add a default value when computing the best offer instead of handling manually. ensure one record is processed in each action when accepting and refusing offers.
add colors for tags, properties, offers to make things look better depending on the preference and state of the record. implement conditional appearance for buttons and fields to suit the business needs and prevent accidental errors. add confirmation messages to cancel and sell buttons to prevent accidental errors. create a statinfo button to show the number of offers for that type of properties and view them directly. add a filter domain to find properties with living area greater than or equal to the entered number for better convenience. enable the option of editing records inline instead of openeing the form view when accessed from another list view. chapter-11
No description provided.