diff --git a/estate/__init__.py b/estate/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/estate/__manifest__.py b/estate/__manifest__.py new file mode 100644 index 0000000000..0401ac624e --- /dev/null +++ b/estate/__manifest__.py @@ -0,0 +1,41 @@ +{ + 'name': 'estate', + 'depends': [ + 'website', + ], + 'data': [ + 'models/estate_models.xml', + + 'models/fields/estate_property_type.xml', + 'models/fields/estate_property_tag.xml', + 'models/fields/estate_property_offer.xml', + 'models/fields/estate_property.xml', + + 'models/estate_server_actions.xml', + + 'views/estate_property_type_views.xml', + 'views/estate_property_tag_views.xml', + 'views/estate_property_offer_views.xml', + 'views/estate_property_views.xml', + + 'views/estate_menus.xml', + 'security/ir.model.access.csv', + 'security/estate.security.xml', + + 'data/estate_tour.xml', + + ], + + 'demo': [ + 'demo/x_estate.property.type.csv', + 'demo/x_estate.property.tag.csv', + 'demo/x_estate.property.xml', + ], + + "assets": { + "web.assets_backend": [ + "estate/static/src/js/tour.js", + ], + }, + 'license': 'LGPL-3', +} diff --git a/estate/data/estate_tour.xml b/estate/data/estate_tour.xml new file mode 100644 index 0000000000..f892091d12 --- /dev/null +++ b/estate/data/estate_tour.xml @@ -0,0 +1,8 @@ + + + + estate_tour + 2 + Welcome! Happy exploring. + + \ No newline at end of file diff --git a/estate/demo/x_estate.property.tag.csv b/estate/demo/x_estate.property.tag.csv new file mode 100644 index 0000000000..aa5e85c9b9 --- /dev/null +++ b/estate/demo/x_estate.property.tag.csv @@ -0,0 +1,6 @@ +"id","x_name" +"tag_1","Luxury" +"tag_2","Modern" +"tag_3","Eco-Friendly" +"tag_4","Cozy" +"tag_5","Spacious" diff --git a/estate/demo/x_estate.property.type.csv b/estate/demo/x_estate.property.type.csv new file mode 100644 index 0000000000..7a6821f124 --- /dev/null +++ b/estate/demo/x_estate.property.type.csv @@ -0,0 +1,5 @@ +"id","x_name" +"type_1","Residential" +"type_2","Commercial" +"type_3","Industrial" +"type_4","Land" diff --git a/estate/demo/x_estate.property.xml b/estate/demo/x_estate.property.xml new file mode 100644 index 0000000000..29bcfb88d7 --- /dev/null +++ b/estate/demo/x_estate.property.xml @@ -0,0 +1,33 @@ + + + + Big Villa + A nice and big villa + 12345 + + 1600000 + 6 + 100 + 4 + True + True + 100000 + south + + True + + + + Trailer home + Home in a trailer park + 54321 + + 100000 + 1 + 10 + 4 + False + + + + diff --git a/estate/models/estate_models.xml b/estate/models/estate_models.xml new file mode 100644 index 0000000000..d7e4bc67dd --- /dev/null +++ b/estate/models/estate_models.xml @@ -0,0 +1,24 @@ + + + + Real Estate Property + x_estate.property + + + + Property Type + x_estate.property.type + + + + Property Tag + x_estate.property.tag + + + + + Property Offer + x_estate.property.offer + + + diff --git a/estate/models/estate_server_actions.xml b/estate/models/estate_server_actions.xml new file mode 100644 index 0000000000..9e85188008 --- /dev/null +++ b/estate/models/estate_server_actions.xml @@ -0,0 +1,31 @@ + + + + Accept Offer + + code + + + + + Estate List + + True + estate + code +

Properties

    ' +for property in request.env['x_estate.property'].search([]): + html += f'
  • {property.x_name}
  • ' +html += '
' +response = request.make_response(html) + ]]>
+
+
diff --git a/estate/models/fields/estate_property.xml b/estate/models/fields/estate_property.xml new file mode 100644 index 0000000000..dbf9d505f4 --- /dev/null +++ b/estate/models/fields/estate_property.xml @@ -0,0 +1,204 @@ + + + + + x_name + Name + char + True + + + + + x_selling_price + Selling Price + float + + + + + + x_description + Description + html + + + + + x_postcode + Postcode + char + + + + + + x_date_availability + Date Availability + date + + + + + x_expected_price + Expected Price + float + True + + + + + x_bedrooms + Bedrooms + integer + + + + + x_living_area + Living Area + integer + + + + + x_facades + Facades + integer + + + + + x_garage + Garage + boolean + + + + + x_garden + Garden + boolean + + + + + x_garden_area + Garden Area + integer + x_garden + + + + + + + x_total_area + Total Area + integer + x_living_area,x_garden_area + + + + False + + + + + + x_garden_orientation + Garden Orientation + selection + + + + + + north + North + 1 + + + + + south + South + 2 + + + + + east + East + 3 + + + + + west + West + 4 + + + + + + x_partner_id + Buyer + many2one + res.partner + + + + + x_property_type_id + Type + many2one + x_estate.property.type + True + restrict + + + + + x_user_id + Salesperson + many2one + res.users + + + + + x_property_tag_ids + Tags + many2many + x_estate.property.tag + + + + + x_offer_ids + Offers + one2many + x_estate.property.offer + x_property_id + + + + + + + x_api_published + API Published + boolean + + + + false + + + diff --git a/estate/models/fields/estate_property_offer.xml b/estate/models/fields/estate_property_offer.xml new file mode 100644 index 0000000000..5bfd7ccd14 --- /dev/null +++ b/estate/models/fields/estate_property_offer.xml @@ -0,0 +1,51 @@ + + + + + x_price + Price + float + True + + + + + + x_status + Status + selection + + + + accepted + Accepted + 1 + + + + refused + Refused + 2 + + + + + + x_partner_id + Buyer + many2one + res.partner + True + restrict + + + + + x_property_id + Property + many2one + x_estate.property + True + restrict + + diff --git a/estate/models/fields/estate_property_tag.xml b/estate/models/fields/estate_property_tag.xml new file mode 100644 index 0000000000..00f0923def --- /dev/null +++ b/estate/models/fields/estate_property_tag.xml @@ -0,0 +1,10 @@ + + + + + x_name + Name + char + True + + diff --git a/estate/models/fields/estate_property_type.xml b/estate/models/fields/estate_property_type.xml new file mode 100644 index 0000000000..3ac7239c11 --- /dev/null +++ b/estate/models/fields/estate_property_type.xml @@ -0,0 +1,10 @@ + + + + + x_name + Name + char + True + + diff --git a/estate/security/estate.security.xml b/estate/security/estate.security.xml new file mode 100644 index 0000000000..775be846c5 --- /dev/null +++ b/estate/security/estate.security.xml @@ -0,0 +1,19 @@ + + + + Public users cant edit a Property + + [('id', '=', False)] + + + + + + + Public users can read published estate + + [('x_api_published', '=', True)] + + + + diff --git a/estate/security/ir.model.access.csv b/estate/security/ir.model.access.csv new file mode 100644 index 0000000000..4128b78c5d --- /dev/null +++ b/estate/security/ir.model.access.csv @@ -0,0 +1,6 @@ +id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink +estate.access_x_estate_property,access_x_estate_property,estate.model_real_estate_property,base.group_user,1,1,1,1 +estate.access_x_estate_property_public,access_x_estate_property_public,estate.model_real_estate_property,base.group_public,1,1,0,0 +estate.access_x_estate_property_type,access_x_estate_property_type,estate.model_real_estate_property_type,base.group_user,1,1,1,1 +estate.access_x_estate_property_tag,access_x_estate_property_tag,estate.model_real_estate_property_tag,base.group_user,1,1,1,1 +estate.access_x_estate_property_offer,access_x_estate_property_offer,estate.model_real_estate_property_offer,base.group_user,1,1,1,1 diff --git a/estate/static/src/js/tour.js b/estate/static/src/js/tour.js new file mode 100644 index 0000000000..9d71424d49 --- /dev/null +++ b/estate/static/src/js/tour.js @@ -0,0 +1,10 @@ +import { _t } from "@web/core/l10n/translation"; +import { registry } from "@web/core/registry"; + + +registry.category("web_tour.tours").add('estate_tour', { + steps: () => [{ + trigger: '.o_app[data-menu-xmlid="estate.menu_root"]', + content: _t('Start selling your properties from this app!'), + }], +}); diff --git a/estate/views/estate_menus.xml b/estate/views/estate_menus.xml new file mode 100644 index 0000000000..afeffad910 --- /dev/null +++ b/estate/views/estate_menus.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/estate/views/estate_property_offer_views.xml b/estate/views/estate_property_offer_views.xml new file mode 100644 index 0000000000..34880a194a --- /dev/null +++ b/estate/views/estate_property_offer_views.xml @@ -0,0 +1,33 @@ + + + + x_estate.property.offer.list + x_estate.property.offer + + + + + + +