Skip to content
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

[TRAINING] Getting Started Odoo Tutorial #43

Closed
wants to merge 28 commits into from

Conversation

Clement-Cardot
Copy link

No description provided.

Playing with views and menus, adding my first views and menus to the estate module.
Use of the Active reserved field to enable archive & unarchive records.
Use of the State reserved field to enable lifecycle stages.
Copy link

@kfr-odoo kfr-odoo left a comment

Choose a reason for hiding this comment

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

Your XML files are missing an end of file character. You can setup your IDE to do it automatically

Also, you can rename the PR to something a little be closer to what you are actually doing

estate/models/estate_property.py Outdated Show resolved Hide resolved
estate/models/__init__.py Outdated Show resolved Hide resolved
VSCode now manages the end of files Lines
_compute_three_months_from_now has been rename to _get_default_date_availability
all utf8 headers have been removed
This commit adds the tree, form and search views to the estate_property model.
- The tree view is customize to add somes defined fields to the table view.
- The form view is customized to display the properties in a form structure, Using sheet, group and notebook tags
- The search view is used to customize default available filters and group-by options.
    -> Available filter : filter by state (only show New and Offer Received)
    -> By Postcode Group : Group by postcode
Types Many2One relation from Property
Tags Many2Many relation from Property
Buyer Many2One relation from Property
Salesman Many2One relation from Property

Implementation of Property offer with One2Many relation to Property
Each Offer has a Price, a Status (Accepted, Refused), and a Partner
-Implement a computed field to get the best offer of a property in its offers list
-Implement a computed/Inversed field to set the validity of an offer by Day from creation or by validity date
-Implement a Onchange method so that when Garden is set to true, the garden area is set to 10 and the orientation to 'North'
Add actions to the properties to change the state to sold or canceled,
raise an UserError if the user try to cancel a sold Property or sold a canceled Property.

Add actions to the offers to change the state to accepted or refused,
if accepted : update the property's buyer and selling price fields.
raise a UserError if the user try to accept an offer for a property that has already a accepted offer
Add sql contraints to only accept :
- positive value for the selling price
- striclty positive value for the expected price and offer price
- unique name for tags and types

Add python contraints to raise an error if the user try to accept an offer with a price lower than 90% of the expected price
estate/models/estate_property.py Outdated Show resolved Hide resolved
estate/models/estate_property.py Outdated Show resolved Hide resolved
estate/models/estate_property_offer.py Outdated Show resolved Hide resolved
estate/models/estate_property.py Outdated Show resolved Hide resolved
estate/models/estate_property_offer.py Outdated Show resolved Hide resolved
estate/models/estate_property_offer.py Outdated Show resolved Hide resolved
@Clement-Cardot Clement-Cardot changed the title [TRAINING] first commit in order to create a PR [TRAINING] Getting Started Odoo Tutorial Mar 20, 2024
Most actions and public methods now use ensure_one function and are designed for one record only
Add an inline view on the property type form view to display the list of properties related to this type.

Add a status bar widget to the property form view to show and select the state of the property.

Add some model order rules on :
- property (ID desc)
- property offer (Price desc)
- property type (Name)
- property tag (Name)
Add a Manual order rule to the Property Type tree view thanks to a handle widget and a sequence field.

Prevent creation and editing of property types from the property form view
add a property tag color

Hide Sold and Cancel button on the property form view if the property is already sold or canceled.

Hide/Show Garden settings on the property form view depending on the garden field state.

Make the property offer and property tag list views editable

Make the date_availability optional and hidden by default on the property list view

Add some decorations on property and property offer list views (green, bold, muted, red)

Add default filter on the property list view to show only available properties

Add a filter domain to the living_area to show only properties with a living area greater than the researched value.

Add a stat button to the the property type form view to show the offers count and redirect to the offers list view populated with the related offers.
Python Inheritance:
- Prevent deletion of a property if its state is not ‘New’ or ‘Canceled’ with ondelete inheritance

- At offer creation, set the property state to ‘Offer Received’.
Also raise an error if the user tries to create an offer with a lower amount than an existing offer.

Model Inheritance:
- Add a property_ids field to the res.users model with a model inheritance to store the properties that the user is responsible for and that are available.

View Inheritance:
- Add a new tab to the user form view to display the properties from the property_ids field.
Override the sold action of the estate module to create an invoice
when a property is sold.
The invoice is a 6% down payement with a 100€ admin fees.
New Kanban view of the properties grouped by property types.
showing the expected price and the property tags.
If the state is offer_received : show the best_price
If the state is offer_accepted : show the selling_price
Copy link

@kfr-odoo kfr-odoo left a comment

Choose a reason for hiding this comment

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

Well done, it is really good.

estate/models/estate_property.py Outdated Show resolved Hide resolved
estate/models/estate_property.py Outdated Show resolved Hide resolved
estate/models/estate_property_offer.py Outdated Show resolved Hide resolved
estate/models/estate_property_tag.py Show resolved Hide resolved
estate/views/estate_property_offer_views.xml Outdated Show resolved Hide resolved
estate/views/estate_property_views.xml Outdated Show resolved Hide resolved
@kfr-odoo kfr-odoo mentioned this pull request Mar 25, 2024
Play around with hooks, components, states, callbacks, props...

Create a small todo list feature with todo list and todo item components.
-> Add, remove & toogle items
Pratice with Layout, Buttons -> Actions, Dashboard & Dashboard Items, Display Statistics from back end, store data in cache with memoize
awesome_owl/static/src/utils.js Outdated Show resolved Hide resolved
awesome_owl/static/src/utils.js Outdated Show resolved Hide resolved
awesome_owl/static/src/todo/todo_list/todo_list.xml Outdated Show resolved Hide resolved
awesome_owl/static/src/todo/todo_list/todo_list.js Outdated Show resolved Hide resolved
awesome_owl/static/src/playground.xml Show resolved Hide resolved
awesome_owl/static/src/counter/counter.js Outdated Show resolved Hide resolved
@AntoineVDV AntoineVDV closed this May 6, 2024
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.

None yet

3 participants