[ADD] estate: add base estate.property model#1152
[ADD] estate: add base estate.property model#1152hemeh-odoo wants to merge 13 commits intoodoo:19.0from
Conversation
This introduces the initial estate module to manage real estate properties.
ccf5249 to
fb49ce2
Compare
[ADD] estate: add base estate.property model This commit is to initialise real estate property model which is used to store basic property records. The model definition and module structure is according to the standard Odoo ORM module documentation. [IMP] added security folder and [CLN] estate_property.py with an extra line [CLN] Added extra space [CLN] Added End of line in estate/models/__init__.py file [ADD] Added estate_menus.xml and estate_property.xml Chapter 5 [IMP] Improved estate_menus.xml added estate_menu_advertisements_properties
…ecting state of the property
…state module was using default fallback view mechanism
…state module was using default fallback view mechanism
5722ae0 to
b381429
Compare
mash-odoo
left a comment
There was a problem hiding this comment.
Hello!
Thank you for your work!
Here are some suggestions, mostly linter as of now!
Please update description in your commits while pushing, regarding the chapters and topics covered.
| selection=[ | ||
| ("New", "New"), | ||
| ("Offer Accepted", "Offer Accepted"), | ||
| ("Offer Received", "Offer Received"), | ||
| ("Sold", "Sold"), | ||
| ("Cancelled", "Cancelled"), | ||
| ], |
There was a problem hiding this comment.
| selection=[ | |
| ("New", "New"), | |
| ("Offer Accepted", "Offer Accepted"), | |
| ("Offer Received", "Offer Received"), | |
| ("Sold", "Sold"), | |
| ("Cancelled", "Cancelled"), | |
| ], | |
| selection=[ | |
| ('new', "New"), | |
| ('offer_accepted', "Offer Accepted"), | |
| ('offer_received', "Offer Received"), | |
| ('sold', "Sold"), | |
| ('cancelled', "Cancelled"), | |
| ], |
Use underscores while defining keys for selection field.
Also the key should always come first, followed by the value.
| @@ -0,0 +1,21 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <odoo> | |||
| <data> | |||
There was a problem hiding this comment.
I noticed the <data> tag here, what was the reason for adding it?
Do you think the <data> tag changes anything functionally here, or would it behave the same without it?
There was a problem hiding this comment.
Mam generally the data tag acts as a container inside the odoo tag so that Odoo can load all records correctly. Initially, it worked when I had only one menuitem but later, after adding sub-menus and an action menu it started throwing an exception error . That’s why I included the data tag to ensure everything loads properly
| <odoo> | ||
| <data> | ||
|
|
||
| <record id="estate_property_tree" model="ir.ui.view"> |
There was a problem hiding this comment.
| <record id="estate_property_tree" model="ir.ui.view"> | |
| <record id="estate_property_view_list" model="ir.ui.view"> |
For naming a view: <model_name>_view_<view_type>, where view_type is kanban, form, list, search, …
You can refer this guideline: https://www.odoo.com/documentation/19.0/contributing/development/coding_guidelines.html#xml-ids-and-naming
| <data> | ||
|
|
||
| <record id="estate_property_tree" model="ir.ui.view"> | ||
| <field name="name">estate.property.tree</field> |
There was a problem hiding this comment.
| <field name="name">estate.property.tree</field> | |
| <field name="name">estate.property.view.list</field> |
| <field name="model">estate.property</field> | ||
| <field name="arch" type="xml"> | ||
| <list> | ||
| <field name="name" string="Title" /> |
There was a problem hiding this comment.
| <field name="name" string="Title" /> | |
| <field name="name" string="Title"/> |
Do not leave space at the end
| </search> | ||
|
|
||
|
|
||
| </field> |
There was a problem hiding this comment.
| </search> | |
| </field> | |
| </search> | |
| </field> |
Do not leave unnecessary lines
| </record> | ||
|
|
||
| </data> | ||
| </odoo> No newline at end of file |
There was a problem hiding this comment.
Always add an extra line at the end of the file.
Removed unnecessary blank lines between fields in estate_property.py Co-authored-by: mash-odoo <124269532+mash-odoo@users.noreply.github.com>
…or selection field in estate_property.py file and in estate_property_views.xml file renamed id from estate.property.tree to estate.property.view.list and removed unecessary whitespaces.
Added relational fields on estate.property Many2one and Many2many relationships. Many2one: Adds a foreign key to link many records to one. Many2many: Uses a junction table with foreign keys to allow flexible multi-record associations.
The estate.property model lacked a direct way to access and manage related offers from the property form view. This change introduces a one2many field linking estate.property to estate.property.offer, allowing users to easily view and manage all offers associated with a property in a single place.
6520807 to
a206764
Compare

This PR contains: