-
Notifications
You must be signed in to change notification settings - Fork 3.2k
19.0 tutorials makan #1353
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
Draft
Zopsss
wants to merge
10
commits into
odoo:19.0
Choose a base branch
from
odoo-dev:19.0-tutorial-makan
base: 19.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
19.0 tutorials makan #1353
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
3b577c3
[ADD] estate: create initial real-estate module
Zopsss 58a5d9e
[FIX] estate: added missing license in __manifest__.py
Zopsss a54816b
[IMP] estate: added estate_property model
Zopsss a603915
[FIX] estate: fix ['estate.property'] have no access rules warning
Zopsss 6a10e9c
[IMP] estate: add basic UI
Zopsss 4fb6fdd
[IMP] estate: add basic views like custom form, list, search filters …
Zopsss 1ee9809
[FIX] estate: fix small bug in estate_property.py and did few other c…
Zopsss 83ef6bc
[ADD] estate: add estate_property_type model
Zopsss dc08721
[ADD] estate: add estate_proerty_tag model
Zopsss 6288f82
[ADD] estate: add estate_property_offer model and split view files in…
Zopsss File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,17 @@ | ||
| { | ||
| "name": "Real Estate", | ||
| "version": "1.0", | ||
| "license": "LGPL-3", | ||
| "author": "Mauryan Kansara", | ||
| "category": "Tutorials", | ||
| "depends": ["base"], | ||
| "application": True, | ||
| "installable": True, | ||
| "data": [ | ||
| "security/ir.model.access.csv", | ||
| "views/estate_property_offer.xml", | ||
| "views/estate_property_search.xml", | ||
| "views/estate_property_views.xml", | ||
| "views/estate_menus.xml", | ||
| ] | ||
| } |
This file contains hidden or 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,4 @@ | ||
| from . import estate_property | ||
| from . import estate_property_type | ||
| from . import estate_property_tag | ||
| from . import estate_property_offer |
This file contains hidden or 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,44 @@ | ||
| from odoo import models, fields | ||
| from odoo.tools.rendering_tools import relativedelta_proxy | ||
|
|
||
|
|
||
| class EstateProperty(models.Model): | ||
| _name = "estate.property" | ||
| _description = "Real Estate properties" | ||
|
|
||
| title = fields.Char(required=True, default="Unknown") | ||
| last_seen = fields.Datetime("Last Seen", default=fields.Datetime.now) | ||
| description = fields.Text() | ||
| postcode = fields.Char("Postcode") | ||
| date_availability = fields.Date("Available From", | ||
| default=lambda self: fields.Date.today() + relativedelta_proxy(months=3) | ||
| ) | ||
| expected_price = fields.Float("Expected Price", required=True) | ||
| selling_price = fields.Float("Selling Price", readonly=True, copy=False) | ||
| bedrooms = fields.Integer("Bedrooms", default=2) | ||
| living_area = fields.Integer("Living Area (sqm)") | ||
| facades = fields.Integer() | ||
| garage = fields.Boolean() | ||
| garden = fields.Boolean() | ||
| active = fields.Boolean(default=True) | ||
| garden_area = fields.Integer("Garden Area (sqm)") | ||
| garden_orientation = fields.Selection( | ||
| selection=[('north', 'North'), ('south', 'South'), ('east', 'East')], | ||
| ) | ||
| state = fields.Selection( | ||
| [ | ||
| ("new", "New"), | ||
| ("offer_received", "Offer Received"), | ||
| ("offer_accepted", "Offer Accepted"), | ||
| ("sold", "Sold"), | ||
| ("cancelled", "Cancelled"), | ||
| ], | ||
| required=True, | ||
| copy=False, | ||
| default="new", | ||
| ) | ||
| property_type_id = fields.Many2one("estate.property.types", string="Property Type") | ||
| buyer_id = fields.Many2one("res.partner", string="Buyer", copy=False) | ||
| seller_id = fields.Many2one("res.users", string="Seller", default=lambda self: self.env.user) | ||
| tags_id = fields.Many2many("estate.property.tag", string="Tags") | ||
| offer_ids = fields.One2many("estate.property.offer", "property_id", string="Offers") |
This file contains hidden or 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,11 @@ | ||
| from odoo import models, fields | ||
|
|
||
|
|
||
| class EstatePropertyOffer(models.Model): | ||
| _name = "estate.property.offer" | ||
| _description = "Estate Property Offer" | ||
|
|
||
| price = fields.Integer() | ||
| status = fields.Selection([("accepted", "Accepted"), ("refused", "Refused")], copy=False) | ||
| partner_id = fields.Many2one("res.partner", required=True) | ||
| property_id = fields.Many2one("estate.property", required=True, readonly=True) |
This file contains hidden or 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,8 @@ | ||
| from odoo import models, fields | ||
|
|
||
|
|
||
| class EstatePropertyTag(models.Model): | ||
| _name = "estate.property.tag" | ||
| _description = "Estate Property Tags" | ||
|
|
||
| name = fields.Char("Name", required=True) |
This file contains hidden or 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,8 @@ | ||
| from odoo import models, fields | ||
|
|
||
|
|
||
| class EstatePropertyType(models.Model): | ||
| _name = "estate.property.types" | ||
| _description = "Estate Property Types" | ||
|
|
||
| name = fields.Char("Property Type", required=True) |
This file contains hidden or 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,6 @@ | ||
| id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink | ||
| access_estate_model,access_estate_property,model_estate_property,base.group_user,1,1,1,1 | ||
| estate.access_estate_property_types,access_estate_property_types,estate.model_estate_property_types,base.group_user,1,1,1,1 | ||
| estate.access_estate_property_tag, access_estate_property_tag,estate.model_estate_property_tag,base.group_user,1,1,1,1 | ||
| estate.access_estate_property_offer, access_estate_property_offer,estate.model_estate_property_offer,base.group_user,1,1,1,1 | ||
|
|
This file contains hidden or 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,11 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <odoo> | ||
| <menuitem id="estate.property_menu_root" name="Real Estate"> | ||
| <menuitem id="estate.property_first_level_menu" name="Advertisements"> | ||
| <menuitem id="estate.property_model_menu_action" action="estate.property_model_action"/> | ||
| </menuitem> | ||
| <menuitem id="estate.property_settings" name="Settings"> | ||
| <menuitem id="estate.property_settings_menu_action" action="estate.property_settings_action" /> | ||
| </menuitem> | ||
| </menuitem> | ||
| </odoo> |
This file contains hidden or 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,30 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <odoo> | ||
| <record id="estate_property_offer_view_list" model="ir.ui.view"> | ||
| <field name="name">estate.property.offer.list</field> | ||
| <field name="model">estate.property.offer</field> | ||
| <field name="arch" type="xml"> | ||
| <list> | ||
| <field name="price"/> | ||
| <field name="partner_id" /> | ||
| <field name="status" /> | ||
| </list> | ||
| </field> | ||
| </record> | ||
|
|
||
| <record id="estate_property_offer_view_form" model="ir.ui.view"> | ||
| <field name="name">estate.property.offer.form</field> | ||
| <field name="model">estate.property.offer</field> | ||
| <field name="arch" type="xml"> | ||
| <form> | ||
| <sheet> | ||
| <group> | ||
| <field name="price" /> | ||
| <field name="partner_id" /> | ||
| <field name="status" /> | ||
| </group> | ||
| </sheet> | ||
| </form> | ||
| </field> | ||
| </record> | ||
| </odoo> |
This file contains hidden or 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,32 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <odoo> | ||
| <record id="estate.property_view_search" model="ir.ui.view"> | ||
| <field name="name">estate.property.search</field> | ||
| <field name="model">estate.property</field> | ||
| <field name="arch" type="xml"> | ||
| <search string="Searchbar"> | ||
| <field name="title"/> | ||
| <field name="postcode"/> | ||
| <field name="expected_price"/> | ||
| <field name="bedrooms"/> | ||
| <field name="living_area"/> | ||
| <field name="facades"/> | ||
|
|
||
| <separator /> | ||
| <filter | ||
| string="Available" | ||
| name="available" | ||
| domain="['|', | ||
| ('state', '=', 'new'), | ||
| ('state', '=', 'offer_received') | ||
| ]"/> | ||
|
|
||
| <separator /> | ||
| <filter | ||
| string="Postcode" | ||
| name="group_by_postcode" | ||
| context="{'group_by': 'postcode'}"/> | ||
| </search> | ||
| </field> | ||
| </record> | ||
| </odoo> |
This file contains hidden or 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,81 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <odoo> | ||
| <record id="estate.property_model_action" model="ir.actions.act_window"> | ||
| <field name="name">Properties</field> | ||
| <field name="res_model">estate.property</field> | ||
| <field name="view_mode">list,form</field> | ||
| </record> | ||
|
|
||
| <record id="estate.property_settings_action" model="ir.actions.act_window"> | ||
| <field name="name">Property Types</field> | ||
| <field name="res_model">estate.property.types</field> | ||
| <field name="view_mode">list,form</field> | ||
| </record> | ||
|
|
||
| <record id="estate.property_view_tree" model="ir.ui.view"> | ||
| <field name="name">estate.property.list</field> | ||
| <field name="model">estate.property</field> | ||
| <field name="arch" type="xml"> | ||
| <list string="Tests"> | ||
| <field name="title"/> | ||
| <field name="postcode"/> | ||
| <field name="bedrooms"/> | ||
| <field name="living_area"/> | ||
| <field name="expected_price"/> | ||
| <field name="selling_price"/> | ||
| <field name="date_availability"/> | ||
| </list> | ||
| </field> | ||
| </record> | ||
|
|
||
| <record id="estate.property_view_form" model="ir.ui.view"> | ||
| <field name="name">estate.property_form</field> | ||
| <field name="model">estate.property</field> | ||
| <field name="arch" type="xml"> | ||
| <form string="Property Form"> | ||
| <sheet> | ||
| <group> | ||
| <h1><field name="title"/></h1> | ||
| </group> | ||
| <group> | ||
| <field name="tags_id" widget="many2many_tags"/> | ||
| </group> | ||
| <group> | ||
| <group> | ||
| <field name="postcode" /> | ||
| <field name="date_availability" /> | ||
| </group> | ||
| <group> | ||
| <field name="expected_price"/> | ||
| <field name="selling_price"/> | ||
| </group> | ||
| </group> | ||
| <notebook> | ||
| <page string="Description"> | ||
| <group> | ||
| <field name="description"/> | ||
| <field name="bedrooms"/> | ||
| <field name="living_area"/> | ||
| <field name="facades"/> | ||
| <field name="garage"/> | ||
| <field name="garden"/> | ||
| <field name="garden_area"/> | ||
| <field name="garden_orientation"/> | ||
| <field name="state"/> | ||
| </group> | ||
| </page> | ||
| <page string="Offers"> | ||
| <field name="offer_ids" /> | ||
| </page> | ||
| <page string="Other Info"> | ||
| <group> | ||
| <field name="seller_id"/> | ||
| <field name="buyer_id"/> | ||
| </group> | ||
| </page> | ||
| </notebook> | ||
| </sheet> | ||
| </form> | ||
| </field> | ||
| </record> | ||
| </odoo> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.