diff --git a/vendor_portal_odoo/README.rst b/vendor_portal_odoo/README.rst new file mode 100644 index 000000000..d455a9193 --- /dev/null +++ b/vendor_portal_odoo/README.rst @@ -0,0 +1,43 @@ +.. 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 +================== +Vendor Portal in Odoo + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developers: Noorjahan @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..28887cf44 --- /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: Noorjahan N A () +# +# 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 models +from . import wizard +from . import controllers diff --git a/vendor_portal_odoo/__manifest__.py b/vendor_portal_odoo/__manifest__.py new file mode 100644 index 000000000..dcecd2c10 --- /dev/null +++ b/vendor_portal_odoo/__manifest__.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Noorjahan N A () +# +# 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': '15.0.1.0.0', + 'category': 'Purchase', + 'summary': """Vendor Portal Management in Odoo""", + 'description': """Vendor Portal Management in Odoo""", + 'author': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'depends': ['website', 'purchase', 'portal'], + 'data': [ + 'security/ir.model.access.csv', + 'wizard/wizard.xml', + 'wizard/mark_done.xml', + 'data/rfq_sequence.xml', + 'data/rfq_mail_template.xml', + 'data/rfq_cron.xml', + 'views/vendor.xml', + 'views/vendor_rfq.xml', + 'views/res_config_settings.xml', + 'views/portal_rfq.xml', + 'views/menu.xml', + ], + 'images': ['static/description/banner.png'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': True, +} diff --git a/vendor_portal_odoo/controllers/__init__.py b/vendor_portal_odoo/controllers/__init__.py new file mode 100644 index 000000000..cdc9ae3b5 --- /dev/null +++ b/vendor_portal_odoo/controllers/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Noorjahan N A () +# +# 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 main + diff --git a/vendor_portal_odoo/controllers/main.py b/vendor_portal_odoo/controllers/main.py new file mode 100644 index 000000000..2f8ae8a46 --- /dev/null +++ b/vendor_portal_odoo/controllers/main.py @@ -0,0 +1,141 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Noorjahan N A () +# +# 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): + """RFQ's in home portal""" + user = request.env.user.partner_id + values = super()._prepare_home_portal_values(counters) + if 'my_rfq_count' in counters: + values['my_rfq_count'] = request.env[ + 'rfq.vendor'].search_count( + [('vendor_ids', 'in', user.ids)]) if request.env[ + 'rfq.vendor'].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 RFQ's""" + values = self._prepare_portal_layout_values() + user = request.env.user.partner_id + VendorRFQ = request.env['rfq.vendor'].search([]) + domain = [ + ('vendor_ids', 'in', user.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 = VendorRFQ.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 = VendorRFQ.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['rfq.vendor'].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['rfq.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..d6ea85307 --- /dev/null +++ b/vendor_portal_odoo/data/rfq_cron.xml @@ -0,0 +1,13 @@ + + + + Set RFQ's as Done + + code + model.set_rfq_done() + + 1 + days + -1 + + diff --git a/vendor_portal_odoo/data/rfq_mail_template.xml b/vendor_portal_odoo/data/rfq_mail_template.xml new file mode 100644 index 000000000..55b651704 --- /dev/null +++ b/vendor_portal_odoo/data/rfq_mail_template.xml @@ -0,0 +1,63 @@ + + + + + Purchase Order: Send RFQ + + RFQ Request + {{ ctx.get('partner_to') }} + +
+

+ Dear , +

+ We would like to request a quotation for the Product + of + + from you. +

+ If you are interested, please check below link 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..cbf8e0175 --- /dev/null +++ b/vendor_portal_odoo/data/rfq_sequence.xml @@ -0,0 +1,12 @@ + + + + + RFQ Sequence + rfq.vendor + 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..667a4bb82 --- /dev/null +++ b/vendor_portal_odoo/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 12.01.2023 +#### Version 15.0.1.0.0 +##### ADD +- Initial commit for Vendor Portal Odoo + diff --git a/vendor_portal_odoo/models/__init__.py b/vendor_portal_odoo/models/__init__.py new file mode 100644 index 000000000..8be382ccb --- /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: Noorjahan N A () +# +# 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_partner +from . import res_config_settings +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..7d7c2c770 --- /dev/null +++ b/vendor_portal_odoo/models/res_config_settings.py @@ -0,0 +1,84 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Noorjahan N A () +# +# 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 models, fields + + +class ResConfigSettings(models.TransientModel): + _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( + help="Status message to display if a quote was submitted") + quote_accept_msg = fields.Text( + help="Status message to display if a quote was accepted") + quote_not_accept_msg = fields.Text( + help="Status message to display if a quote was not accepted" + ) + quote_cancel_msg = fields.Text( + help="Status message to display if a quote was cancelled") + quote_to_po_msg = fields.Text( + help="Status message to display if a quote was converted to PO") + + def set_values(self): + """vendor rfq's setting field values""" + res = super(ResConfigSettings, self).set_values() + self.env['ir.config_parameter'].set_param( + 'vendor_portal_odoo.rfq_done_based_on', self.rfq_done_based_on) + self.env['ir.config_parameter'].set_param( + 'vendor_portal_odoo.quote_submission_msg', + self.quote_submission_msg) + self.env['ir.config_parameter'].set_param( + 'vendor_portal_odoo.quote_accept_msg', self.quote_accept_msg) + self.env['ir.config_parameter'].set_param( + 'vendor_portal_odoo.quote_not_accept_msg', + self.quote_not_accept_msg) + self.env['ir.config_parameter'].set_param( + 'vendor_portal_odoo.quote_cancel_msg', self.quote_cancel_msg) + self.env['ir.config_parameter'].set_param( + 'vendor_portal_odoo.quote_to_po_msg', self.quote_to_po_msg) + return res + + def get_values(self): + """vendor rfq's getting field values""" + res = super(ResConfigSettings, self).get_values() + res['rfq_done_based_on'] = self.env[ + 'ir.config_parameter'].sudo().get_param( + 'vendor_portal_odoo.rfq_done_based_on') + res['quote_submission_msg'] = self.env[ + 'ir.config_parameter'].sudo().get_param( + 'vendor_portal_odoo.quote_submission_msg') + res['quote_accept_msg'] = self.env[ + 'ir.config_parameter'].sudo().get_param( + 'vendor_portal_odoo.quote_accept_msg') + res['quote_not_accept_msg'] = self.env[ + 'ir.config_parameter'].sudo().get_param( + 'vendor_portal_odoo.quote_not_accept_msg') + res['quote_cancel_msg'] = self.env[ + 'ir.config_parameter'].sudo().get_param( + 'vendor_portal_odoo.quote_cancel_msg') + res['quote_to_po_msg'] = self.env[ + 'ir.config_parameter'].sudo().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..a09ffc5a3 --- /dev/null +++ b/vendor_portal_odoo/models/res_partner.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Noorjahan N A () +# +# 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 models, fields + + +class ResPartner(models.Model): + _inherit = 'res.partner' + + is_registered = fields.Boolean(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..d9ff8c418 --- /dev/null +++ b/vendor_portal_odoo/models/vendor_rfq.py @@ -0,0 +1,186 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2023-TODAY Cybrosys Technologies() +# Author: Noorjahan N A () +# +# 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 models, api, fields + + +class VendorRFQ(models.Model): + _name = 'rfq.vendor' + _inherit = ['mail.thread', 'mail.activity.mixin'] + _description = 'Vendor RFQ' + + name = fields.Char('RFQ Reference', required=True, index=True, + copy=False, default='New') + product_id = fields.Many2one('product.product') + quantity = fields.Float() + unit_id = fields.Many2one('uom.uom') + currency_id = fields.Many2one('res.currency') + estimated_quote = fields.Monetary(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() + quote_date = fields.Datetime(default=fields.Datetime.now(), readonly=1) + closing_date = fields.Date() + pricelist_id = fields.Many2one('product.pricelist') + sales_price = fields.Monetary() + cost_price = fields.Monetary() + vendor_ids = fields.Many2many('res.partner', + domain="[('is_registered', '=', True)]") + vendor_quote_history_ids = fields.One2many('rfq.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') + + @api.model + def create(self, vals): + """Create function""" + if vals.get('name', 'New') == 'New': + vals['name'] = self.env['ir.sequence'].next_by_code( + 'rfq.vendor') or '/' + res = super(VendorRFQ, self).create(vals) + return res + + def send_by_mail(self): + """Send By email""" + template_id = 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_id).with_context( + context).send_mail(self.id, email_values=email_values, + force_send=True) + self.state = 'in_progress' + + def action_pending(self): + """Action pending""" + self.state = 'pending' + + def action_cancel(self): + """Action cancel""" + self.state = 'cancel' + + def mark_as_done(self): + """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): + """Create quotation""" + rfq_quote = self.env['rfq.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's as done""" + quotes = self.env['rfq.vendor'].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): + _name = 'rfq.vendor.quote_history' + _rec_name = 'vendor_id' + + vendor_id = fields.Many2one('res.partner', + domain="[('is_registered', '=', True)]") + 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() + note = fields.Text() + quote_id = fields.Many2one('rfq.vendor') + 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..8b46e65bb --- /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_wizrad","register.vendor wizard","model_register_vendor","",1,1,1,1 +"access_vendor_rfq","register.vendor rfq","model_rfq_vendor","",1,1,1,1 +"access_vendor_rfq_quote_history","register.vendor rfq quote history","model_rfq_vendor_quote_history","",1,1,1,1 +"access_vendor_rfq_quote_done","rfq.done","model_rfq_done","",1,1,1,1 \ 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/logo.png b/vendor_portal_odoo/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/icons/logo.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/modules/approval_image.png b/vendor_portal_odoo/static/description/assets/modules/approval_image.png new file mode 100644 index 000000000..84fe94e80 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/modules/approval_image.png differ diff --git a/vendor_portal_odoo/static/description/assets/modules/budget_image.png b/vendor_portal_odoo/static/description/assets/modules/budget_image.png new file mode 100644 index 000000000..fe6aa6fe4 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/modules/budget_image.png differ diff --git a/vendor_portal_odoo/static/description/assets/modules/export_image.png b/vendor_portal_odoo/static/description/assets/modules/export_image.png new file mode 100644 index 000000000..4e4ea0e51 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/modules/export_image.png differ diff --git a/vendor_portal_odoo/static/description/assets/modules/magento_image.png b/vendor_portal_odoo/static/description/assets/modules/magento_image.png new file mode 100644 index 000000000..39de0820f Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/modules/magento_image.png differ diff --git a/vendor_portal_odoo/static/description/assets/modules/pos_image.png b/vendor_portal_odoo/static/description/assets/modules/pos_image.png new file mode 100644 index 000000000..c5932894b Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/modules/pos_image.png differ diff --git a/vendor_portal_odoo/static/description/assets/modules/shopify_image.png b/vendor_portal_odoo/static/description/assets/modules/shopify_image.png new file mode 100644 index 000000000..c6d92c16d Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/modules/shopify_image.png differ diff --git a/vendor_portal_odoo/static/description/assets/screenshots/hero.png b/vendor_portal_odoo/static/description/assets/screenshots/hero.png new file mode 100644 index 000000000..1985702ca Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/screenshots/hero.png differ diff --git a/vendor_portal_odoo/static/description/assets/screenshots/vendor_1.png b/vendor_portal_odoo/static/description/assets/screenshots/vendor_1.png new file mode 100644 index 000000000..36acb8e5e Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/screenshots/vendor_1.png differ diff --git a/vendor_portal_odoo/static/description/assets/screenshots/vendor_10.png b/vendor_portal_odoo/static/description/assets/screenshots/vendor_10.png new file mode 100644 index 000000000..dccc39f2c Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/screenshots/vendor_10.png differ diff --git a/vendor_portal_odoo/static/description/assets/screenshots/vendor_11.png b/vendor_portal_odoo/static/description/assets/screenshots/vendor_11.png new file mode 100644 index 000000000..26b8969ee Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/screenshots/vendor_11.png differ diff --git a/vendor_portal_odoo/static/description/assets/screenshots/vendor_12.png b/vendor_portal_odoo/static/description/assets/screenshots/vendor_12.png new file mode 100644 index 000000000..3103cdf7c Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/screenshots/vendor_12.png differ diff --git a/vendor_portal_odoo/static/description/assets/screenshots/vendor_13.png b/vendor_portal_odoo/static/description/assets/screenshots/vendor_13.png new file mode 100644 index 000000000..e758170f0 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/screenshots/vendor_13.png differ diff --git a/vendor_portal_odoo/static/description/assets/screenshots/vendor_15.png b/vendor_portal_odoo/static/description/assets/screenshots/vendor_15.png new file mode 100644 index 000000000..4238a8678 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/screenshots/vendor_15.png differ diff --git a/vendor_portal_odoo/static/description/assets/screenshots/vendor_2.png b/vendor_portal_odoo/static/description/assets/screenshots/vendor_2.png new file mode 100644 index 000000000..0c93fe4a7 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/screenshots/vendor_2.png differ diff --git a/vendor_portal_odoo/static/description/assets/screenshots/vendor_3.png b/vendor_portal_odoo/static/description/assets/screenshots/vendor_3.png new file mode 100644 index 000000000..aeddc35d5 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/screenshots/vendor_3.png differ diff --git a/vendor_portal_odoo/static/description/assets/screenshots/vendor_4.png b/vendor_portal_odoo/static/description/assets/screenshots/vendor_4.png new file mode 100644 index 000000000..81e8ea328 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/screenshots/vendor_4.png differ diff --git a/vendor_portal_odoo/static/description/assets/screenshots/vendor_5.png b/vendor_portal_odoo/static/description/assets/screenshots/vendor_5.png new file mode 100644 index 000000000..06d88b50d Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/screenshots/vendor_5.png differ diff --git a/vendor_portal_odoo/static/description/assets/screenshots/vendor_6.png b/vendor_portal_odoo/static/description/assets/screenshots/vendor_6.png new file mode 100644 index 000000000..b7a9264e6 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/screenshots/vendor_6.png differ diff --git a/vendor_portal_odoo/static/description/assets/screenshots/vendor_7.png b/vendor_portal_odoo/static/description/assets/screenshots/vendor_7.png new file mode 100644 index 000000000..1e8f4b6a1 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/screenshots/vendor_7.png differ diff --git a/vendor_portal_odoo/static/description/assets/screenshots/vendor_8.png b/vendor_portal_odoo/static/description/assets/screenshots/vendor_8.png new file mode 100644 index 000000000..c44218449 Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/screenshots/vendor_8.png differ diff --git a/vendor_portal_odoo/static/description/assets/screenshots/vendor_9.png b/vendor_portal_odoo/static/description/assets/screenshots/vendor_9.png new file mode 100644 index 000000000..5f94b52ec Binary files /dev/null and b/vendor_portal_odoo/static/description/assets/screenshots/vendor_9.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..b1cb1b5d1 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..2bec17c20 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..22831c600 --- /dev/null +++ b/vendor_portal_odoo/static/description/index.html @@ -0,0 +1,711 @@ +
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+ +
+
+
+
+ +
+
+
+

+ Odoo Vendor Portal

+

+ Vendor Portal Management in Odoo15 +

+ +
+
+ + + + +
+
+

+ Overview +

+
+ +
+

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

+ +
+
+ + +
+
+

+ Features +

+
+ +
+
+ +
+
+

+ Community & Enterprise Support

+

+ Available in Odoo 15.0 Community and Enterprise.

+
+
+
+
+ +
+
+

+ 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

+ + +
+ + +
+ + +
+
+

Suggested 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

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

Need Help?

+
+
+
+ + +
+ +
+ +
+ +
+ WhatsApp +
+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + +
\ No newline at end of file diff --git a/vendor_portal_odoo/views/menu.xml b/vendor_portal_odoo/views/menu.xml new file mode 100644 index 000000000..16a3aa184 --- /dev/null +++ b/vendor_portal_odoo/views/menu.xml @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/vendor_portal_odoo/views/portal_rfq.xml b/vendor_portal_odoo/views/portal_rfq.xml new file mode 100644 index 000000000..a46def487 --- /dev/null +++ b/vendor_portal_odoo/views/portal_rfq.xml @@ -0,0 +1,310 @@ + + + + + +