-
Notifications
You must be signed in to change notification settings - Fork 2.8k
19.0 tutorials mekav #1095
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: 19.0
Are you sure you want to change the base?
19.0 tutorials mekav #1095
Conversation
added fist tale in ch-3 and security (permission rule for group) in ch-4 and start ch-5 , in that add views file
complete field, attribute , view in ch-5 and list and form in ch-6
c936ac4 to
6b0b9b8
Compare
mash-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.
Hello @mekav-odoo,
Good work on the PR.
Please have a look at my comments and apply the needed changes.
mash-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.
Hello,
Good Work going..
Here are some suggestions and questions..
estate/models/estate_property.py
Outdated
| ("north", "North"), | ||
| ("south", "South"), | ||
| ("east", "East"), | ||
| ("west", "West"), |
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.
Use lower case for keys
implement statusbar widget, in List order model ordering & manual ordering and in form Attributes and options
4275261 to
9821fb8
Compare
implement statusbar widget, in List order model ordering & manual ordering and in form Attributes and options
add Attributes and options in List , default filter , filter domain in search and stat button
add Attributes and options in List , default filter , filter domain in search and stat button
done implementation of model inheritance & view inheritance to display the list of properties linked to a salesperson directly in the Settings / Users form view and implemented ondelete() and create() functions.
mash-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.
Hello!
Good going on the task..
Here are a few questions and suggestions..
| property_ids = fields.One2many('estate.property', 'property_type') | ||
| sequence = fields.Integer() | ||
| offer_ids = fields.One2many('estate.property.offer', 'property_type_id') | ||
| offer_count = fields.Integer(compute='_compute_offer') |
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.
| offer_count = fields.Integer(compute='_compute_offer') | |
| offer_count = fields.Integer(compute='_compute_offer_count') |
| <group> | ||
| <field name="tag_ids" widget="many2many_tags" options="{'color_field': 'color'}"/> | ||
| <field name="state"/> | ||
| <field name="property_type" options="{'no_create_edit': true}"/> |
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.
what will this option do?
| def action_property_sold(self): | ||
| for record in self: | ||
| if record.state == 'cancelled': | ||
| raise UserError("cancelled property cannot be sold") |
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.
Explain the events where should I use UserError and ValidationError?
| <field name="arch" type="xml"> | ||
| <list editable="bottom" decoration-success="status=='accepted'" decoration-danger="status=='refused'"> | ||
| <field name="price"/> | ||
| <field name="status" optional="hide"/> |
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.
What's the purpose of using optional hide?
| <field name="name">properties</field> | ||
| <field name="res_model">estate.property</field> | ||
| <field name="view_mode">list,form</field> | ||
| <field name="context">{'search_default_active': True}</field> |
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.
This default search is used for filter, what if I want to make a default group by?
| ) | ||
| property_type = fields.Many2one('estate.property.type', string="property type") | ||
| salesman_id = fields.Many2one( | ||
| 'res.users', string="Salesman", default=lambda self: self.env.user |
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.
What does this lambda function do?
| <button name="action_accept" type="object" title="accept" icon="fa-check" invisible='status'/> | ||
| <button name="action_refuse" type="object" title="refuse" icon="fa-times" invisible='status'/> |
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.
How can I make these buttons invisible once I have accepted an offer?
| <field name="property_ids"> | ||
| <list> | ||
| <field name="name" string="Title"/> | ||
| <field name="expected_price"/> | ||
| <field name="state"/> | ||
| </list> | ||
| </field> |
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.
What is the purpose of explicitly defining a list (tree) view here, even though the field is a One2many?
Won't it work just fine even if you write just this <field name="property_ids">?
| <page name="preferences" position="after"> | ||
| <page name="Estate Property"> | ||
| <field name="property_ids"/> | ||
| </page> | ||
| </page> | ||
| </field> |
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.
Indentation issue
| <form string="Property Types"> | ||
| <sheet> | ||
| <header> | ||
| <button class="oe_stat_button" icon="fa-money" type="action" name="%(estate_property_offer_model_action)d"> |
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.
What does type action do? And what are the other types?

Module: Estate
Initialized the estate module for Odoo Technical Training. This includes the base model definitions, security access rights, and the initial user interface as outlined in the tutorial steps.