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..f72eb8ab3a --- /dev/null +++ b/estate/__manifest__.py @@ -0,0 +1,31 @@ +{ + 'name': 'Estate', + 'version': '1.0', + 'category': 'Estate', + 'summary': 'Tutorial module', + 'depends': [ + 'website' + ], + 'data': [ + 'data/estate_models.xml', + 'data/estate_property_type.xml', + 'data/estate_property_tag.xml', + 'data/estate_property_offer.xml', + 'data/estate_property.xml', + 'views/estate_property_views.xml', + 'views/estate_property_type_views.xml', + 'views/estate_property_tag_views.xml', + 'views/estate_property_offer_views.xml', + 'views/estate_menus.xml', + 'controllers/estate_controller.xml', + 'security/ir.model.access.csv', + 'security/estate_security.xml', + 'data/estate_tour.xml', + ], + "assets": { + "web.assets_backend": [ + "estate/static/src/js/tour.js", + ], + }, + 'license': 'OEEL-1', +} diff --git a/estate/controllers/estate_controller.xml b/estate/controllers/estate_controller.xml new file mode 100644 index 0000000000..415723ec49 --- /dev/null +++ b/estate/controllers/estate_controller.xml @@ -0,0 +1,18 @@ + + + + + Estate List Controller + + 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/data/estate_models.xml b/estate/data/estate_models.xml new file mode 100644 index 0000000000..ace84bcb3e --- /dev/null +++ b/estate/data/estate_models.xml @@ -0,0 +1,22 @@ + + + + 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/data/estate_property.xml b/estate/data/estate_property.xml new file mode 100644 index 0000000000..f493f4893e --- /dev/null +++ b/estate/data/estate_property.xml @@ -0,0 +1,191 @@ + + + + + x_name + Name + char + True + + + + + x_selling_price + Selling Price + float + True + + + + + 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_orientation + Garden Orientation + selection + + + + + North + north + + + + + South + south + + + + + East + east + + + + + West + west + + + + + x_property_type_id + Type + many2one + x_estate.property.type + True + restrict + + + + + x_partner_id + Buyer + many2one + res.partner + + + + + x_user_id + Salesperson + many2one + res.partner + + + + + x_property_tag_ids + Tags + many2many + x_estate.property.tag + + + + + x_property_offer_ids + Offers + one2many + x_estate.property.offer + x_property_id + + + + + x_total_area + Total Area + float + x_living_area,x_garden_area + + + + + + x_country_id + Buyer's Country + many2one + res.country + x_partner_id.country_id + + + + + x_api_published + Api Published + boolean + + diff --git a/estate/data/estate_property_offer.xml b/estate/data/estate_property_offer.xml new file mode 100644 index 0000000000..ce9df0a213 --- /dev/null +++ b/estate/data/estate_property_offer.xml @@ -0,0 +1,64 @@ + + + + + + x_price + Price + float + True + + + + + x_status + Status + selection + + + + + Accepted + accepted + + + + + Refused + refused + + + + + x_partner_id + Buyer + many2one + res.partner + True + cascade + + + + + x_property_id + Property + many2one + x_estate.property + True + cascade + + + + + x_action_accept_offer + code + + + diff --git a/estate/data/estate_property_tag.xml b/estate/data/estate_property_tag.xml new file mode 100644 index 0000000000..79e8dad392 --- /dev/null +++ b/estate/data/estate_property_tag.xml @@ -0,0 +1,18 @@ + + + + + + x_name + Name + char + True + + + + + x_color + Color + integer + + diff --git a/estate/data/estate_property_type.xml b/estate/data/estate_property_type.xml new file mode 100644 index 0000000000..bf28793124 --- /dev/null +++ b/estate/data/estate_property_type.xml @@ -0,0 +1,11 @@ + + + + + + x_name + Name + char + True + + diff --git a/estate/data/estate_tour.xml b/estate/data/estate_tour.xml new file mode 100644 index 0000000000..a5b76c6cd2 --- /dev/null +++ b/estate/data/estate_tour.xml @@ -0,0 +1,9 @@ + + + + + estate_tour + 2 + Welcome! Happy exploring. + + \ No newline at end of file diff --git a/estate/security/estate_security.xml b/estate/security/estate_security.xml new file mode 100644 index 0000000000..e6aedbf75c --- /dev/null +++ b/estate/security/estate_security.xml @@ -0,0 +1,20 @@ + + + + Public user write rule + + [('id','=',False)] + + + + + + + Public user read rule + + [('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..2c3922d7d1 --- /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 +access_x_estate_property,access_x_estate_property,model_estate_property,base.group_user,1,1,1,1 +access_x_estate_property_type,access_x_estate_property_type,model_estate_property_type,base.group_user,1,1,1,1 +access_x_estate_property_tag,access_x_estate_property_tag,model_estate_property_tag,base.group_user,1,1,1,1 +access_x_estate_property_offer,access_x_estate_property_offer,model_estate_property_offer,base.group_user,1,1,1,1 +access_x_estate_property_public,access_x_estate_property_public,model_estate_property,base.group_public,1,1,0,0 diff --git a/estate/static/src/js/tour.js b/estate/static/src/js/tour.js new file mode 100644 index 0000000000..9b1f6bc2e8 --- /dev/null +++ b/estate/static/src/js/tour.js @@ -0,0 +1,10 @@ +import { registry } from "@web/core/registry"; + + +registry.category("web_tour.tours").add('estate_tour', { + url: "/web", + steps: () => [{ + trigger: '.o_app[data-menu-xmlid="estate.menu_root"]', + content: 'Start selling your properties from this app!', + }], +}); \ No newline at end of file diff --git a/estate/views/estate_menus.xml b/estate/views/estate_menus.xml new file mode 100644 index 0000000000..62c5c1d5ef --- /dev/null +++ b/estate/views/estate_menus.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/estate/views/estate_property_offer_views.xml b/estate/views/estate_property_offer_views.xml new file mode 100644 index 0000000000..014317de95 --- /dev/null +++ b/estate/views/estate_property_offer_views.xml @@ -0,0 +1,41 @@ + + + + + Property Offers + x_estate.property.offer + [('x_property_type_id', '=', active_id)] + list,form + + + + x_estate.property.offer.list + x_estate.property.offer + + + + +