-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] real_estate: added inheritance in the module
This commit extends the Real Estate module by incorporating three types of inheritance: Python inheritance: Applied Python inheritance to streamline code structure, promoting reusability and maintainability. Model inheritance: Utilized Odoo's model inheritance features to extend existing models, adding new fields and behaviors while preserving core functionalities. View inheritance: Employed view inheritance to customize and enrich user interfaces, ensuring seamless integration with existing elements.
- Loading branch information
Showing
9 changed files
with
76 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from odoo import fields, models | ||
|
||
|
||
class resuserinherit(models.Model): | ||
_inherit = "res.users" | ||
|
||
property_ids = fields.One2many("estate.property", "saler_id") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<odoo> | ||
<record id="inherited_res_users_form" model="ir.ui.view"> | ||
<field name="name">inherited.res.user</field> | ||
<field name="model">res.users</field> | ||
<field name="inherit_id" ref="base.view_users_form" /> | ||
<field name="arch" type="xml"> | ||
<!-- find field description and add the field | ||
new_field after it --> | ||
<xpath expr="//page[@name='preferences']" position="after"> | ||
<page string="Real Estate Properties"> | ||
<field name="property_ids"> | ||
<tree> | ||
<field name='name' string='Title' /> | ||
<field name='state' string='Status' /> | ||
<field name='selling_price' string='Selling Price' /> | ||
<field name='expected_price' string='Expected Price' /> | ||
</tree> | ||
</field> | ||
|
||
</page> | ||
</xpath> | ||
</field> | ||
</record> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "Estate Account", | ||
"version": "0.1", | ||
"license": "LGPL-3", | ||
"category": "Estate_props", | ||
"author": "sahilpanghal(span)", | ||
"summary": "Estate Account", | ||
"description": "Estate Account", | ||
"application": True, | ||
"installable": True, | ||
"auto_install": True, | ||
"depends": ["base","account","estate"], | ||
"data": [], | ||
} |