diff --git a/advanced_property_management/README.rst b/advanced_property_management/README.rst new file mode 100755 index 000000000..6aad2601b --- /dev/null +++ b/advanced_property_management/README.rst @@ -0,0 +1,46 @@ +.. image:: https://img.shields.io/badge/licence-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +Advanced Property Management +============================ +* Manage your properties by selling, renting and bidding + +Configuration +============= + - www.odoo.com/documentation/16.0/setup/install.html + - Install our custom addon + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Credits +------- +* Developer: (V16) Mohamed Savad, Harshad P, Javid A, Sumith S, Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. +For support and more information, please visit https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ diff --git a/advanced_property_management/__init__.py b/advanced_property_management/__init__.py new file mode 100755 index 000000000..ec159a351 --- /dev/null +++ b/advanced_property_management/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import controllers +from . import models +from . import wizards diff --git a/advanced_property_management/__manifest__.py b/advanced_property_management/__manifest__.py new file mode 100755 index 000000000..9cc2884f0 --- /dev/null +++ b/advanced_property_management/__manifest__.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': "Advanced Property Management", + 'version': '16.0.1.0.0', + 'category': 'Industries', + 'summary': """Manage your properties by selling, renting and bidding""", + 'description': """The module makes it simple for you to manage + your properties""", + 'author': "Cybrosys Techno Solutions", + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://cybrosys.com', + 'depends': ['base', 'mail', 'sale_management', 'website', + 'base_geolocalize'], + 'data': [ + 'security/user_groups.xml', + 'security/property_security.xml', + 'security/ir.model.access.csv', + 'data/ir_sequence_data.xml', + 'data/advanced_property_management_data.xml', + 'data/ir_cron_data.xml', + 'views/property_property_views.xml', + 'views/property_facility_views.xml', + 'views/property_tag_views.xml', + 'views/property_search_pannel_views.xml', + 'views/property_templates.xml', + 'views/property_commision_views.xml', + 'views/property_sale_views.xml', + 'views/property_rental_views.xml', + 'views/res_partner_views.xml', + 'views/rental_bill_views.xml', + 'views/property_auction_views.xml', + 'reports/property_sale_report.xml', + 'reports/property_report.xml', + 'wizards/property_sale_report_views.xml', + ], + 'assets': { + 'web.assets_frontend': [ + 'advanced_property_management/static/src/js/property_website.js', + 'advanced_property_management/static/src/js/property_item.js', + ], + }, + 'images': ['/static/description/banner.png'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': True, +} diff --git a/advanced_property_management/controllers/__init__.py b/advanced_property_management/controllers/__init__.py new file mode 100755 index 000000000..6f231948f --- /dev/null +++ b/advanced_property_management/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import advanced_property_management diff --git a/advanced_property_management/controllers/advanced_property_management.py b/advanced_property_management/controllers/advanced_property_management.py new file mode 100755 index 000000000..bdec0f780 --- /dev/null +++ b/advanced_property_management/controllers/advanced_property_management.py @@ -0,0 +1,107 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +import werkzeug.utils +from odoo import fields, http +from odoo.http import request + + +class PropertyController(http.Controller): + """A controller class that shows the related functions to the property""" + + @http.route('/property', auth='user', website=True) + def property(self): + """ Returns the property_view for the route """ + return request.render('advanced_property_management.property_view', { + 'property_ids': request.env['property.property'].sudo().search([]) + }) + + @http.route('/property/', auth='user', website=True) + def property_item(self, property_id): + """ Shows each corresponding properties view in property_view_item """ + return request.render('advanced_property_management.property_view_item', + { + 'property_id': request.env[ + 'property.property'].sudo().browse( + property_id), + }) + + @http.route('/map//', type='http', auth='user') + def redirect_map(self, latitude, longitude): + """ Returns the Google map location for the corresponding latitude + and longitude """ + return werkzeug.utils.redirect( + "https://www.google.com/maps/@%s,%s,115m/data=!3m1!1e3" % ( + latitude, longitude)) + + @http.route('/property/auction/', type='json', auth='user') + def auction(self): + """Returns properties in three different states""" + auction_ids = request.env['property.auction'].sudo().search([ + ('state', '!=', 'draft') + ]) + context = { + 'confirmed': [], + 'started': [], + 'ended': [], + } + for auction_id in auction_ids: + participants = sorted(auction_id.participant_ids, + key=lambda x: x.bid_amount, reverse=True) + data = { + 'id': auction_id.id, + 'name': auction_id.property_id.name, + 'code': auction_id.auction_seq, + 'image': auction_id.property_id.image, + 'start': auction_id.start_time, + 'start_price': auction_id.bid_start_price, + 'last': participants[0].bid_amount if participants else 0, + 'end': auction_id.end_time, + 'winner': auction_id.auction_winner_id.name, + 'final_rate': auction_id.final_price, + 'total_participant': len(auction_id.participant_ids.ids) + } + if auction_id.state == 'confirmed': + context['confirmed'].append(data) + elif auction_id.state == 'started': + context['started'].append(data) + elif auction_id.state == 'ended': + context['ended'].append(data) + response = http.Response( + template='advanced_property_management.auction_view', + qcontext=context) + return response.render() + + @http.route('/property/auction//bid', type='json', + auth='user') + def auction_bid_submit(self, prop_id, **kw): + """Return success when auction is submitted""" + auction_id = request.env['property.auction'].sudo().browse(int(prop_id)) + auction_id.write({ + 'participant_ids': [ + fields.Command.create({ + 'partner_id': request.env.user.partner_id.id, + 'bid_time': fields.Datetime.now(), + 'bid_amount': float(kw.get('bid_amount')) + }) + ] + }) + return {'message': 'success'} diff --git a/advanced_property_management/data/advanced_property_management_data.xml b/advanced_property_management/data/advanced_property_management_data.xml new file mode 100755 index 000000000..2437b9b03 --- /dev/null +++ b/advanced_property_management/data/advanced_property_management_data.xml @@ -0,0 +1,12 @@ + + + + + + Property + /property + + 22 + + + diff --git a/advanced_property_management/data/ir_cron_data.xml b/advanced_property_management/data/ir_cron_data.xml new file mode 100755 index 000000000..2d8e12b49 --- /dev/null +++ b/advanced_property_management/data/ir_cron_data.xml @@ -0,0 +1,16 @@ + + + + + + Property Rental + + code + model.action_check_rental() + + 1 + days + -1 + + + diff --git a/advanced_property_management/data/ir_sequence_data.xml b/advanced_property_management/data/ir_sequence_data.xml new file mode 100755 index 000000000..07f828906 --- /dev/null +++ b/advanced_property_management/data/ir_sequence_data.xml @@ -0,0 +1,45 @@ + + + + + + Property sequence + property.property + TRUE + PI/ + 1 + 1 + 4 + + + + Property Sale Sequence + property.sale + TRUE + PS/ + 1 + 1 + 4 + + + + Property Rent sequence + property.rent + TRUE + RNT/ + 1 + 1 + 4 + + + + Property Auction sequence + property.auction + TRUE + AUC + 1 + 1 + 4 + + + diff --git a/advanced_property_management/doc/RELEASE_NOTES.md b/advanced_property_management/doc/RELEASE_NOTES.md new file mode 100755 index 000000000..9172a8ff3 --- /dev/null +++ b/advanced_property_management/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 12.1.2024 +#### Version 16.0.1.0.0 +#### ADD +- Initial commit for Advanced Property Management diff --git a/advanced_property_management/models/__init__.py b/advanced_property_management/models/__init__.py new file mode 100755 index 000000000..63116b6c3 --- /dev/null +++ b/advanced_property_management/models/__init__.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import account_move +from . import property_area_measure +from . import property_auction +from . import property_auction_line +from . import property_commission +from . import property_facility +from . import property_image +from . import property_nearby_connectivity +from . import property_property +from . import property_rental +from . import property_sale +from . import property_tag +from . import rental_bill +from . import res_partner diff --git a/advanced_property_management/models/account_move.py b/advanced_property_management/models/account_move.py new file mode 100755 index 000000000..be4d737c5 --- /dev/null +++ b/advanced_property_management/models/account_move.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class AccountMove(models.Model): + """A class that inherits the already existing model account move to add + the related property sale and rental records""" + _inherit = 'account.move' + + property_order_id = fields.Many2one('property.sale', + string="Property Order ID", + help='The corresponding property ' + 'sale order') + property_rental_id = fields.Many2one('property.rental', + string='Property Rental ID', + help='The corresponding property ' + 'rental order') diff --git a/advanced_property_management/models/property_area_measure.py b/advanced_property_management/models/property_area_measure.py new file mode 100755 index 000000000..59d1aa3b2 --- /dev/null +++ b/advanced_property_management/models/property_area_measure.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import api, fields, models + + +class PropertyAreaMeasure(models.Model): + """A class for the model property.area.measure to represent + the area of each sections""" + _name = 'property.area.measure' + _description = 'Property Area Measurement' + + name = fields.Char(string='Section', required=True, + help='Name of the room or section') + length = fields.Float(string='Length(ft)', help='The length of the room') + width = fields.Float(string='Width(ft)', help='The width of the room') + height = fields.Float(string='Height(ft)', help='The height of the room') + area = fields.Float(string='Area(ft²)', compute='_compute_area', + help='The total area of the room') + property_id = fields.Many2one('property.property', string='Property', + help='The corresponding property') + + @api.depends('length', 'width', 'height') + def _compute_area(self): + """ The total area of the room for each record is calculated """ + for rec in self: + rec.area = rec.length * rec.width diff --git a/advanced_property_management/models/property_auction.py b/advanced_property_management/models/property_auction.py new file mode 100755 index 000000000..61bac0cf5 --- /dev/null +++ b/advanced_property_management/models/property_auction.py @@ -0,0 +1,143 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from datetime import datetime + +from odoo import api, fields, models, _ +from odoo.exceptions import ValidationError + + +class PropertyAuction(models.Model): + """A class to represent the model property auction""" + _name = 'property.auction' + _description = 'Property Auction' + _rec_name = 'auction_seq' + + auction_seq = fields.Char(string='Reference', readonly=True, + required=True, copy=False, default='New') + property_id = fields.Many2one( + 'property.property', required=True, + string='Property', + domain="[('state','=','available'), ('sale_rent','=','for_auction')]", + help='Related property for auction') + responsible_id = fields.Many2one('res.users', required=True, + string='Responsible User', + help='The responsible person for ' + 'managing the auction') + bid_start_price = fields.Monetary(string='Bid Start Price', + help='The starting bid price for ' + 'the property') + final_price = fields.Monetary(string='Final Price', readonly=True, + help='The final price of the property') + state = fields.Selection(selection=[ + ('draft', 'Draft'), + ('confirmed', 'Confirmed'), + ('started', 'Started'), + ('ended', 'Ended'), + ('canceled', 'Canceled') + ], default='draft', string='State', + help="* The \'Draft\' status is used when the auction is at draft.\n" + "* The \'Confirmed\'status is used when the auction is confirmed\n" + "* The \'Started\' status is used when the auction is started.\n" + "* The \'Ended\' status is used when the auction is ended.\n" + "* The \'Cancelled\' status is used when user cancel the auction.") + participant_ids = fields.One2many('property.auction.line', + 'auction_id', + string='Participants') + start_time = fields.Datetime(string='Start Time', + help='The starting time of the auction', + required=True) + end_time = fields.Datetime(string='End time', + help='The ending time of the auction', + required=True) + auction_winner_id = fields.Many2one('res.partner', + readonly=True, + string='Auction Winner', + help='The winner of the auction is ' + 'selected according to the bids') + sold = fields.Boolean(string='Sold', default=False, + help='Whether the property is sold or not') + company_id = fields.Many2one('res.company', string='Company', + default=lambda self: self.env.company) + currency_id = fields.Many2one('res.currency', 'Currency', + related='company_id.currency_id', + required=True) + + @api.model + def create(self, vals): + """Supering the create function inorder to set the auction_seq number + """ + if vals.get('auction_seq', 'New') == 'New': + vals['auction_seq'] = self.env['ir.sequence'].next_by_code( + 'property.auction') or 'New' + res = super(PropertyAuction, self).create(vals) + return res + + @api.constrains('start_time','end_time') + def check_start_time_end_time(self): + current_date_time = datetime.now() + if (not self.start_time > current_date_time < self.end_time or + not self.start_time < self.end_time): + raise ValidationError(_('Please provide a valid date and time')) + + def action_confirm(self): + """Changes state to confirmed""" + self.state = 'confirmed' + + def action_start(self): + """Changes state to started""" + self.state = 'started' + + def action_end(self): + """Set state to ended and set values to fields auction_winner_id, + final_price, end_time""" + selected_line = \ + sorted(self.participant_ids, key=lambda x: x.bid_amount, + reverse=True)[ + 0] + self.auction_winner_id = selected_line.partner_id.id + self.final_price = selected_line.bid_amount + self.end_time = fields.Datetime.now() + self.state = 'ended' + + def action_cancel(self): + """Changes state to canceled""" + self.state = 'canceled' + + def action_create_sale_order(self): + """Creates a property sale record""" + self.env['property.sale'].create({ + 'property_id': self.property_id.id, + 'partner_id': self.auction_winner_id.id, + 'order_date': fields.Date.today(), + 'sale_price': self.final_price, + }) + self.sold = True + + def action_view_sale_order(self): + """View all the property sale from the auction""" + return { + 'name': 'Property Sale: ' + self.auction_seq, + 'view_mode': 'tree,form', + 'res_model': 'property.sale', + 'type': 'ir.actions.act_window', + 'domain': [('property_id', '=', self.property_id.id)] + } diff --git a/advanced_property_management/models/property_auction_line.py b/advanced_property_management/models/property_auction_line.py new file mode 100755 index 000000000..fd352132a --- /dev/null +++ b/advanced_property_management/models/property_auction_line.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class PropertyAuctionLine(models.Model): + """A class for the model property.auction.line to represent + the participants of the auction""" + _name = 'property.auction.line' + _description = 'Auction Line' + + partner_id = fields.Many2one('res.partner', string='Bidder', + help='The person who is bidding for the ' + 'property') + bid_time = fields.Datetime(string='Bid Time', + help='The date and time when the bid was placed') + currency_id = fields.Many2one('res.currency', 'Currency', + default=lambda self: self.env.user.company_id + .currency_id, + required=True) + bid_amount = fields.Monetary(string='bid amount', + help='The amount which is bid') + auction_id = fields.Many2one('property.auction', + string='Property Auction', + help='The corresponding property auction') diff --git a/advanced_property_management/models/property_commission.py b/advanced_property_management/models/property_commission.py new file mode 100755 index 000000000..293fd556a --- /dev/null +++ b/advanced_property_management/models/property_commission.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class PropertyCommission(models.Model): + """A class for the model property commission to represent + the commission type for property""" + _name = 'property.commission' + _description = 'Property Commission' + + name = fields.Char(string='Commission Name', + help="Name of commission plan", required=True) + commission_type = fields.Selection([('fixed', 'Fixed'), + ('percentage', 'Percentage')], + string='Commission Type', required=True, + help='The type of the commission either ' + 'fixed or a percentage') + commission = fields.Float(string='Commission Rate', + help="Commission calculating value.") + company_id = fields.Many2one('res.company', string='Company', + default=lambda self: self.env.company) diff --git a/advanced_property_management/models/property_facility.py b/advanced_property_management/models/property_facility.py new file mode 100755 index 000000000..830aefa50 --- /dev/null +++ b/advanced_property_management/models/property_facility.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class PropertyFacility(models.Model): + """A class for the model property facilities to represent + the related facilities for a property""" + _name = 'property.facility' + _description = 'Property Facility' + _rec_name = 'facility' + + facility = fields.Text(string='Facility', required=True, + help='Facilities of the property') diff --git a/advanced_property_management/models/property_image.py b/advanced_property_management/models/property_image.py new file mode 100755 index 000000000..f39315a8c --- /dev/null +++ b/advanced_property_management/models/property_image.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class PropertyImages(models.Model): + """A class for the model property image to represent + the related images for a property""" + _name = 'property.image' + _description = 'Property Images' + + name = fields.Char(string='Name', required=True, + help='Name for the given image') + description = fields.Text(string='Description', + help='A brief description of the image given') + image = fields.Binary(string='Image', required=True, + help='The properties image') + property_id = fields.Many2one('property.property', + string='Property', + help='Related property') diff --git a/advanced_property_management/models/property_nearby_connectivity.py b/advanced_property_management/models/property_nearby_connectivity.py new file mode 100755 index 000000000..3c9f9d64e --- /dev/null +++ b/advanced_property_management/models/property_nearby_connectivity.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class PropertyNearbyConnectivity(models.Model): + """A class for the model property.nearby.connectivity to represent + the nearby connectives for a property""" + _name = 'property.nearby.connectivity' + _description = 'Property Nearby Connectivity' + + name = fields.Char(string="Name", required=True, + help='Name of the nearby connectivity for the property') + direction = fields.Selection([('north', 'North'), ('south', 'South'), + ('east', 'East'), ('west', 'West')], + string='Direction', + help='To which direction is the nearby ' + 'connectivity') + kilometer = fields.Float(string="Kilometer", required=True, + help='The distance between the property and ' + 'nearby connectivity in kilometers') + property_id = fields.Many2one('property.property', + string="Property Name", + help='The related property') diff --git a/advanced_property_management/models/property_property.py b/advanced_property_management/models/property_property.py new file mode 100755 index 000000000..62245eaf8 --- /dev/null +++ b/advanced_property_management/models/property_property.py @@ -0,0 +1,281 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import api, fields, models, _ + + +class Property(models.Model): + """A class for the model property to represent the property""" + + _name = "property.property" + _description = "Property" + _inherit = ["mail.thread", "mail.activity.mixin"] + + name = fields.Char( + string="Name", required=True, copy=False, help="Name of the Property" + ) + code = fields.Char( + string="Reference", + readonly=True, + copy=False, + default=lambda self: _("New"), + help="Sequence/code for the property", + ) + property_type = fields.Selection( + [ + ("land", "Land"), + ("residential", "Residential"), + ("commercial", "Commercial"), + ("industry", "Industry"), + ], + string="Type", + required=True, + help="The type of the property", + ) + state = fields.Selection( + [ + ("draft", "Draft"), + ("available", "Available"), + ("rented", "Rented"), + ("sold", "Sold"), + ], + required=True, + string="Status", + default="draft", + help="* The 'Draft' status is used when the property is in draft.\n" + "* The 'Available' status is used when the property is " + "available or confirmed\n" + "* The 'Rented' status is used when the property is rented.\n" + "* The 'sold' status is used when the property is sold.\n", + ) + street = fields.Char(string="Street", required=True, help="The street name") + street2 = fields.Char(string="Street2", help="The street2 name") + zip = fields.Char(string="Zip", change_default=True, help="Zip code for the place") + city = fields.Char(string="City", help="The name of the city") + country_id = fields.Many2one( + "res.country", + string="Country", + ondelete="restrict", + required=True, + help="The name of the country", + ) + state_id = fields.Many2one( + "res.country.state", + string="State", + ondelete="restrict", + tracking=True, + domain="[('country_id', '=?', country_id)]", + help="The name of the state", + ) + latitude = fields.Float( + string="Latitude", + digits=(16, 5), + help="The latitude of where the property is " "situated", + ) + longitude = fields.Float( + string="Longitude", + digits=(16, 5), + help="The longitude of where the property is " "situated", + ) + company_id = fields.Many2one( + "res.company", + string="Property Management Company", + default=lambda self: self.env.company, + ) + currency_id = fields.Many2one( + "res.currency", string="Currency", related="company_id.currency_id" + ) + image = fields.Binary(string="Image", help="Image of the property") + construct_year = fields.Char( + string="Construct Year", size=4, help="Year of construction of the property" + ) + license_no = fields.Char( + string="License No.", help="License number of the property" + ) + landlord_id = fields.Many2one( + "res.partner", string="LandLord", help="The owner of the property" + ) + description = fields.Text( + string="Description", help="A brief description about the property" + ) + responsible_id = fields.Many2one( + "res.users", + string="Responsible Person", + help="The responsible person for " "this property", + default=lambda self: self.env.user, + ) + type_residence = fields.Char( + string="Type of Residence", help="The type of the residence" + ) + total_floor = fields.Integer( + string="Total Floor", + default=1, + help="The total number of floor in " "the property", + ) + bedroom = fields.Integer( + string="Bedrooms", help="Number of bedrooms in the property" + ) + bathroom = fields.Integer( + string="Bathrooms", help="Number of bathrooms in the property" + ) + parking = fields.Integer( + string="Parking", + help="Number of cars or bikes that can be parked " "in the property", + ) + furnishing = fields.Selection( + [ + ("no_furnished", "Not Furnished"), + ("half_furnished", "Partially Furnished"), + ("furnished", "Fully Furnished"), + ], + string="Furnishing", + help="Whether the residence is fully furnished or partially/half " + "furnished or not at all furnished", + ) + land_name = fields.Char(string="Land Name", help="The name of the land") + land_area = fields.Char( + string="Area In Hector", help="The area of the land in hector" + ) + shop_name = fields.Char(string="Shop Name", help="The name of the shop") + industry_name = fields.Char(string="Industry Name", help="The name of the industry") + usage = fields.Char( + string="Used For", help="For what purpose is this property used for" + ) + location = fields.Char(string="Location", help="The location of the property") + property_image_ids = fields.One2many( + "property.image", "property_id", string="Property Images" + ) + area_measurement_ids = fields.One2many( + "property.area.measure", "property_id", string="Area Measurement" + ) + total_sq_feet = fields.Float( + string="Total Square Feet", + compute="_compute_total_sq_feet", + help="The total area square feet of the " "property", + ) + facility_ids = fields.Many2many( + "property.facility", string="Facilities", help="Facilities of the property" + ) + nearby_connectivity_ids = fields.One2many( + "property.nearby.connectivity", "property_id", string="Nearby Connectives" + ) + property_tags = fields.Many2many( + "property.tag", string="Property Tags", help="Tags for the property" + ) + attachment_id = fields.Many2one("ir.attachment", string="Attachment") + sale_rent = fields.Selection( + [ + ("for_sale", "For Sale"), + ("for_tenancy", "For Tenancy"), + ("for_auction", "For Auction"), + ], + string="Sale | Rent", + required=True, + ) + unit_price = fields.Monetary( + string="Sales Price", help="Selling price of the Property." + ) + sale_id = fields.Many2one( + "property.sale", + string="Sale Order", + help="The corresponding property sale", + tracking=True, + ) + rent_month = fields.Monetary( + string="Rent/Month", help="Rent price per month", tracking=True + ) + + @api.model + def create(self, vals): + """Generating sequence number at the time of creation of record""" + if vals.get("code", "New") == "New": + vals["code"] = ( + self.env["ir.sequence"].next_by_code("property.property") or "New" + ) + res = super(Property, self).create(vals) + return res + + def _compute_total_sq_feet(self): + """Calculates the total square feet of the property""" + for rec in self: + rec.total_sq_feet = sum(rec.mapped("area_measurement_ids").mapped("area")) + + @api.model + def _geo_localize(self, street="", zip="", city="", state="", country=""): + """Generate Latitude and Longitude based on address""" + geo_obj = self.env["base.geocoder"] + search = geo_obj.geo_query_address( + street=street, zip=zip, city=city, state=state, country=country + ) + result = geo_obj.geo_find(search, force_country=country) + if result is None: + search = geo_obj.geo_query_address(city=city, state=state, country=country) + result = geo_obj.geo_find(search, force_country=country) + return result + + @api.onchange("street", "zip", "city", "state_id", "country_id") + def _onchange_address(self): + """Writing Latitude and Longitude to the record""" + for rec in self.with_context(lang="en_US"): + result = rec._geo_localize( + rec.street, rec.zip, rec.city, rec.state_id.name, rec.country_id.name + ) + if result: + rec.write( + { + "latitude": result[0], + "longitude": result[1], + } + ) + + def action_get_map(self): + """Redirects to google map to show location based on latitude + and longitude""" + return { + "type": "ir.actions.act_url", + "name": "View Map", + "target": "self", + "url": "/map/%s/%s" % (self.latitude, self.longitude), + } + + def action_available(self): + """Set the state to available""" + self.state = "available" + + def action_property_sale_view(self): + """View Sale order Of the Property""" + return { + "name": "Property Sale: " + self.code, + "view_mode": "tree,form", + "res_model": "property.sale", + "type": "ir.actions.act_window", + "res_id": self.sale_id.id, + } + + def action_property_rental_view(self): + """View rental order Of the Property""" + return { + "name": "Property Rental: " + self.code, + "view_mode": "tree,form", + "res_model": "property.rental", + "type": "ir.actions.act_window", + "domain": [("property_id", "=", self.id)], + } diff --git a/advanced_property_management/models/property_rental.py b/advanced_property_management/models/property_rental.py new file mode 100755 index 000000000..6134d42d7 --- /dev/null +++ b/advanced_property_management/models/property_rental.py @@ -0,0 +1,157 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import api, fields, models, _ +from odoo.exceptions import ValidationError + + +class PropertyRental(models.Model): + """A class for the model property rental to represent + the rental order of a property""" + _name = 'property.rental' + _description = 'Property Rent' + _inherit = ['mail.thread', 'mail.activity.mixin'] + + name = fields.Char(string='Reference', readonly=True, + required=True, copy=False, default='New', + help='The reference code/sequence of the property ' + 'rental') + property_id = fields.Many2one( + 'property.property', string='Property', + required=True, + help='The property to be rented', + domain="[('state','=','available'),('sale_rent','=','for_tenancy')]") + owner_id = fields.Many2one('res.partner', string='Land Lord', + related='property_id.landlord_id', store=True, + help='The owner / land lord of the property') + rent_price = fields.Monetary(string='Rent Price', + related='property_id.rent_month', + help='The Rental price per month of the ' + 'property') + renter_id = fields.Many2one('res.partner', string='Renter', required=True, + help='The customer who is renting the property') + state = fields.Selection( + [('draft', 'Draft'), ('in_contract', 'In Contract'), + ('expired', 'Expired'), ('cancel', 'Cancelled')], + required=True, default='draft', string='Status', tracking=True, + help="* The \'Draft\' status is used when the rental is in draft.\n" + "* The \'In Contract\' status is used when the property is rented " + "and is in contract\n" + "* The \'Expired\' status is used when the property rented " + "contract has expired.\n" + "* The \'Cancelled\' status is used when the property rental " + "is cancelled.\n") + start_date = fields.Date(string='Start Date', required=True, + help='The starting date of the rent') + end_date = fields.Date(string='End Date', required=True, + help='The Ending date of the rent') + invoice_count = fields.Integer(strinf='Invoice Count', + compute='_compute_invoice_count', + help='The Invoices related to this rental') + rental_bills_ids = fields.One2many('rental.bill', 'rental_id') + invoice_date = fields.Date(string='Invoice Date', + help='The latest Invoiced Date') + next_invoice = fields.Date(string='Next Invoice', + compute='_compute_next_invoice', + help='The next invoicing date') + company_id = fields.Many2one('res.company', + string="Property Management Company", + default=lambda self: self.env.company) + currency_id = fields.Many2one('res.currency', string='Currency', + related='company_id.currency_id') + + @api.model + def create(self, vals): + """Setting the sequence when record is created""" + if vals.get('name', 'New') == 'New': + vals['name'] = self.env['ir.sequence'].next_by_code( + 'property.rent') or 'New' + res = super(PropertyRental, self).create(vals) + return res + + def _compute_invoice_count(self): + """Calculates the Invoice count for the property""" + self.invoice_count = self.env['account.move'].search_count( + [('property_rental_id', '=', self.id)]) + + def _compute_next_invoice(self): + """Computes the next_invoice date""" + if self.invoice_date and fields.Date.today() < self.end_date: + self.next_invoice = fields.Date.add(self.invoice_date, months=1) + else: + self.next_invoice = False + + def action_cancel(self): + """ Changes the record stage to cancel """ + self.property_id.state = 'available' + self.state = 'cancel' + + def action_create_contract(self): + """Creates an invoice for contract. Checks if the customer + is blacklisted.""" + if self.renter_id.blacklisted: + raise ValidationError( + _('The Customer %r is Blacklisted.', self.renter_id.name)) + self.env['account.move'].create({ + 'move_type': 'out_invoice', + 'property_rental_id': self.id, + 'invoice_line_ids': [fields.Command.create({ + 'name': self.property_id.name, + 'price_unit': self.rent_price, + 'currency_id': self.env.user.company_id.currency_id.id, + })] + }) + self.invoice_date = fields.Date.today() + self.property_id.state = 'rented' + self.state = 'in_contract' + + def action_view_invoice(self): + """Views all the related invoice in tree view related to the records""" + return { + 'name': _('Invoices'), + 'view_mode': 'tree,form', + 'res_model': 'account.move', + 'target': 'current', + 'type': 'ir.actions.act_window', + 'domain': [('property_rental_id', '=', self.id), + ('move_type', '=', 'out_invoice')] + } + + @api.model + def action_check_rental(self): + """Scheduled action to create the next invoice for rent + else set it as expired.""" + records = self.env['property.rental'].search( + [('state', '=', 'in_contract')]) + for rec in records: + if not rec.next_invoice: + rec.state = 'expired' + if fields.Date.today() == rec.next_invoice: + self.env['account.move'].create({ + 'move_type': 'out_invoice', + 'property_rental_id': rec.id, + 'invoice_line_ids': [fields.Command.create({ + 'name': rec.property_id.name, + 'price_unit': rec.rent_price, + 'currency_id': rec.env.user.company_id.currency_id.id, + })] + }) + rec.invoice_date = fields.Date.today() diff --git a/advanced_property_management/models/property_sale.py b/advanced_property_management/models/property_sale.py new file mode 100755 index 000000000..88985e1e0 --- /dev/null +++ b/advanced_property_management/models/property_sale.py @@ -0,0 +1,179 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import api, fields, models, _ +from odoo.exceptions import ValidationError + + +class PropertySale(models.Model): + """A class for the model property sale to represent + the sale order of a property""" + _name = 'property.sale' + _description = 'Sale of the Property' + _inherit = ['mail.thread', 'mail.activity.mixin'] + _order = 'name desc' + + name = fields.Char(string='Reference', readonly=True, + copy=False, default='New', + help='The reference code/sequence of the property sale') + property_id = fields.Many2one( + 'property.property', required=True, + domain="[('state', '=', 'available'), ('sale_rent', '=', 'for_sale')]", + string="Property Name", + help='The property to be sold') + partner_id = fields.Many2one('res.partner', string="Customer", + required=True, + help='The customer who is buying the property') + order_date = fields.Date(string="Order Date", + help='The order date of property') + state = fields.Selection([('draft', 'Draft'), ('confirm', 'Confirm')], + default='draft', string="State", tracking=True) + invoice_id = fields.Many2one('account.move', readonly=True, + string="Invoice", + help='The invoice reference for the property') + invoiced = fields.Boolean(string='Invoiced', + help='Is the property sale invoiced') + billed = fields.Boolean(string='Commission Billed', + help='Is the commission given for this property ' + 'sale') + sale_price = fields.Monetary(string="Sale Price", readonly=False, + related='property_id.unit_price', + help='The price of the property') + any_broker = fields.Boolean(string='Any Broker', + help="Enable if this sale have a Broker") + broker_id = fields.Many2one('res.partner', string="Broker name", + help='The broker for this property sale') + commission_plan_id = fields.Many2one('property.commission', + string="Commission Plan", + help="Select the Commission Plan for " + "the broker") + commission_type = fields.Char( + compute='_compute_commission_and_commission_type', + string="Commission Type", + help='The type of the commission') + commission = fields.Monetary(string='Commission', + compute='_compute_commission_and_commission_type', + help='THe amount of commission') + company_id = fields.Many2one('res.company', + string="Property Management Company", + default=lambda self: self.env.company) + currency_id = fields.Many2one('res.currency', 'Currency', + related='company_id.currency_id', + required=True) + + @api.model + def create(self, vals): + """Generate Reference for the sale order""" + if vals.get('name', _('New')) == _('New'): + vals['name'] = self.env['ir.sequence'].next_by_code( + 'property.sale') or 'New' + res = super(PropertySale, self).create(vals) + return res + + @api.depends('commission_plan_id', 'sale_price') + def _compute_commission_and_commission_type(self): + """Calculate commission based on commission plan and sale price""" + for rec in self: + rec.commission_type = rec.commission_plan_id.commission_type + if rec.commission_plan_id.commission_type == 'fixed': + rec.commission = rec.commission_plan_id.commission + else: + rec.commission = (rec.sale_price * + rec.commission_plan_id.commission / 100) + + def create_invoice(self): + """Generate Invoice Based on the Monetary Values and return + Invoice Form View""" + self.invoiced = True + return { + 'name': _('Invoice'), + 'view_mode': 'form', + 'res_model': 'account.move', + 'target': 'current', + 'type': 'ir.actions.act_window', + 'context': { + 'default_move_type': 'out_invoice', + 'default_company_id': self.env.user.company_id.id, + 'default_partner_id': self.partner_id.id, + 'default_property_order_id': self.id, + 'default_invoice_line_ids': [fields.Command.create({ + 'name': self.property_id.name, + 'price_unit': self.sale_price, + 'currency_id': self.env.user.company_id.currency_id.id, + })] + } + } + + def commission_bill(self): + """Generate Bills Based on the Monetary Values and return + Bills Form View""" + self.billed = True + return { + 'name': _('Commission Bill'), + 'view_mode': 'form', + 'res_model': 'account.move', + 'target': 'current', + 'type': 'ir.actions.act_window', + 'context': { + 'default_move_type': 'in_invoice', + 'default_company_id': self.env.user.company_id.id, + 'default_partner_id': self.broker_id.id, + 'default_property_order_id': self.id, + 'default_invoice_line_ids': [fields.Command.create({ + 'name': self.property_id.name, + 'price_unit': self.commission, + 'currency_id': self.env.user.company_id.currency_id.id, + })] + } + } + + def action_view_invoice(self): + """Return Invoices Tree View""" + return { + 'name': _('Invoices'), + 'view_mode': 'tree,form', + 'res_model': 'account.move', + 'target': 'current', + 'type': 'ir.actions.act_window', + 'domain': [('property_order_id', '=', self.id), + ('move_type', '=', 'out_invoice')] + } + + def action_view_commission_bill(self): + """Return Bills Tree View""" + return { + 'name': _('Commission Bills'), + 'view_mode': 'tree,form', + 'res_model': 'account.move', + 'target': 'current', + 'type': 'ir.actions.act_window', + 'domain': [('property_order_id', '=', self.id), + ('move_type', '=', 'in_invoice')] + } + + def action_confirm(self): + """Confirm the sale order and Change necessary fields""" + if self.partner_id.blacklisted: + raise ValidationError( + _('The Customer %r is Blacklisted.', self.partner_id.name)) + self.state = 'confirm' + self.property_id.state = 'sold' + self.property_id.sale_id = self.id diff --git a/advanced_property_management/models/property_tag.py b/advanced_property_management/models/property_tag.py new file mode 100755 index 000000000..936b19804 --- /dev/null +++ b/advanced_property_management/models/property_tag.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class PropertyTag(models.Model): + """A class for the model property tags to represent + the related tags for a property""" + _name = 'property.tag' + _description = 'Property Tag' + _rec_name = 'tag' + + tag = fields.Char(string='Tag', required=True, help='Name of the tag') diff --git a/advanced_property_management/models/rental_bill.py b/advanced_property_management/models/rental_bill.py new file mode 100755 index 000000000..1d89d14d3 --- /dev/null +++ b/advanced_property_management/models/rental_bill.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class RentalBill(models.Model): + """A class for the model rental bills to represent + the related bills for a property rental""" + _name = 'rental.bill' + _description = 'Rental Bill' + + company_id = fields.Many2one('res.company', string='Company', + default=lambda self: self.env.company) + bill_no = fields.Char(string='Bill Number', required=True, + help='The bill number of the bill') + name = fields.Char(string='Name', required=True, + help='The name of the bill') + amount = fields.Float(string='Amount', + help='The amount listed in the bill') + rental_id = fields.Many2one('property.rental', string='Property Rental', + help='The corresponding Property Rental') diff --git a/advanced_property_management/models/res_partner.py b/advanced_property_management/models/res_partner.py new file mode 100755 index 000000000..04c257950 --- /dev/null +++ b/advanced_property_management/models/res_partner.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class ResPartner(models.Model): + """A class that inherits the already existing model res partner""" + _inherit = 'res.partner' + + blacklisted = fields.Boolean(string='Blacklisted', default=False, + help='Is this contact a blacklisted contact ' + 'or not') + + def action_add_blacklist(self): + """Sets the field blacklisted to True""" + self.blacklisted = True + + def action_remove_blacklist(self): + """Sets the field blacklisted to False""" + self.blacklisted = False diff --git a/advanced_property_management/reports/property_report.xml b/advanced_property_management/reports/property_report.xml new file mode 100755 index 000000000..eeb0c6bed --- /dev/null +++ b/advanced_property_management/reports/property_report.xml @@ -0,0 +1,156 @@ + + + + + Property Brochure + property.property + qweb-pdf + advanced_property_management.property_brochure + advanced_property_management.property_brochure + 'Property Brochure - %s' %(object.name) + + report + + + + diff --git a/advanced_property_management/reports/property_sale_report.xml b/advanced_property_management/reports/property_sale_report.xml new file mode 100755 index 000000000..14d0956cb --- /dev/null +++ b/advanced_property_management/reports/property_sale_report.xml @@ -0,0 +1,76 @@ + + + + + Property Sale Report + property.sale.report + qweb-pdf + advanced_property_management.property_sale_report_template + advanced_property_management.property_sale_report_template + + + + + diff --git a/advanced_property_management/security/ir.model.access.csv b/advanced_property_management/security/ir.model.access.csv new file mode 100755 index 000000000..9bbd257ec --- /dev/null +++ b/advanced_property_management/security/ir.model.access.csv @@ -0,0 +1,28 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_property_property_agent,access.property.property.agent,model_property_property,advanced_property_management.group_property_agent,1,1,1,0 +access_property_property_manager,access.property.property.manager,model_property_property,advanced_property_management.group_property_manager,1,1,1,1 +access_property_property_portal,access.property.property.portal,model_property_property,base.group_portal,1,1,1,0 +access_property_image_agent,access.property.image.agent,model_property_image,advanced_property_management.group_property_agent,1,1,1,1 +access_property_image_manager,access.property.image.management,model_property_image,advanced_property_management.group_property_manager,1,1,1,1 +access_property_area_measure_agent,access.property.area.measure.agent,model_property_area_measure,advanced_property_management.group_property_agent,1,1,1,1 +access_property_area_measure_manager,access.property.area.measure.manager,model_property_area_measure,advanced_property_management.group_property_manager,1,1,1,1 +access_property_facility_agent,access.property.facility.agent,model_property_facility,advanced_property_management.group_property_agent,1,1,1,0 +access_property_facility_manager,access.property.facility.manager,model_property_facility,advanced_property_management.group_property_manager,1,1,1,1 +access_property_nearby_connectivity_agent,access.property.nearby.connectivity.agent,model_property_nearby_connectivity,advanced_property_management.group_property_agent,1,1,1,1 +access_property_nearby_connectivity_manager,access.property.nearby.connectivity.manager,model_property_nearby_connectivity,advanced_property_management.group_property_manager,1,1,1,1 +access_property_tag_agent,access.property.tag.agent,model_property_tag,advanced_property_management.group_property_agent,1,0,0,0 +access_property_tag_manager,access.property.tag.manager,model_property_tag,advanced_property_management.group_property_manager,1,1,1,1 +access_property_commission_agent,access.property.commission.agent,model_property_commission,advanced_property_management.group_property_agent,1,1,0,0 +access_property_commission_manager,access.property.commission.manager,model_property_commission,advanced_property_management.group_property_manager,1,1,1,1 +access_property_sale_agent,access.property.sale.agent,model_property_sale,advanced_property_management.group_property_agent,1,1,1,0 +access_property_sale_manager,access.property.sale.manager,model_property_sale,advanced_property_management.group_property_manager,1,1,1,1 +access_property_sale_report_agent,access.property.sale.report.agent,model_property_sale_report,advanced_property_management.group_property_agent,1,1,1,0 +access_property_sale_report_manager,access.property.sale.report.manager,model_property_sale_report,advanced_property_management.group_property_manager,1,1,1,1 +access_property_rental_agent,access.property.rental.agent,model_property_rental,advanced_property_management.group_property_agent,1,1,1,0 +access_property_rental_manager,access.property.rental.manager,model_property_rental,advanced_property_management.group_property_manager,1,1,1,1 +access_rental_bill_agent,access.rental.bill.agent,model_rental_bill,advanced_property_management.group_property_agent,1,1,1,0 +access_rental_bill_manager,access.rental.bill.manager,model_rental_bill,advanced_property_management.group_property_manager,1,1,1,1 +access_property_auction_agent,access.property.auction.agent,model_property_auction,advanced_property_management.group_property_agent,1,1,1,0 +access_property_auction_manager,access.property.auction.manager,model_property_auction,advanced_property_management.group_property_manager,1,1,1,1 +access_property_auction_line_agent,access.property.auction.line.agent,model_property_auction_line,advanced_property_management.group_property_agent,1,1,0,0 +access_property_auction_line_manager,access.property.auction.line.manager,model_property_auction_line,advanced_property_management.group_property_manager,1,1,1,1 diff --git a/advanced_property_management/security/property_security.xml b/advanced_property_management/security/property_security.xml new file mode 100755 index 000000000..93cc61eb0 --- /dev/null +++ b/advanced_property_management/security/property_security.xml @@ -0,0 +1,37 @@ + + + + + + property multi company rule + + ['|', ('company_id', '=', False), + ('company_id', '=', company_id)] + + + + + property sale multi company rule + + ['|', ('company_id', '=', False), + ('company_id', '=', company_id)] + + + + + property rental multi company rule + + ['|', ('company_id', '=', False), + ('company_id', '=', company_id)] + + + + + multi company rule + + ['|', ('company_id', '=', False), + ('company_id', '=', company_id)] + + + + diff --git a/advanced_property_management/security/user_groups.xml b/advanced_property_management/security/user_groups.xml new file mode 100755 index 000000000..7898fa795 --- /dev/null +++ b/advanced_property_management/security/user_groups.xml @@ -0,0 +1,22 @@ + + + + + + Property Management + access right for Property Management module + 1 + + + + Property Agent + + + + + Property Manager + + + + + diff --git a/advanced_property_management/static/description/assets/icons/check.png b/advanced_property_management/static/description/assets/icons/check.png new file mode 100755 index 000000000..c8e85f51d Binary files /dev/null and b/advanced_property_management/static/description/assets/icons/check.png differ diff --git a/advanced_property_management/static/description/assets/icons/chevron.png b/advanced_property_management/static/description/assets/icons/chevron.png new file mode 100755 index 000000000..2089293d6 Binary files /dev/null and b/advanced_property_management/static/description/assets/icons/chevron.png differ diff --git a/advanced_property_management/static/description/assets/icons/cogs.png b/advanced_property_management/static/description/assets/icons/cogs.png new file mode 100755 index 000000000..95d0bad62 Binary files /dev/null and b/advanced_property_management/static/description/assets/icons/cogs.png differ diff --git a/advanced_property_management/static/description/assets/icons/consultation.png b/advanced_property_management/static/description/assets/icons/consultation.png new file mode 100755 index 000000000..8319d4baa Binary files /dev/null and b/advanced_property_management/static/description/assets/icons/consultation.png differ diff --git a/advanced_property_management/static/description/assets/icons/ecom-black.png b/advanced_property_management/static/description/assets/icons/ecom-black.png new file mode 100755 index 000000000..a9385ff13 Binary files /dev/null and b/advanced_property_management/static/description/assets/icons/ecom-black.png differ diff --git a/advanced_property_management/static/description/assets/icons/education-black.png b/advanced_property_management/static/description/assets/icons/education-black.png new file mode 100755 index 000000000..3eb09b27b Binary files /dev/null and b/advanced_property_management/static/description/assets/icons/education-black.png differ diff --git a/advanced_property_management/static/description/assets/icons/hotel-black.png b/advanced_property_management/static/description/assets/icons/hotel-black.png new file mode 100755 index 000000000..130f613be Binary files /dev/null and b/advanced_property_management/static/description/assets/icons/hotel-black.png differ diff --git a/advanced_property_management/static/description/assets/icons/license.png b/advanced_property_management/static/description/assets/icons/license.png new file mode 100755 index 000000000..a5869797e Binary files /dev/null and b/advanced_property_management/static/description/assets/icons/license.png differ diff --git a/advanced_property_management/static/description/assets/icons/lifebuoy.png b/advanced_property_management/static/description/assets/icons/lifebuoy.png new file mode 100755 index 000000000..658d56ccc Binary files /dev/null and b/advanced_property_management/static/description/assets/icons/lifebuoy.png differ diff --git a/advanced_property_management/static/description/assets/icons/manufacturing-black.png b/advanced_property_management/static/description/assets/icons/manufacturing-black.png new file mode 100755 index 000000000..697eb0e9f Binary files /dev/null and b/advanced_property_management/static/description/assets/icons/manufacturing-black.png differ diff --git a/advanced_property_management/static/description/assets/icons/pos-black.png b/advanced_property_management/static/description/assets/icons/pos-black.png new file mode 100755 index 000000000..97c0f90c1 Binary files /dev/null and b/advanced_property_management/static/description/assets/icons/pos-black.png differ diff --git a/advanced_property_management/static/description/assets/icons/puzzle.png b/advanced_property_management/static/description/assets/icons/puzzle.png new file mode 100755 index 000000000..65cf854e7 Binary files /dev/null and b/advanced_property_management/static/description/assets/icons/puzzle.png differ diff --git a/advanced_property_management/static/description/assets/icons/restaurant-black.png b/advanced_property_management/static/description/assets/icons/restaurant-black.png new file mode 100755 index 000000000..4a35eb939 Binary files /dev/null and b/advanced_property_management/static/description/assets/icons/restaurant-black.png differ diff --git a/advanced_property_management/static/description/assets/icons/service-black.png b/advanced_property_management/static/description/assets/icons/service-black.png new file mode 100755 index 000000000..301ab51cb Binary files /dev/null and b/advanced_property_management/static/description/assets/icons/service-black.png differ diff --git a/advanced_property_management/static/description/assets/icons/trading-black.png b/advanced_property_management/static/description/assets/icons/trading-black.png new file mode 100755 index 000000000..9398ba2f1 Binary files /dev/null and b/advanced_property_management/static/description/assets/icons/trading-black.png differ diff --git a/advanced_property_management/static/description/assets/icons/training.png b/advanced_property_management/static/description/assets/icons/training.png new file mode 100755 index 000000000..884ca024d Binary files /dev/null and b/advanced_property_management/static/description/assets/icons/training.png differ diff --git a/advanced_property_management/static/description/assets/icons/update.png b/advanced_property_management/static/description/assets/icons/update.png new file mode 100755 index 000000000..ecbc5a01a Binary files /dev/null and b/advanced_property_management/static/description/assets/icons/update.png differ diff --git a/advanced_property_management/static/description/assets/icons/user.png b/advanced_property_management/static/description/assets/icons/user.png new file mode 100755 index 000000000..6ffb23d9f Binary files /dev/null and b/advanced_property_management/static/description/assets/icons/user.png differ diff --git a/advanced_property_management/static/description/assets/icons/wrench.png b/advanced_property_management/static/description/assets/icons/wrench.png new file mode 100755 index 000000000..6c04dea0f Binary files /dev/null and b/advanced_property_management/static/description/assets/icons/wrench.png differ diff --git a/advanced_property_management/static/description/assets/misc/categories.png b/advanced_property_management/static/description/assets/misc/categories.png new file mode 100755 index 000000000..bedf1e0b1 Binary files /dev/null and b/advanced_property_management/static/description/assets/misc/categories.png differ diff --git a/advanced_property_management/static/description/assets/misc/check-box.png b/advanced_property_management/static/description/assets/misc/check-box.png new file mode 100755 index 000000000..42caf24b9 Binary files /dev/null and b/advanced_property_management/static/description/assets/misc/check-box.png differ diff --git a/advanced_property_management/static/description/assets/misc/compass.png b/advanced_property_management/static/description/assets/misc/compass.png new file mode 100755 index 000000000..d5fed8faa Binary files /dev/null and b/advanced_property_management/static/description/assets/misc/compass.png differ diff --git a/advanced_property_management/static/description/assets/misc/corporate.png b/advanced_property_management/static/description/assets/misc/corporate.png new file mode 100755 index 000000000..2eb13edbf Binary files /dev/null and b/advanced_property_management/static/description/assets/misc/corporate.png differ diff --git a/advanced_property_management/static/description/assets/misc/customer-support.png b/advanced_property_management/static/description/assets/misc/customer-support.png new file mode 100755 index 000000000..79efc72ed Binary files /dev/null and b/advanced_property_management/static/description/assets/misc/customer-support.png differ diff --git a/advanced_property_management/static/description/assets/misc/cybrosys-logo.png b/advanced_property_management/static/description/assets/misc/cybrosys-logo.png new file mode 100755 index 000000000..cc3cc0ccf Binary files /dev/null and b/advanced_property_management/static/description/assets/misc/cybrosys-logo.png differ diff --git a/advanced_property_management/static/description/assets/misc/features.png b/advanced_property_management/static/description/assets/misc/features.png new file mode 100755 index 000000000..b41769f77 Binary files /dev/null and b/advanced_property_management/static/description/assets/misc/features.png differ diff --git a/advanced_property_management/static/description/assets/misc/logo.png b/advanced_property_management/static/description/assets/misc/logo.png new file mode 100755 index 000000000..478462d3e Binary files /dev/null and b/advanced_property_management/static/description/assets/misc/logo.png differ diff --git a/advanced_property_management/static/description/assets/misc/pictures.png b/advanced_property_management/static/description/assets/misc/pictures.png new file mode 100755 index 000000000..56d255fe9 Binary files /dev/null and b/advanced_property_management/static/description/assets/misc/pictures.png differ diff --git a/advanced_property_management/static/description/assets/misc/pie-chart.png b/advanced_property_management/static/description/assets/misc/pie-chart.png new file mode 100755 index 000000000..426e05244 Binary files /dev/null and b/advanced_property_management/static/description/assets/misc/pie-chart.png differ diff --git a/advanced_property_management/static/description/assets/misc/right-arrow.png b/advanced_property_management/static/description/assets/misc/right-arrow.png new file mode 100755 index 000000000..730984a06 Binary files /dev/null and b/advanced_property_management/static/description/assets/misc/right-arrow.png differ diff --git a/advanced_property_management/static/description/assets/misc/star.png b/advanced_property_management/static/description/assets/misc/star.png new file mode 100755 index 000000000..2eb9ab29f Binary files /dev/null and b/advanced_property_management/static/description/assets/misc/star.png differ diff --git a/advanced_property_management/static/description/assets/misc/support.png b/advanced_property_management/static/description/assets/misc/support.png new file mode 100755 index 000000000..4f18b8b82 Binary files /dev/null and b/advanced_property_management/static/description/assets/misc/support.png differ diff --git a/advanced_property_management/static/description/assets/misc/whatsapp.png b/advanced_property_management/static/description/assets/misc/whatsapp.png new file mode 100755 index 000000000..d513a5356 Binary files /dev/null and b/advanced_property_management/static/description/assets/misc/whatsapp.png differ diff --git a/advanced_property_management/static/description/assets/modules/1.png b/advanced_property_management/static/description/assets/modules/1.png new file mode 100755 index 000000000..c9d686d47 Binary files /dev/null and b/advanced_property_management/static/description/assets/modules/1.png differ diff --git a/advanced_property_management/static/description/assets/modules/2.png b/advanced_property_management/static/description/assets/modules/2.png new file mode 100755 index 000000000..2a666bf79 Binary files /dev/null and b/advanced_property_management/static/description/assets/modules/2.png differ diff --git a/advanced_property_management/static/description/assets/modules/3.png b/advanced_property_management/static/description/assets/modules/3.png new file mode 100755 index 000000000..c61ac9571 Binary files /dev/null and b/advanced_property_management/static/description/assets/modules/3.png differ diff --git a/advanced_property_management/static/description/assets/modules/4.png b/advanced_property_management/static/description/assets/modules/4.png new file mode 100755 index 000000000..3391446ba Binary files /dev/null and b/advanced_property_management/static/description/assets/modules/4.png differ diff --git a/advanced_property_management/static/description/assets/modules/5.png b/advanced_property_management/static/description/assets/modules/5.png new file mode 100755 index 000000000..f9706edbe Binary files /dev/null and b/advanced_property_management/static/description/assets/modules/5.png differ diff --git a/advanced_property_management/static/description/assets/modules/6.png b/advanced_property_management/static/description/assets/modules/6.png new file mode 100755 index 000000000..232897511 Binary files /dev/null and b/advanced_property_management/static/description/assets/modules/6.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/01.png b/advanced_property_management/static/description/assets/screenshots/01.png new file mode 100755 index 000000000..3f84987d4 Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/01.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/02.png b/advanced_property_management/static/description/assets/screenshots/02.png new file mode 100755 index 000000000..08482879e Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/02.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/03.png b/advanced_property_management/static/description/assets/screenshots/03.png new file mode 100755 index 000000000..712c30825 Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/03.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/04.png b/advanced_property_management/static/description/assets/screenshots/04.png new file mode 100755 index 000000000..4f75d3be7 Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/04.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/05.png b/advanced_property_management/static/description/assets/screenshots/05.png new file mode 100755 index 000000000..7be6da43f Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/05.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/06.png b/advanced_property_management/static/description/assets/screenshots/06.png new file mode 100755 index 000000000..ff689f003 Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/06.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/07.png b/advanced_property_management/static/description/assets/screenshots/07.png new file mode 100755 index 000000000..9fd54a866 Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/07.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/08.png b/advanced_property_management/static/description/assets/screenshots/08.png new file mode 100755 index 000000000..6b77632d3 Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/08.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/09.png b/advanced_property_management/static/description/assets/screenshots/09.png new file mode 100755 index 000000000..d237cc5a3 Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/09.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/10.png b/advanced_property_management/static/description/assets/screenshots/10.png new file mode 100755 index 000000000..62f444a06 Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/10.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/11.png b/advanced_property_management/static/description/assets/screenshots/11.png new file mode 100755 index 000000000..88ca2c161 Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/11.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/12.png b/advanced_property_management/static/description/assets/screenshots/12.png new file mode 100755 index 000000000..ec059b76e Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/12.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/13.png b/advanced_property_management/static/description/assets/screenshots/13.png new file mode 100755 index 000000000..4ed91ec97 Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/13.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/14.png b/advanced_property_management/static/description/assets/screenshots/14.png new file mode 100755 index 000000000..b3bf2cd9d Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/14.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/15.png b/advanced_property_management/static/description/assets/screenshots/15.png new file mode 100755 index 000000000..c2bc3a70f Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/15.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/16.png b/advanced_property_management/static/description/assets/screenshots/16.png new file mode 100755 index 000000000..39bb608e7 Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/16.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/17.png b/advanced_property_management/static/description/assets/screenshots/17.png new file mode 100755 index 000000000..b564cf922 Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/17.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/18.png b/advanced_property_management/static/description/assets/screenshots/18.png new file mode 100755 index 000000000..468b62c9e Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/18.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/19.png b/advanced_property_management/static/description/assets/screenshots/19.png new file mode 100755 index 000000000..a1d21d21d Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/19.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/20.png b/advanced_property_management/static/description/assets/screenshots/20.png new file mode 100755 index 000000000..c0015e4a7 Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/20.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/21.png b/advanced_property_management/static/description/assets/screenshots/21.png new file mode 100755 index 000000000..bb27c706a Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/21.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/22.png b/advanced_property_management/static/description/assets/screenshots/22.png new file mode 100755 index 000000000..900108e3e Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/22.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/23.png b/advanced_property_management/static/description/assets/screenshots/23.png new file mode 100755 index 000000000..aa466a577 Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/23.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/24.png b/advanced_property_management/static/description/assets/screenshots/24.png new file mode 100755 index 000000000..073e85a30 Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/24.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/25.png b/advanced_property_management/static/description/assets/screenshots/25.png new file mode 100755 index 000000000..9a12153d6 Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/25.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/26.png b/advanced_property_management/static/description/assets/screenshots/26.png new file mode 100755 index 000000000..fdfd0cef1 Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/26.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/27.png b/advanced_property_management/static/description/assets/screenshots/27.png new file mode 100755 index 000000000..90225d008 Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/27.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/28.png b/advanced_property_management/static/description/assets/screenshots/28.png new file mode 100755 index 000000000..618a98e28 Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/28.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/30.png b/advanced_property_management/static/description/assets/screenshots/30.png new file mode 100755 index 000000000..302cd4bf4 Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/30.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/31.png b/advanced_property_management/static/description/assets/screenshots/31.png new file mode 100755 index 000000000..a2e9a9786 Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/31.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/32.png b/advanced_property_management/static/description/assets/screenshots/32.png new file mode 100755 index 000000000..5b68ba377 Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/32.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/33.png b/advanced_property_management/static/description/assets/screenshots/33.png new file mode 100755 index 000000000..6426f5403 Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/33.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/34.png b/advanced_property_management/static/description/assets/screenshots/34.png new file mode 100755 index 000000000..adeb78962 Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/34.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/50.png b/advanced_property_management/static/description/assets/screenshots/50.png new file mode 100755 index 000000000..46e47db42 Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/50.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/51.png b/advanced_property_management/static/description/assets/screenshots/51.png new file mode 100755 index 000000000..6e0617b65 Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/51.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/52.png b/advanced_property_management/static/description/assets/screenshots/52.png new file mode 100755 index 000000000..42aeedfbc Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/52.png differ diff --git a/advanced_property_management/static/description/assets/screenshots/advanced_property_management-v16-gif.gif b/advanced_property_management/static/description/assets/screenshots/advanced_property_management-v16-gif.gif new file mode 100755 index 000000000..5360aa40e Binary files /dev/null and b/advanced_property_management/static/description/assets/screenshots/advanced_property_management-v16-gif.gif differ diff --git a/advanced_property_management/static/description/banner.png b/advanced_property_management/static/description/banner.png new file mode 100755 index 000000000..c75317646 Binary files /dev/null and b/advanced_property_management/static/description/banner.png differ diff --git a/advanced_property_management/static/description/icon.png b/advanced_property_management/static/description/icon.png new file mode 100755 index 000000000..965f22630 Binary files /dev/null and b/advanced_property_management/static/description/icon.png differ diff --git a/advanced_property_management/static/description/index.html b/advanced_property_management/static/description/index.html new file mode 100755 index 000000000..fcb3a60b9 --- /dev/null +++ b/advanced_property_management/static/description/index.html @@ -0,0 +1,754 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ Advanced Property Management

+

+ Manage The Sale , Auction and Rental of your Properties

+ + +
+
+
+ + +
+ + +
+
+ +
+

Explore This + Module

+
+ + + + +
+
+ +
+

Overview +

+
+
+
+ This app provides features to allow your customers to see the properties that are for sale and rental from your website. + They can also bid for the properties through website. + It also allows you to manage sales commission. You can easily manage both sale and rental of your properties here. +
+
+ + + +
+
+ +
+

Features +

+
+
+
+
+ + View Properties from Website +
+
+ + + Kanban and List view with Search Panel + +
+
+ + + Property Brochure + +
+
+ + + Property Auction + +
+
+ + + Geographic location on map +
+
+ + + Manage Commission +
+
+ + + Sale Reporting +
+
+ + + Generate Invoice automatically for rental +
+
+ + + Blacklisted Contacts +
+
+
+ + + +
+
+ +
+

Screenshots +

+
+
+
+ +
+

Property Website

+ +
+ +
+

Property Sales Website

+ +
+ +
+

Property Rental Website

+ +
+ +
+

Security Groups

+

You can configure the user groups by going to settings --> Users

+ +
+ +
+

Property View

+

When you open the menu 'Property Management', + you can see all the properties in different views such as kanban(by default), tree and activity. + You can also use the search panel to filter among different property type and their status. + You can create a property by clicking on the create button at the header

+ +
+ +
+

Property Form View

+ +
+ +
+

Property Type Land and Land Details

+ +
+ +
+

Property Type Residential and Residential Details

+ +
+ +
+

Property Type Commercial and Commercial Details

+ +
+ +
+

Property Type Industrial and Industrial Details

+ +
+ +
+

You can locate the location of property in google map using the smart button 'Locate'. + Under the description tab you can set the description of the property

+ +
+ +
+

Under the Image tab, you can add more images of the property and give a name and description for that image

+ +
+ +
+

Under the Measurement tab, you can add your section and its measurements in feet. Total square feet of the property is automatically calculated

+ +
+ +
+

Under the Facilities tab, you can configure the facilities of the property

+ +
+ +
+

Under Nearby Connectivity tab, you can add the nearby connectives and the distance between them and the property

+ +
+ +
+

Property Brochure

+ +
+ +
+ +
+ +
+

Property Sale

+

You can go and create a property sale order by going to Property --> Property Sale

+ +
+ +
+

You can confirm the property sale order. And also can add broker details and commission plan if there are any. + Then you can create an invoice for the property sale

+ +
+ +
+

You can also create a commission bill for the broker for the property

+ +
+ +
+

Property Auction

+

You can create a property for auction

+ +
+ +
+

You can go to Property --> Property Auction and create a property auction record

+ +
+ +
+

You can confirm and start the property auction

+ +
+ +
+

You can Bid for the property in website

+ +
+ +
+

Finally, you can end the auction and the highest + bid is selected as its price and can create a property sale order from there itself

+ +
+ +
+

Property Rental

+

You can go and create a property rental order by going to Property --> Property Rental

+ +
+ +
+

You can create contract for the property. Invoice will be automatically created. + You can add bills if there are any and also see the next invoice date.

+ +
+ +
+

Blacklisted Contact

+

You can go to the Customers --> Customers and click on 'add to blacklist' button to add the contact to blacklist. + So when you confirm order with the blacklisted contact, it shows a popup message.

+ +
+ +
+

You can see the blacklisted contacts by going to Customers --> Blacklisted

+ +
+ +
+

Configure Property Facilities

+ +
+ +
+

Configure Property Tags

+ +
+ +
+

View all property rental bills

+ +
+ +
+

Configure Property Commission Plans

+ +
+ +
+

You can print the sales report by going to Reporting --> Sales Report

+ +
+ +
+

You can filter different fields and print the report

+ +
+ +
+ +
+ +
+
+ + + +
+
+ +
+

Related + Products +

+
+
+
+ +
+
+ + + + +
+
+ +
+

Our Services +

+
+ +
+
+
+
+ +
+
+ Odoo + Customization
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Support
+
+ + +
+
+ +
+
+ Hire + Odoo + Developer
+
+ +
+
+ +
+
+ Odoo + Integration
+
+ +
+
+ +
+
+ Odoo + Migration
+
+ + +
+
+ +
+
+ Odoo + Consultancy
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Licensing Consultancy
+
+
+ +
+ + + + + +
+
+ +
+

Our + Industries +

+
+ +
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

+
+
+ +
+
+ +
+ E-commerce & Website +
+

+ Mobile + friendly, + awe-inspiring product pages

+
+
+ +
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+ +
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

+
+
+
+
+ + + + +
+
+ +
+

Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/advanced_property_management/static/src/js/property_item.js b/advanced_property_management/static/src/js/property_item.js new file mode 100755 index 000000000..55d6322d8 --- /dev/null +++ b/advanced_property_management/static/src/js/property_item.js @@ -0,0 +1,32 @@ +odoo.define('advanced_property_management.property_item', function (require) { +'use strict'; + var publicWidget = require('web.public.widget'); + var rpc = require('web.rpc'); + + publicWidget.registry.PropertyItemView = publicWidget.Widget.extend({ + templates: 'advanced_property_management.property_view_item', + selector: '.property_container', + events: { + 'click #loadMap': 'MapLoad', + }, + //Loads the map location of the property + MapLoad: function (e) { + this.$('#map-view').css('display', 'block') + this.$('#loadMap').css('display', 'none') + var lat = parseFloat(e.target.dataset.lat) + var lng = parseFloat(e.target.dataset.lng) + const location = { lat: lat, lng: lng }; + const map = new google.maps.Map(document.getElementById("map-view"), + { + zoom: 12, + center: location, + + }); + const marker = new google.maps.Marker({ + position: location, + map: map, + }); + }, + }); + return publicWidget.registry.PropertyItemView ; +}) diff --git a/advanced_property_management/static/src/js/property_website.js b/advanced_property_management/static/src/js/property_website.js new file mode 100755 index 000000000..1591a1242 --- /dev/null +++ b/advanced_property_management/static/src/js/property_website.js @@ -0,0 +1,74 @@ +odoo.define('advanced_property_management.property_website', function (require) { +'use strict'; + var publicWidget = require('web.public.widget'); + var rpc = require('web.rpc'); + + publicWidget.registry.PropertyView = publicWidget.Widget.extend({ + selector: 'div[id="property_container"]', + events: { + 'click .property_action_buttons': '_changeView', + 'click .o_property_item': 'fetchPropertyItem', + 'click .auction_submit': '_submitAuction', + }, + //hide and show the properties according to the action_id + _changeView: function (ev) { + var action_id = this.$(ev.currentTarget).data('action') + this.$('.property_action_buttons').removeClass('active') + this.$('#property_item_view').hide() + this.$('#property_sales_view').hide() + this.$('#property_rental_view').hide() + this.$('#property_auction_view').hide() + if (action_id == "0") { + this.$('#property_item_view').show() + this.$(ev.currentTarget).addClass('active') + } else if (action_id == "2") { + this.$(ev.currentTarget).addClass('active') + this.$('#property-item').hide() + this.$('#property_sales_view').show() + } else if (action_id == "3") { + $(ev.currentTarget).addClass('active') + this.$('#property-item').hide() + this.$('#property_rental_view').show() + } else if (action_id == "1") { + this.$('#property_auction_view').show() + this.$(ev.currentTarget).addClass('active') + rpc.query({ + route: `/property/auction/`, + }).then(function (result) { + this.$('.auction_cards').html(result) + }.bind(this)) + } + }, + //Fetch all the properties + fetchPropertyItem: function (ev) { + var record_id = $(ev.currentTarget).data('property_id') + window.location = '/property/' + record_id; + }, + //Submits the auction for the property + _submitAuction: function (ev) { + var property_id = this.$(ev.currentTarget).data('id'); + var bid_amount = parseFloat(this.$(`#property-${property_id}`).val()); + var last_bid = parseFloat(this.$(`#last-bid-${property_id}`).text()); + var bid_start = parseFloat(this.$(`#bid-start-${property_id}`).text()); + if (last_bid == '0') { + last_bid = 1 + } + var toast = this.$('.toast') + if (bid_amount && last_bid && bid_start) { + if (bid_amount <= last_bid || bid_amount <= bid_start) { + toast.addClass('show'); + } else { + rpc.query({ + route: `/property/auction/${property_id}/bid`, + params: {bid_amount: bid_amount} + }).then(function (result) { + $('#auction_button').click() + }) + } + } else { + toast.addClass('show'); + } + }, + }); + return publicWidget.registry.PropertyView; +}) diff --git a/advanced_property_management/views/property_auction_views.xml b/advanced_property_management/views/property_auction_views.xml new file mode 100755 index 000000000..3aecb0ecc --- /dev/null +++ b/advanced_property_management/views/property_auction_views.xml @@ -0,0 +1,103 @@ + + + + + Property Auction + property.auction + tree,form + +

+ Create a new Property Auction +

+
+
+ + + + + property.auction.view.from + property.auction + +
+
+ +
+ +
+
+
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + property.auction.view.tree + property.auction + + + + + + + + + + + + + +
diff --git a/advanced_property_management/views/property_commision_views.xml b/advanced_property_management/views/property_commision_views.xml new file mode 100755 index 000000000..334aa1722 --- /dev/null +++ b/advanced_property_management/views/property_commision_views.xml @@ -0,0 +1,30 @@ + + + + + Property Commission + property.commission + tree + +

+ Create a new Sale Order +

+
+
+ + + + + property.commission.tree + property.commission + + + + + + + + +
diff --git a/advanced_property_management/views/property_facility_views.xml b/advanced_property_management/views/property_facility_views.xml new file mode 100755 index 000000000..4504f1d9f --- /dev/null +++ b/advanced_property_management/views/property_facility_views.xml @@ -0,0 +1,30 @@ + + + + + Property Facilities + ir.actions.act_window + property.facility + tree,form + +

+ Create Your First Property Type! +

+
+
+ + + + + + property.facility.view.tree + property.facility + + + + + + +
diff --git a/advanced_property_management/views/property_property_views.xml b/advanced_property_management/views/property_property_views.xml new file mode 100755 index 000000000..d33a7054e --- /dev/null +++ b/advanced_property_management/views/property_property_views.xml @@ -0,0 +1,336 @@ + + + + + Property + ir.actions.act_window + property.property + kanban,tree,form,activity + +

+ Create Your First Property! +

+
+
+ + + + + + + property.property.view.tree + property.property + + + + + + + + + + + + + + property.property.view.form + property.property + +
+
+ +
+ +
+
+ +
+

+ +

+

+ +

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+ + + + +
+ +
+
+
+
+
+
+ + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + +
+ +
+
+ + + property.property.view.kanban + property.property + + + + + + + + + + + + + +
+ + +
+
+
+ +

+ +

+
+ + + +
+
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+
+ +
+
+
+
+
+ + + +
+ + + + property.property.view.search + property.property + + + + + + + + + + + + diff --git a/advanced_property_management/views/property_rental_views.xml b/advanced_property_management/views/property_rental_views.xml new file mode 100755 index 000000000..eea2aa942 --- /dev/null +++ b/advanced_property_management/views/property_rental_views.xml @@ -0,0 +1,95 @@ + + + + + Property Rental + property.rental + tree,form + +

+ Create a new Rental record! +

+
+
+ + + + + property.rental.view.tree + property.rental + + + + + + + + + + + + + property.rental.view.form + property.rental + +
+
+
+ +
+ +
+
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + +
+
+
+
+
diff --git a/advanced_property_management/views/property_sale_views.xml b/advanced_property_management/views/property_sale_views.xml new file mode 100755 index 000000000..656dab2d7 --- /dev/null +++ b/advanced_property_management/views/property_sale_views.xml @@ -0,0 +1,109 @@ + + + + + Property Sale + property.sale + tree,form + +

+ Create a new Sale Order +

+
+
+ + + + + property.sale.view.tree + property.sale + + + + + + + + + + + + + property.sale.view.form + property.sale + +
+
+
+ +
+
+
+

+ +

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+
+
+
+
diff --git a/advanced_property_management/views/property_search_pannel_views.xml b/advanced_property_management/views/property_search_pannel_views.xml new file mode 100755 index 000000000..ac53f3597 --- /dev/null +++ b/advanced_property_management/views/property_search_pannel_views.xml @@ -0,0 +1,19 @@ + + + + + property.property.search.panel + property.property + + + + + + + + + + + diff --git a/advanced_property_management/views/property_tag_views.xml b/advanced_property_management/views/property_tag_views.xml new file mode 100755 index 000000000..3cb4b5064 --- /dev/null +++ b/advanced_property_management/views/property_tag_views.xml @@ -0,0 +1,28 @@ + + + + + Property Tags + property.tag + tree + +

+ Create Your First Property Type! +

+
+
+ + + + + property.tag.view.tree + property.tag + + + + + + +
diff --git a/advanced_property_management/views/property_templates.xml b/advanced_property_management/views/property_templates.xml new file mode 100755 index 000000000..1f3730b67 --- /dev/null +++ b/advanced_property_management/views/property_templates.xml @@ -0,0 +1,558 @@ + + + + +