diff --git a/vendor_portal_odoo/README.rst b/vendor_portal_odoo/README.rst new file mode 100644 index 000000000..6231d4e27 --- /dev/null +++ b/vendor_portal_odoo/README.rst @@ -0,0 +1,49 @@ +.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +Odoo Vendor Portal +================== +* This module helps to sent quotations for a product to multiple vendors and vendors can +add their price in their portal and can choose best quotation for product. + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.odoo.com/documentation/user/16.0/legal/licenses/licenses.html) + +Credits +------- +* Developers: Athul @cybrosys + +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 `Our Website `__ + +Further information +=================== +HTML Description: ``__ + + diff --git a/vendor_portal_odoo/__init__.py b/vendor_portal_odoo/__init__.py new file mode 100644 index 000000000..3a7d811cf --- /dev/null +++ b/vendor_portal_odoo/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Athul k () +# +# 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 wizard diff --git a/vendor_portal_odoo/__manifest__.py b/vendor_portal_odoo/__manifest__.py new file mode 100644 index 000000000..79d0f8bd0 --- /dev/null +++ b/vendor_portal_odoo/__manifest__.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Athul k () +# +# 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': 'Odoo Vendor Portal', + 'version': '16.0.1.0.0', + 'category': 'Purchases', + 'summary': """Vendor Portal Management in Odoo""", + 'description': """This module helps to sent quotations for a product to multiple vendors and vendors can add their + price in their portal, and can choose best quotation for product""", + 'author': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'depends': ['website', 'purchase', 'portal', 'contacts', 'stock'], + 'data': [ + 'security/portal_security.xml', + 'security/ir.model.access.csv', + 'data/rfq_sequence.xml', + 'data/rfq_mail_templates.xml', + 'data/rfq_cron.xml', + 'wizard/register_vendor.xml', + 'wizard/rfq_done.xml', + 'views/res_partner_views.xml', + 'views/vendor_rfq_views.xml', + 'views/res_config_settings_views.xml', + 'views/portal_rfq_templates.xml', + 'views/portal_menus.xml' + ], + 'images': ['static/description/banner.png'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/vendor_portal_odoo/controllers/__init__.py b/vendor_portal_odoo/controllers/__init__.py new file mode 100644 index 000000000..d90d71cc0 --- /dev/null +++ b/vendor_portal_odoo/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Athul k () +# +# 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 portal diff --git a/vendor_portal_odoo/controllers/portal.py b/vendor_portal_odoo/controllers/portal.py new file mode 100644 index 000000000..ef71fc79e --- /dev/null +++ b/vendor_portal_odoo/controllers/portal.py @@ -0,0 +1,140 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Athul k () +# +# 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 collections import OrderedDict +from odoo import http, _ +from odoo.http import request +from odoo.addons.portal.controllers.portal import pager as portal_pager, CustomerPortal + + +class RFQCustomerPortal(CustomerPortal): + + def _prepare_home_portal_values(self, counters): + """RFQs in home portal""" + user_partner = request.env.user.partner_id + values = super()._prepare_home_portal_values(counters) + if 'my_rfq_count' in counters: + values['my_rfq_count'] = request.env[ + 'vendor.rfq'].search_count( + [('vendor_ids', 'in', user_partner.ids)]) if request.env[ + 'vendor.rfq'].check_access_rights( + 'read', raise_exception=False) else 0 + return values + + def _rfq_get_page_view_values(self, vendor_rfq, access_token, **kwargs): + """RFQ Page values""" + values = { + 'page_name': 'vendor_rfq', + 'vendor_rfq': vendor_rfq, + } + return self._get_page_view_values(vendor_rfq, access_token, values, + 'my_rfq_history', False, **kwargs) + + @http.route(['/my/vendor_rfqs', '/my/vendor_rfqs/page/'], + type='http', auth="public", website=True) + def portal_my_vendor_rfqs(self, page=1, date_begin=None, + date_end=None, sortby=None, filterby=None, **kw): + """Portal vendor RFQs""" + values = self._prepare_portal_layout_values() + user_partner = request.env.user.partner_id + vendor_rfq = request.env['vendor.rfq'].search([]) + domain = [ + ('vendor_ids', 'in', user_partner.ids), ('state', 'not in', ['draft'])] + if date_begin and date_end: + domain += [('create_date', '>', date_begin), + ('create_date', '<=', date_end)] + + searchbar_sortings = { + 'date': {'label': _('Newest'), + 'order': 'create_date desc, id desc'}, + 'name': {'label': _('Name'), 'order': 'name asc, id asc'}, + } + if not sortby: + sortby = 'name' + order = searchbar_sortings[sortby]['order'] + searchbar_filters = { + 'all': {'label': _('All'), 'domain': [ + ('state', 'in', ['draft', 'in_progress', 'pending', + 'done', 'cancel'])]}, + 'Done': {'label': _('Done'), 'domain': [('state', '=', 'done')]}, + 'In Progress': {'label': _('In Progress'), + 'domain': [('state', '=', 'in_progress')]}, + } + # default filter by value + if not filterby: + filterby = 'all' + domain += searchbar_filters[filterby]['domain'] + rfq_unit_count = vendor_rfq.search_count(domain) + pager = portal_pager( + url="/my/vendor_rfqs", + url_args={'date_begin': date_begin, 'date_end': date_end, + 'sortby': sortby, 'filterby': filterby}, + total=rfq_unit_count, + page=page, + step=self._items_per_page + ) + + orders = vendor_rfq.search( + domain, + order=order, + limit=self._items_per_page, + offset=pager['offset'] + ) + values.update({ + 'date': date_begin, + 'rfqs': orders, + 'page_name': 'vendor_rfq', + 'pager': pager, + 'searchbar_sortings': searchbar_sortings, + 'sortby': sortby, + 'searchbar_filters': OrderedDict(sorted(searchbar_filters.items())), + 'filterby': filterby, + 'default_url': '/my/vendor_rfqs', + }) + return request.render( + "vendor_portal_odoo.portal_my_rfq", + values) + + @http.route(['/my/vendor_rfq/'], type='http', auth="public", + website=True) + def portal_my_vendor_rfq(self, rfq_id, access_token=None, **kw): + """displaying the RFQ details""" + rfq_details = request.env['vendor.rfq'].browse(int(rfq_id)) + vendor_quote = rfq_details.vendor_quote_history_ids.filtered( + lambda x: x.vendor_id.id == request.env.user.partner_id.id) + quoted_price = vendor_quote.quoted_price + values = self._rfq_get_page_view_values(rfq_details, access_token, **kw) + values['quoted_price'] = quoted_price + values['vendor_quote'] = vendor_quote + return request.render( + "vendor_portal_odoo.portal_my_vendor_rfq", values) + + @http.route(['/quote/details'], type='http', auth="public", website=True) + def quote_details(self, **post): + """Quote details""" + request.env['vendor.quote.history'].sudo().create({ + 'vendor_id': request.env.user.partner_id.id, + 'quoted_price': float(post.get('price')), + 'estimate_date': post.get('delivery_date'), + 'note': post.get('additional_note'), + 'quote_id': post.get('rfq_id'), + }) + return request.redirect('/my/vendor_rfq/%s' % (post.get('rfq_id'))) diff --git a/vendor_portal_odoo/data/rfq_cron.xml b/vendor_portal_odoo/data/rfq_cron.xml new file mode 100644 index 000000000..26bf2762d --- /dev/null +++ b/vendor_portal_odoo/data/rfq_cron.xml @@ -0,0 +1,14 @@ + + + + + Set RFQs as Done + + code + model.set_rfq_done() + + 1 + days + -1 + + diff --git a/vendor_portal_odoo/data/rfq_mail_templates.xml b/vendor_portal_odoo/data/rfq_mail_templates.xml new file mode 100644 index 000000000..ed31bd079 --- /dev/null +++ b/vendor_portal_odoo/data/rfq_mail_templates.xml @@ -0,0 +1,77 @@ + + + + + + Purchase Order: Send RFQ + + RFQ Request + {{ ctx.get('partner_to') }} + +
+

+ Dear, +
+
+ We would like to request a quotation for the Product + + of + + + Quantity from you. +
+
+ If you are interested, please check and let us know the quote +
+
+ Best regards, +
+ +

+
+
+ {{ ctx.get('lang') }} + +
+ + + Purchase Order: Quote Accepted + + Quote Accepted + {{ ctx.get('partner_to') }} + +
+

+ Dear, +
+
+ We want to let you know that we accept your quoted price of + + for the + + within your specified delivery date + + from you. +
+
+ We'd like to buy + + units of + + from you by the estimated date. +
+ We will send you a purchase order as soon as possible. +
+
+ Best regards, +
+ +

+
+
+ {{ ctx.get('lang') }} + +
+
+
\ No newline at end of file diff --git a/vendor_portal_odoo/data/rfq_sequence.xml b/vendor_portal_odoo/data/rfq_sequence.xml new file mode 100644 index 000000000..56f40e905 --- /dev/null +++ b/vendor_portal_odoo/data/rfq_sequence.xml @@ -0,0 +1,13 @@ + + + + + + RFQ Sequence + vendor.rfq + RFQ + 5 + + + + \ No newline at end of file diff --git a/vendor_portal_odoo/doc/RELEASE_NOTES.md b/vendor_portal_odoo/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..6dc75e58c --- /dev/null +++ b/vendor_portal_odoo/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 24.04.2023 +#### Version 16.0.1.0.0 +##### ADD +- Initial commit for Odoo Vendor Portal + diff --git a/vendor_portal_odoo/models/__init__.py b/vendor_portal_odoo/models/__init__.py new file mode 100644 index 000000000..6287b7431 --- /dev/null +++ b/vendor_portal_odoo/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Athul k () +# +# 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 res_config_settings +from . import res_partner +from . import vendor_rfq diff --git a/vendor_portal_odoo/models/res_config_settings.py b/vendor_portal_odoo/models/res_config_settings.py new file mode 100644 index 000000000..96f1a01a0 --- /dev/null +++ b/vendor_portal_odoo/models/res_config_settings.py @@ -0,0 +1,73 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Athul k () +# +# 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 ResConfigSettings(models.TransientModel): + """Class used to add field to res.config.settings""" + _inherit = 'res.config.settings' + + rfq_done_based_on = fields.Selection([ + ('based_on_price', 'Minimum Quoted Price'), + ('based_on_delivery_time', 'Minimum Delivery time') + ], string="Set RFQs Based on", default='based_on_price') + quote_submission_msg = fields.Text("Quote Submission", + help="Status message to display if a quote was submitted") + quote_accept_msg = fields.Text("Quote Acceptance", + help="Status message to display if a quote was accepted") + quote_not_accept_msg = fields.Text("Quote not Accepted", + help="Status message to display if a quote was not accepted" + ) + quote_cancel_msg = fields.Text("Quote Cancelled", + help="Status message to display if a quote was cancelled") + quote_to_po_msg = fields.Text("PO created for the RFQ", + help="Status message to display if a quote was converted to PO") + + def set_values(self): + """Setting field values""" + res = super(ResConfigSettings, self).set_values() + config_parm = self.env['ir.config_parameter'].sudo() + config_parm.set_param( + 'vendor_portal_odoo.rfq_done_based_on', self.rfq_done_based_on) + config_parm.set_param( + 'vendor_portal_odoo.quote_submission_msg', self.quote_submission_msg) + config_parm.set_param( + 'vendor_portal_odoo.quote_accept_msg', self.quote_accept_msg) + config_parm.set_param( + 'vendor_portal_odoo.quote_not_accept_msg', self.quote_not_accept_msg) + config_parm.set_param( + 'vendor_portal_odoo.quote_cancel_msg', self.quote_cancel_msg) + config_parm.set_param( + 'vendor_portal_odoo.quote_to_po_msg', self.quote_to_po_msg) + return res + + def get_values(self): + """Getting field values""" + res = super(ResConfigSettings, self).get_values() + config_parm = self.env['ir.config_parameter'].sudo() + res['rfq_done_based_on'] = config_parm.get_param('vendor_portal_odoo.rfq_done_based_on') + res['quote_submission_msg'] = config_parm.get_param('vendor_portal_odoo.quote_submission_msg') + res['quote_accept_msg'] = config_parm.get_param('vendor_portal_odoo.quote_accept_msg') + res['quote_not_accept_msg'] = config_parm.get_param('vendor_portal_odoo.quote_not_accept_msg') + res['quote_cancel_msg'] = config_parm.get_param('vendor_portal_odoo.quote_cancel_msg') + res['quote_to_po_msg'] = config_parm.get_param('vendor_portal_odoo.quote_to_po_msg') + return res diff --git a/vendor_portal_odoo/models/res_partner.py b/vendor_portal_odoo/models/res_partner.py new file mode 100644 index 000000000..15565f001 --- /dev/null +++ b/vendor_portal_odoo/models/res_partner.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Athul k () +# +# 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): + """Class used to add field to res.partner for differentiate registered vendors""" + _inherit = 'res.partner' + + is_registered = fields.Boolean("Is Registered Vendor", default=False, + help="To denote the is the partner is " + "registered as vendor") diff --git a/vendor_portal_odoo/models/vendor_rfq.py b/vendor_portal_odoo/models/vendor_rfq.py new file mode 100644 index 000000000..0552e0af4 --- /dev/null +++ b/vendor_portal_odoo/models/vendor_rfq.py @@ -0,0 +1,188 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Athul k () +# +# 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 VendorRFQ(models.Model): + """Vendor RFQ model""" + _name = 'vendor.rfq' + _inherit = ['mail.thread', 'mail.activity.mixin'] + _description = 'Vendor RFQ' + + name = fields.Char('RFQ Reference', required=True, index=True, + copy=False, default=lambda x: _('New')) + product_id = fields.Many2one('product.product', string='Product') + quantity = fields.Float("Quantity") + uom_id = fields.Many2one('uom.uom', string='UoM') + estimated_quote = fields.Monetary("Estimated Quote", currency_field='currency_id', + help="Estimated Quote Price") + currency_id = fields.Many2one('res.currency', string='Currency', + required=True, + default=lambda + self: self.env.user.company_id.currency_id) + notes = fields.Html('Notes') + estimated_delivery_date = fields.Date(string="Delivery date", help="Vendor's delivery date") + quote_date = fields.Datetime(default=fields.Datetime.now(), readonly=1) + closing_date = fields.Date(string="Closing date", help="Quotation closing date") + vendor_ids = fields.Many2many('res.partner', + domain="[('is_registered', '=', True)]", help="Vendors you want to send quotations") + vendor_quote_history_ids = fields.One2many('vendor.quote.history', + 'quote_id') + user_id = fields.Many2one('res.users', default=lambda self: self.env.user, + string="Responsible") + approved_vendor_id = fields.Many2one('res.partner') + order_id = fields.Many2one('purchase.order') + state = fields.Selection([ + ('draft', 'Draft'), + ('pending', 'Pending'), + ('in_progress', 'In Progress'), + ('done', 'Done'), + ('cancel', 'Cancelled'), ('order', 'Purchase Order'), + ], string="Status", default='draft') + company_id = fields.Many2one( + 'res.company', 'Company', + default=lambda self: self.env.company, + ) + + @api.model + def create(self, vals): + """Create function""" + if vals.get('name', 'New') == 'New': + vals['name'] = self.env['ir.sequence'].next_by_code( + 'vendor.rfq') or '/' + res = super(VendorRFQ, self).create(vals) + return res + + def action_send_by_mail(self): + """For sending email to vendors""" + template = self.env.ref( + 'vendor_portal_odoo.email_template_vendor_rfq_request').id + for vendor in self.vendor_ids: + context = { + 'name': vendor.name, + 'lang': vendor.lang, + } + email_values = { + 'email_to': vendor.email, + 'email_from': self.env.user.partner_id.email, + } + self.env['mail.template'].browse(template).with_context( + context).send_mail(self.id, email_values=email_values, + force_send=True) + self.state = 'in_progress' + + def action_pending(self): + """For changing state to pending""" + self.state = 'pending' + + def action_cancel(self): + """For changing state to cancel""" + self.state = 'cancel' + + def action_done(self): + """For mark as done""" + return { + 'type': 'ir.actions.act_window', + 'view_mode': 'form', + 'res_model': 'rfq.done', + 'target': 'new', + 'views': [[False, 'form']], + } + + def action_create_quotation(self): + """For creating purchase RFQ from vendor quotations""" + rfq_quote = self.env['vendor.quote.history'].search([ + ('vendor_id', '=', self.approved_vendor_id.id), + ('quote_id', '=', self.id)]) + price = rfq_quote.quoted_price + order = self.env['purchase.order'].sudo().create({ + 'partner_id': self.approved_vendor_id.id, + 'order_line': [ + (0, 0, { + 'name': self.product_id.name, + 'product_id': self.product_id.id, + 'product_qty': self.quantity, + 'product_uom': self.product_id.uom_po_id.id, + 'price_unit': price, + 'date_planned': rfq_quote.estimate_date, + 'taxes_id': [(6, 0, self.product_id.supplier_taxes_id.ids)], + })], + }) + self.write({ + 'state': 'order', + 'order_id': order.id + }) + return { + 'type': 'ir.actions.act_window', + 'res_model': 'purchase.order', + 'res_id': order.id, + 'target': 'current', + 'views': [(False, 'form')], + } + + def set_rfq_done(self): + """Set the RFQ as done""" + quotes = self.search([('state', '=', 'in_progress'), + ('vendor_quote_history_ids', + '!=', False), + ('closing_date', '=', + fields.Date.today())]) + if quotes: + rfq_done_based_on = self.env['ir.config_parameter'].get_param( + 'vendor_portal_odoo.rfq_done_based_on') + for rec in quotes: + order = 'quoted_price asc' if rfq_done_based_on == 'based_on_price' else 'estimate_date asc' + vendor_quotes = rec.vendor_quote_history_ids.search([], + limit=1, + order=order) + rec.write({ + 'approved_vendor_id': vendor_quotes.vendor_id.id, + 'state': 'done' + }) + + def get_purchase_order(self): + """Purchase Order""" + return { + 'type': 'ir.actions.act_window', + 'res_model': 'purchase.order', + 'res_id': self.order_id.id, + 'target': 'current', + 'views': [(False, 'form')], + } + + +class VendorQuoteHistory(models.Model): + """Vendor Quotation History""" + _name = 'vendor.quote.history' + _description = "Vendor Quotation History" + _rec_name = 'vendor_id' + + vendor_id = fields.Many2one('res.partner', + domain="[('is_registered', '=', True)]", string="Vendor") + quoted_price = fields.Monetary(currency_field='currency_id') + currency_id = fields.Many2one('res.currency', string='Currency', + required=True, + default=lambda + self: self.env.user.company_id.currency_id) + estimate_date = fields.Date("Estimate date") + note = fields.Text("Note") + quote_id = fields.Many2one('vendor.rfq') diff --git a/vendor_portal_odoo/security/ir.model.access.csv b/vendor_portal_odoo/security/ir.model.access.csv new file mode 100644 index 000000000..413ac0f99 --- /dev/null +++ b/vendor_portal_odoo/security/ir.model.access.csv @@ -0,0 +1,5 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_register_vendor_wizard,access.register.vendor.wizard,model_register_vendor,base.group_user,1,1,1,1 +access_vendor_rfq,access.vendor.rfq,model_vendor_rfq,base.group_user,1,1,1,1 +access_vendor_quote_history,access.vendor.quote.history,model_vendor_quote_history,base.group_user,1,1,1,1 +access_vendor_rfq_quote_done,access.rfq.done,model_rfq_done,base.group_user,1,1,1,1 \ No newline at end of file diff --git a/vendor_portal_odoo/security/portal_security.xml b/vendor_portal_odoo/security/portal_security.xml new file mode 100644 index 000000000..9773a477d --- /dev/null +++ b/vendor_portal_odoo/security/portal_security.xml @@ -0,0 +1,9 @@ + + + + + Vendor Quotation multi company rule + + ['|', ('company_id', '=', False), ('company_id', 'in', company_ids)] + + \ No newline at end of file diff --git a/vendor_portal_odoo/static/description/assets/icons/check.png b/vendor_portal_odoo/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/icons/check.png differ diff --git a/vendor_portal_odoo/static/description/assets/icons/chevron.png b/vendor_portal_odoo/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/icons/chevron.png differ diff --git a/vendor_portal_odoo/static/description/assets/icons/cogs.png b/vendor_portal_odoo/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/icons/cogs.png differ diff --git a/vendor_portal_odoo/static/description/assets/icons/consultation.png b/vendor_portal_odoo/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/icons/consultation.png differ diff --git a/vendor_portal_odoo/static/description/assets/icons/ecom-black.png b/vendor_portal_odoo/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/icons/ecom-black.png differ diff --git a/vendor_portal_odoo/static/description/assets/icons/education-black.png b/vendor_portal_odoo/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/icons/education-black.png differ diff --git a/vendor_portal_odoo/static/description/assets/icons/hotel-black.png b/vendor_portal_odoo/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/icons/hotel-black.png differ diff --git a/vendor_portal_odoo/static/description/assets/icons/license.png b/vendor_portal_odoo/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/icons/license.png differ diff --git a/vendor_portal_odoo/static/description/assets/icons/lifebuoy.png b/vendor_portal_odoo/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/icons/lifebuoy.png differ diff --git a/vendor_portal_odoo/static/description/assets/icons/manufacturing-black.png b/vendor_portal_odoo/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/icons/manufacturing-black.png differ diff --git a/vendor_portal_odoo/static/description/assets/icons/pos-black.png b/vendor_portal_odoo/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/icons/pos-black.png differ diff --git a/vendor_portal_odoo/static/description/assets/icons/puzzle.png b/vendor_portal_odoo/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/icons/puzzle.png differ diff --git a/vendor_portal_odoo/static/description/assets/icons/restaurant-black.png b/vendor_portal_odoo/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/icons/restaurant-black.png differ diff --git a/vendor_portal_odoo/static/description/assets/icons/service-black.png b/vendor_portal_odoo/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/icons/service-black.png differ diff --git a/vendor_portal_odoo/static/description/assets/icons/trading-black.png b/vendor_portal_odoo/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/icons/trading-black.png differ diff --git a/vendor_portal_odoo/static/description/assets/icons/training.png b/vendor_portal_odoo/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/icons/training.png differ diff --git a/vendor_portal_odoo/static/description/assets/icons/update.png b/vendor_portal_odoo/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/icons/update.png differ diff --git a/vendor_portal_odoo/static/description/assets/icons/user.png b/vendor_portal_odoo/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/icons/user.png differ diff --git a/vendor_portal_odoo/static/description/assets/icons/wrench.png b/vendor_portal_odoo/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/icons/wrench.png differ diff --git a/vendor_portal_odoo/static/description/assets/misc/categories.png b/vendor_portal_odoo/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/misc/categories.png differ diff --git a/vendor_portal_odoo/static/description/assets/misc/check-box.png b/vendor_portal_odoo/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/misc/check-box.png differ diff --git a/vendor_portal_odoo/static/description/assets/misc/compass.png b/vendor_portal_odoo/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/misc/compass.png differ diff --git a/vendor_portal_odoo/static/description/assets/misc/corporate.png b/vendor_portal_odoo/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/misc/corporate.png differ diff --git a/vendor_portal_odoo/static/description/assets/misc/customer-support.png b/vendor_portal_odoo/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/misc/customer-support.png differ diff --git a/vendor_portal_odoo/static/description/assets/misc/cybrosys-logo.png b/vendor_portal_odoo/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/misc/cybrosys-logo.png differ diff --git a/vendor_portal_odoo/static/description/assets/misc/features.png b/vendor_portal_odoo/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/misc/features.png differ diff --git a/vendor_portal_odoo/static/description/assets/misc/logo.png b/vendor_portal_odoo/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/misc/logo.png differ diff --git a/vendor_portal_odoo/static/description/assets/misc/pictures.png b/vendor_portal_odoo/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/misc/pictures.png differ diff --git a/vendor_portal_odoo/static/description/assets/misc/pie-chart.png b/vendor_portal_odoo/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/misc/pie-chart.png differ diff --git a/vendor_portal_odoo/static/description/assets/misc/right-arrow.png b/vendor_portal_odoo/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/misc/right-arrow.png differ diff --git a/vendor_portal_odoo/static/description/assets/misc/star.png b/vendor_portal_odoo/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/misc/star.png differ diff --git a/vendor_portal_odoo/static/description/assets/misc/support.png b/vendor_portal_odoo/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/misc/support.png differ diff --git a/vendor_portal_odoo/static/description/assets/misc/whatsapp.png b/vendor_portal_odoo/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/misc/whatsapp.png differ diff --git a/vendor_portal_odoo/static/description/assets/modules/1.png b/vendor_portal_odoo/static/description/assets/modules/1.png new file mode 100644 index 000000000..489f44e86 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/modules/1.png differ diff --git a/vendor_portal_odoo/static/description/assets/modules/2.png b/vendor_portal_odoo/static/description/assets/modules/2.png new file mode 100644 index 000000000..4f9e87f6e Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/modules/2.png differ diff --git a/vendor_portal_odoo/static/description/assets/modules/3.png b/vendor_portal_odoo/static/description/assets/modules/3.png new file mode 100644 index 000000000..e571015b1 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/modules/3.png differ diff --git a/vendor_portal_odoo/static/description/assets/modules/4.png b/vendor_portal_odoo/static/description/assets/modules/4.png new file mode 100644 index 000000000..624ef69b7 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/modules/4.png differ diff --git a/vendor_portal_odoo/static/description/assets/modules/5.gif b/vendor_portal_odoo/static/description/assets/modules/5.gif new file mode 100644 index 000000000..8f40aab85 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/modules/5.gif differ diff --git a/vendor_portal_odoo/static/description/assets/modules/6.png b/vendor_portal_odoo/static/description/assets/modules/6.png new file mode 100644 index 000000000..31ed46762 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/modules/6.png differ diff --git a/vendor_portal_odoo/static/description/assets/screenshots/hero.gif b/vendor_portal_odoo/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..d891e030b Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/screenshots/hero.gif differ diff --git a/vendor_portal_odoo/static/description/assets/screenshots/pv.png b/vendor_portal_odoo/static/description/assets/screenshots/pv.png new file mode 100644 index 000000000..abe31c52e Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/screenshots/pv.png differ diff --git a/vendor_portal_odoo/static/description/assets/screenshots/pv0.png b/vendor_portal_odoo/static/description/assets/screenshots/pv0.png new file mode 100644 index 000000000..af6b4edab Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/screenshots/pv0.png differ diff --git a/vendor_portal_odoo/static/description/assets/screenshots/pv1.png b/vendor_portal_odoo/static/description/assets/screenshots/pv1.png new file mode 100644 index 000000000..0a25521c7 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/screenshots/pv1.png differ diff --git a/vendor_portal_odoo/static/description/assets/screenshots/pv10.png b/vendor_portal_odoo/static/description/assets/screenshots/pv10.png new file mode 100644 index 000000000..116516e8a Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/screenshots/pv10.png differ diff --git a/vendor_portal_odoo/static/description/assets/screenshots/pv11.png b/vendor_portal_odoo/static/description/assets/screenshots/pv11.png new file mode 100644 index 000000000..8a4284901 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/screenshots/pv11.png differ diff --git a/vendor_portal_odoo/static/description/assets/screenshots/pv2.png b/vendor_portal_odoo/static/description/assets/screenshots/pv2.png new file mode 100644 index 000000000..41ca2da2e Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/screenshots/pv2.png differ diff --git a/vendor_portal_odoo/static/description/assets/screenshots/pv3.png b/vendor_portal_odoo/static/description/assets/screenshots/pv3.png new file mode 100644 index 000000000..13af33dc5 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/screenshots/pv3.png differ diff --git a/vendor_portal_odoo/static/description/assets/screenshots/pv4.png b/vendor_portal_odoo/static/description/assets/screenshots/pv4.png new file mode 100644 index 000000000..0d4bde4cd Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/screenshots/pv4.png differ diff --git a/vendor_portal_odoo/static/description/assets/screenshots/pv5.png b/vendor_portal_odoo/static/description/assets/screenshots/pv5.png new file mode 100644 index 000000000..c3b97909d Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/screenshots/pv5.png differ diff --git a/vendor_portal_odoo/static/description/assets/screenshots/pv6.png b/vendor_portal_odoo/static/description/assets/screenshots/pv6.png new file mode 100644 index 000000000..f111c5575 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/screenshots/pv6.png differ diff --git a/vendor_portal_odoo/static/description/assets/screenshots/pv7.png b/vendor_portal_odoo/static/description/assets/screenshots/pv7.png new file mode 100644 index 000000000..42746687d Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/screenshots/pv7.png differ diff --git a/vendor_portal_odoo/static/description/assets/screenshots/pv8.png b/vendor_portal_odoo/static/description/assets/screenshots/pv8.png new file mode 100644 index 000000000..bc941ee9d Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/screenshots/pv8.png differ diff --git a/vendor_portal_odoo/static/description/assets/screenshots/pv9.png b/vendor_portal_odoo/static/description/assets/screenshots/pv9.png new file mode 100644 index 000000000..0e7bae9b2 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/screenshots/pv9.png differ diff --git a/vendor_portal_odoo/static/description/banner.png b/vendor_portal_odoo/static/description/banner.png new file mode 100644 index 000000000..b80a7a99b Binary files /dev/null and b/vendor_portal_odoo/static/description/banner.png differ diff --git a/vendor_portal_odoo/static/description/icon.png b/vendor_portal_odoo/static/description/icon.png new file mode 100644 index 000000000..2969d4b70 Binary files /dev/null and b/vendor_portal_odoo/static/description/icon.png differ diff --git a/vendor_portal_odoo/static/description/index.html b/vendor_portal_odoo/static/description/index.html new file mode 100644 index 000000000..e37c1b70b --- /dev/null +++ b/vendor_portal_odoo/static/description/index.html @@ -0,0 +1,626 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+
+ +
+
+
+ +

+ Odoo Vendor Portal +

+

Vendor Portal + Management in Odoo16

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

Explore This + Module

+
+ + + + +
+
+ +
+

Overview +

+
+
+
+ This module helps to simplify the purchase and vendor management in Odoo. +
+
+ + + +
+
+ +
+

Features +

+
+
+
+
+ + Simplified Odoo Vendor Management +
+
+ + Create individual portals for your suppliers on the Odoo website +
+
+ + Utilize Odoo to Manage & Track Your Vendors +
+
+
+
+ + Mail notification to Vendor +
+ +
+ + Approve the RFQ automatically based on the configuration +
+ +
+
+ + + +
+
+ +
+

Screenshots +

+
+
+
+ +
+

Register Vendors to + access the portal +

+ +
+ +
+

Send the vendor + portal invitation link to invite the desired vendors to the portal +

+ +
+ +
+

List of registered + vendors +

+ +
+ +
+

Configuration for + Vendor Portal +

+

Set the Conditions to + automatically set the RFQs as completed +

+

Set the status messages + that customers see in the vendor portal +

+ +
+ +
+

Create RFQ with + necessary details +

+ +
+ +
+

Send RFQ's to the + Selected Vendors +

+ +
+ +
+

From the vendor + portal website, vendors can submit their quotes to the admin +

+ +
+ +
+

When the + administrator updates the backend, the vendor can check the status of his quote +

+ +
+ +
+

Admins are able to + see the submitted Quotes +

+ +
+
+

Admins are able to + mark the RFQ as done +

+ +
+
+

Vendor will receive + an email when his quote has been accepted +

+ +
+
+

Portal RFQ Status of + accepted quotes +

+ +
+
+

Portal RFQ Status of + rejected quotes +

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

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/vendor_portal_odoo/views/portal_menus.xml b/vendor_portal_odoo/views/portal_menus.xml new file mode 100644 index 000000000..c1b5e3e42 --- /dev/null +++ b/vendor_portal_odoo/views/portal_menus.xml @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/vendor_portal_odoo/views/portal_rfq_templates.xml b/vendor_portal_odoo/views/portal_rfq_templates.xml new file mode 100644 index 000000000..6495a95c3 --- /dev/null +++ b/vendor_portal_odoo/views/portal_rfq_templates.xml @@ -0,0 +1,318 @@ + + + + + + +