-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from nathanbangwa243/tutorial/define-module-data
[ADD] estate : Define module data
- Loading branch information
Showing
6 changed files
with
268 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<odoo> | ||
<!-- Residential, Commercial, Industrial and Land --> | ||
<data noupdate="1"> | ||
<record id="estate_property_type_id1" model="estate.property.type"> | ||
<field name="name">Residential</field> | ||
</record> | ||
<record id="estate_property_type_id2" model="estate.property.type"> | ||
<field name="name">Commercial</field> | ||
</record> | ||
<record id="estate_property_type_id3" model="estate.property.type"> | ||
<field name="name">Industrial</field> | ||
</record> | ||
<record id="estate_property_type_id4" model="estate.property.type"> | ||
<field name="name">Land</field> | ||
</record> | ||
</data> | ||
|
||
</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,64 @@ | ||
<odoo> | ||
<data noupdate="1"> | ||
<record id="estate_property_id1" model="estate.property"> | ||
<field name="name">Big Villa</field> | ||
<field name="state">new</field> | ||
<field name="description">A nice and big villa</field> | ||
<field name="postcode">12345</field> | ||
<field name="date_availability">2020-02-02</field> | ||
<field name="expected_price">1600000.0</field> | ||
<field name="bedrooms">6</field> | ||
<field name="living_area">100</field> | ||
<field name="facades">4</field> | ||
<field name="garage">True</field> | ||
<field name="garden">True</field> | ||
<field name="garden_area">100000</field> | ||
<field name="garden_orientation">South</field> | ||
<field name="property_type_id" ref="estate.estate_property_type_id1"/> | ||
</record> | ||
<record id="estate_property_id2" model="estate.property"> | ||
<field name="name">Trailer home</field> | ||
<field name="state">canceled</field> | ||
<field name="description">Home in a trailer park</field> | ||
<field name="postcode">54321</field> | ||
<field name="date_availability">1970-01-01</field> | ||
<field name="expected_price">100000.0</field> | ||
<field name="selling_price">120000.0</field> | ||
<field name="bedrooms">1</field> | ||
<field name="living_area">10</field> | ||
<field name="facades">4</field> | ||
<field name="garage">False</field> | ||
<field name="property_type_id" ref="estate.estate_property_type_id1"/> | ||
</record> | ||
<record id="estate_property_id3" model="estate.property"> | ||
<field name="name">Bangwa home</field> | ||
<field name="state">offer_received</field> | ||
<field name="description">Home in a trailer park</field> | ||
<field name="postcode">54321</field> | ||
<field name="date_availability">1970-01-01</field> | ||
<field name="expected_price">100000.0</field> | ||
<field name="selling_price">120000.0</field> | ||
<field name="bedrooms">1</field> | ||
<field name="living_area">10</field> | ||
<field name="facades">4</field> | ||
<field name="garage">False</field> | ||
<field name="property_type_id" ref="estate.estate_property_type_id2"/> | ||
<!-- base.res_partner3 is GEMINI --> | ||
<field name="offer_ids" eval="[ | ||
Command.create({ | ||
'price': 10000.0, | ||
'partner_id': ref('base.res_partner_2') | ||
}), | ||
Command.create({ | ||
'price': 15000.0, | ||
'partner_id': ref('base.res_partner_3') | ||
}), | ||
Command.create({ | ||
'price': 20000.0, | ||
'partner_id': ref('base.res_partner_4') | ||
}), | ||
]"/> | ||
</record> | ||
</data> | ||
|
||
</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,32 @@ | ||
<odoo> | ||
<data noupdate="1"> | ||
<record model="estate.property.offer" id="estate_property_offer_id1"> | ||
<field name="price">10000</field> | ||
<field name="validity">14</field> | ||
<field name="partner_id" ref="base.res_partner_12"/> | ||
<field name="property_id" ref="estate.estate_property_id1"/> | ||
<field name="date_deadline" eval="datetime.today() + timedelta(days=15)"/> | ||
|
||
</record> | ||
<record model="estate.property.offer" id="estate_property_offer_id2"> | ||
<field name="price">1500000</field> | ||
<field name="validity">14</field> | ||
<field name="partner_id" ref="base.res_partner_12"/> | ||
<field name="property_id" ref="estate.estate_property_id1"/> | ||
<field name="date_deadline" eval="datetime.today() + timedelta(days=15)"/> | ||
|
||
</record> | ||
<record model="estate.property.offer" id="estate_property_offer_id3"> | ||
<field name="price">1500001</field> | ||
<field name="validity">14</field> | ||
<field name="partner_id" ref="base.res_partner_2"/> | ||
<field name="property_id" ref="estate.estate_property_id1"/> | ||
<field name="date_deadline" eval="datetime.today() + timedelta(days=15)"/> | ||
</record> | ||
|
||
<!-- Accept and offer --> | ||
<function model="estate.property.offer" name="action_accept_offer"> | ||
<value eval="[ref('estate_property_offer_id2')]"/> | ||
</function> | ||
</data> | ||
</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,13 @@ | ||
#!/bin/bash | ||
|
||
# delete odoo docker instance | ||
echo "**********[DELETE ODOO DOCKER INSTANCES]*********" | ||
docker rm -f odoo17Learning postgres_odoo17Learning | ||
|
||
# delete all volumes | ||
echo "**********[DELETE ODOO DOCKER VOLUMES]*********" | ||
docker volume rm learning-odoo-17_odoo-db-data learning-odoo-17_odoo-web-data learning-odoo-17_odoo-db-pgdata | ||
|
||
# execute the project | ||
echo "**********[START ODOO DOCKER INSTANCES]*********" | ||
docker compose up -d --force-recreate |