Skip to content

Commit

Permalink
Merge pull request #190 from RamakrishnaVellala/17.0-develop
Browse files Browse the repository at this point in the history
registry changes
  • Loading branch information
shibu-narayanan authored Oct 17, 2024
2 parents baf5df8 + d9e1342 commit 44ce36b
Show file tree
Hide file tree
Showing 67 changed files with 873 additions and 831 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Available addons
----------------
addon | version | maintainers | summary
--- | --- | --- | ---
[g2p_agent_portal_base](g2p_agent_portal_base/) | 17.0.1.4.0 | | G2P Agent Portal: Base
[g2p_auth_id_oidc](g2p_auth_id_oidc/) | 17.0.1.4.0 | | G2P Auth: OIDC - Reg ID
[g2p_auth_oidc](g2p_auth_oidc/) | 17.0.1.4.0 | | OpenID Connect Authentication
[g2p_bank](g2p_bank/) | 17.0.1.4.0 | | G2P Registry: Bank Details
Expand All @@ -39,6 +40,7 @@ addon | version | maintainers | summary
[g2p_openid_vci_rest_api](g2p_openid_vci_rest_api/) | 17.0.1.4.0 | | G2P OpenID VCI: Rest API
[g2p_portal_auth](g2p_portal_auth/) | 17.0.1.4.0 | | G2P Portal Auth
[g2p_profile_image](g2p_profile_image/) | 17.0.1.4.0 | | OpenG2P Profile Image
[g2p_registration_portal_base](g2p_registration_portal_base/) | 17.0.1.4.0 | | G2P Registration Portal :Base
[g2p_registry_addl_info](g2p_registry_addl_info/) | 17.0.1.4.0 | | G2P Registry: Additional Info
[g2p_registry_base](g2p_registry_base/) | 17.0.1.4.0 | | G2P Registry: Base
[g2p_registry_documents](g2p_registry_documents/) | 17.0.1.4.0 | | G2P Registry: Documents
Expand All @@ -47,8 +49,6 @@ addon | version | maintainers | summary
[g2p_registry_individual](g2p_registry_individual/) | 17.0.1.4.0 | | G2P Registry: Individual
[g2p_registry_membership](g2p_registry_membership/) | 17.0.1.4.0 | | G2P Registry: Membership
[g2p_registry_rest_api](g2p_registry_rest_api/) | 17.0.1.4.0 | | G2P Registry: Rest API
[g2p_service_provider_beneficiary_management](g2p_service_provider_beneficiary_management/) | 17.0.1.4.0 | | G2P Service Provider Beneficiary Management
[g2p_service_provider_portal_base](g2p_service_provider_portal_base/) | 17.0.1.4.0 | | G2P Service Provider Portal: Base
[g2p_superset_dashboard](g2p_superset_dashboard/) | 17.0.1.4.0 | | OpenG2P Superset Dashboard
[mts_connector](mts_connector/) | 17.0.1.4.0 | | MTS Connector

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# G2P Service Provider Portal: Base
# G2P Agent Provider Portal: Base

Refer to https://docs.openg2p.org.
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
# Part of OpenG2P. See LICENSE file for full copyright and licensing details.
from . import models
from . import controllers
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "G2P Service Provider Portal: Base",
"name": "G2P Agent Portal: Base",
"category": "OpenG2P",
"version": "17.0.1.4.0",
"sequence": 1,
Expand All @@ -16,7 +16,7 @@
"views/profile.xml",
"views/other.xml",
"views/menu_view.xml",
"views/service_provider_extend_view.xml",
"views/agent_portal_extend_view.xml",
],
"assets": {
"web.assets_frontend": [],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
_logger = logging.getLogger(__name__)


class ServiceProviderBaseContorller(http.Controller):
@http.route(["/serviceprovider"], type="http", auth="public", website=True)
class AgentPortalBase(http.Controller):
@http.route(["/portal"], type="http", auth="public", website=True)
def portal_root(self, **kwargs):
if request.session and request.session.uid:
return request.redirect("/serviceprovider/home")
return request.redirect("/portal/home")
else:
return request.redirect("/serviceprovider/login")
return request.redirect("/portal/login")

@http.route(["/serviceprovider/login"], type="http", auth="public", website=True)
def service_provider_login(self, **kwargs):
redirect_uri = request.params.get("redirect") or "/serviceprovider/home"
@http.route(["/portal/login"], type="http", auth="public", website=True)
def registration_login(self, **kwargs):
redirect_uri = request.params.get("redirect") or "/portal/home"
if request.session and request.session.uid:
return request.redirect(redirect_uri)

Expand All @@ -34,38 +34,38 @@ def service_provider_login(self, **kwargs):
else:
context["error"] = "Invalid Credentials"

return request.render("g2p_service_provider_portal_base.login_page", qcontext=context)
return request.render("g2p_agent_portal_base.login_page", qcontext=context)

@http.route(["/serviceprovider/home"], type="http", auth="user", website=True)
@http.route(["/portal/home"], type="http", auth="user", website=True)
def portal_home(self, **kwargs):
self.check_roles("SERVICEPROVIDER")
return request.render("g2p_service_provider_portal_base.home_page")
self.check_roles("Agent")
return request.render("g2p_agent_portal_base.home_page")

@http.route(["/serviceprovider/myprofile"], type="http", auth="public", website=True)
@http.route(["/portal/myprofile"], type="http", auth="public", website=True)
def portal_profile(self, **kwargs):
if request.session and request.session.uid:
current_partner = request.env.user.partner_id
return request.render(
"g2p_service_provider_portal_base.profile_page",
"g2p_agent_portal_base.profile_page",
{
"current_partner": current_partner,
},
)

@http.route(["/serviceprovider/aboutus"], type="http", auth="public", website=True)
@http.route(["/portal/aboutus"], type="http", auth="public", website=True)
def portal_about_us(self, **kwargs):
return request.render("g2p_service_provider_portal_base.about_us_page")
return request.render("g2p_agent_portal_base.about_us_page")

@http.route(["/serviceprovider/contactus"], type="http", auth="public", website=True)
@http.route(["/portal/contactus"], type="http", auth="public", website=True)
def portal_contact_us(self, **kwargs):
return request.render("g2p_service_provider_portal_base.contact_us_page")
return request.render("g2p_agent_portal_base.contact_us_page")

@http.route(["/serviceprovider/otherpage"], type="http", auth="public", website=True)
@http.route(["/portal/otherpage"], type="http", auth="public", website=True)
def portal_other_page(self, **kwargs):
return request.render("g2p_service_provider_portal_base.other_page")
return request.render("g2p_agent_portal_base.other_page")

def check_roles(self, role_to_check):
if role_to_check == "SERVICEPROVIDER":
if role_to_check == "Agent":
if not request.session or not request.env.user:
raise Unauthorized(_("User is not logged in"))
if not request.env.user.partner_id.supplier_rank > 0:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template id="about_us_page" name="G2P Service Provider About Us">
<t t-call="g2p_service_provider_portal_base.base">
<t t-set="title"> About Us | Service Provider Portal</t>
<template id="about_us_page" name="G2P Registration Portal About Us">
<t t-call="g2p_agent_portal_base.base">
<t t-set="title"> About Us | Registration Portal</t>
<div class="main-container">
<div class="container-adjuster">
<h5 class='all-title'>About Us</h5>
<ol class="breadcrumb breadcrumb-list bg-transparent">
<li class="breadcrumb-item">
<a href="/serviceprovider">Home</a>
<a href="/portal">Home</a>
</li>
<li class="breadcrumb-item active" aria-current="page">About Us</li>
</ol>

<div class="profile-container">
<img src="/g2p_service_provider_portal_base/static/src/img/page_under_construction.png" />
<img src="/g2p_agent_portal_base/static/src/img/page_under_construction.png" />
<div>
<h1>Page Under Construction!</h1>
<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,20 @@
<!-- TODO: Remove all hardcoding -->
<template
id="base"
name="G2P Service Provider Portal Base"
name="G2P Registration Portal Base"
inherit_id="web.frontend_layout"
priority="900"
primary="True"
>

<xpath expr="//header" position="replace">
<link rel="stylesheet" href="/g2p_service_provider_portal_base/static/src/css/portal.css" />
<link rel="stylesheet" href="/g2p_agent_portal_base/static/src/css/portal.css" />
<script src="https://cdn.jsdelivr.net/npm/chart.js" />
<header t-if="not no_header" id="top" data-anchor="true">
<div class="header-container">
<div class="nav">
<a href="/serviceprovider">
<img
src="/g2p_service_provider_portal_base/static/src/img/[email protected]"
class="main-logo"
/>
<a href="/portal">
<img src="#" class="main-logo" alt="Official Logo" />
</a>
<div class="nav-user">
<div class="search-box">
Expand Down Expand Up @@ -54,21 +51,21 @@
<div class="dropdown-menu" aria-labelledby="language-dropdown-button">
<a
class="dropdown-item"
href="/website/lang/en?r=/serviceprovider"
href="/website/lang/en?r=/portal"
data-url_code="en"
>
<span>English</span>
</a>
<a
class="dropdown-item"
href="/website/lang/fr?r=/serviceprovider"
href="/website/lang/fr?r=/portal"
data-url_code="fr"
>
<span>Français</span>
</a>
<a
class="dropdown-item"
href="/website/lang/tl?r=/serviceprovider"
href="/website/lang/tl?r=/portal"
data-url_code="tl"
>
<span>Filipino</span>
Expand All @@ -90,12 +87,12 @@
<div class="dropdown-menu user-block">
<ul style="padding:0px">
<li>
<a href="/serviceprovider/myprofile" class="link">My Profile</a>
<a href="/portal/myprofile" class="link">My Profile</a>
</li>
<hr />
<li>
<a
href="/web/session/logout?redirect=/serviceprovider/login"
href="/web/session/logout?redirect=/portal/login"
class="link"
>Logout</a>
</li>
Expand All @@ -110,7 +107,7 @@
</div>
<script
type="text/javascript"
src="/g2p_service_provider_portal_base/static/src/js/language_selector.js"
src="/g2p_agent_portal_base/static/src/js/language_selector.js"
/>
</header>
</xpath>
Expand All @@ -119,25 +116,22 @@
<footer t-if="not no_footer" id="bottom" data-anchor="true" t-attf-class="bg-light o_footer">
<div class="footer-container">
<div class="nav">
<a href="/serviceprovider">
<img
src="/g2p_service_provider_portal_base/static/src/img/[email protected]"
class="main-logo"
/>
<a href="/portal">
<img src="#" class="main-logo" alt="Official Logo" />
</a>
<ul class='list-container'>
<li class="nav-item">
<a
class="nav-link link"
aria-current="page"
href="/serviceprovider/aboutus"
href="/portal/aboutus"
>About Us</a>
</li>
<li class="nav-item">
<a class="nav-link link" href="/serviceprovider/contactus">Contact Us</a>
<a class="nav-link link" href="/portal/contactus">Contact Us</a>
</li>
<li class="nav-item">
<a class="nav-link link" href="/serviceprovider/otherpage">Others</a>
<a class="nav-link link" href="/portal/otherpage">Others</a>
</li>
</ul>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template id="contact_us_page" name="G2P Service Provider Contact Us">
<t t-call="g2p_service_provider_portal_base.base">
<t t-set="title"> Contact Us| Service Provider Portal</t>
<template id="contact_us_page" name="G2P Registration Portal Contact Us">
<t t-call="g2p_agent_portal_base.base">
<t t-set="title"> Contact Us| Registration Portal</t>
<div class="main-container">
<div class="container-adjuster">
<h5 class='all-title'>Contact Us</h5>
<ol class="breadcrumb breadcrumb-list bg-transparent">
<li class="breadcrumb-item">
<a href="/serviceprovider">Home</a>
<a href="/portal">Home</a>
</li>
<li class="breadcrumb-item active" aria-current="page">Contact Us</li>
</ol>

<div class="profile-container">
<img
src="/g2p_service_provider_portal_base/static/src/img/page_under_construction.png"
/>
<img src="/g2p_agent_portal_base/static/src/img/page_under_construction.png" />
<div>
<h1>Page Under Construction!</h1>
<p
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<template id="home_page" name="G2P Service Provider Home">
<t t-call="g2p_service_provider_portal_base.base">
<t t-set="title"> Home | Service Provider Portal</t>
<template id="home_page" name="G2P Registration Portal Home">
<t t-call="g2p_agent_portal_base.base">
<t t-set="title"> Home | Registration Portal</t>
<div class="main-container">
<div class="container-adjuster">
<!-- TODO: Inherit and add your changes here-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,30 +1,27 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<!-- TODO: Remove all hardcoding -->
<template id="login_page" name="G2P Service Provider Login">
<template id="login_page" name="G2P Registration Portal Login">

<t t-call="g2p_service_provider_portal_base.base">
<t t-call="g2p_agent_portal_base.base">
<t t-set="no_header" t-value="1" />
<t t-set="no_footer" t-value="1" />
<t t-set="body_classname" t-value="'bg-100'" />
<link rel="stylesheet" href="/g2p_service_provider_portal_base/static/src/css/portal.css" />
<link rel="stylesheet" href="/g2p_agent_portal_base/static/src/css/portal.css" />
<div class="ssp-login-body">
<div class="ssp-login-box">
<div class="logo-box">
<img
src="/g2p_service_provider_portal_base/static/src/img/[email protected]"
class="logo"
/>
<img src="#" class="logo" alt="Official Logo" />
</div>
<form
class="oe_login_form"
role="form"
t-attf-action="/serviceprovider/login"
t-attf-action="/portal/login"
method="post"
onsubmit="this.action = '/serviceprovider/login' + location.hash"
onsubmit="this.action = '/portal/login' + location.hash"
>
<input type="hidden" name="csrf_token" t-att-value="request.csrf_token()" />
<input type="hidden" name="redirect" value="/serviceprovider/home" />
<input type="hidden" name="redirect" value="/portal/home" />
<div class="form-group field-login">
<label for="login">Email or Phone</label>
<input
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<odoo>
<!-- Action Name -->
<record id="account.res_partner_action_supplier" model="ir.actions.act_window">
<field name="name">Service Provider</field>
</record>

<!-- Search View -->
<record id="res_partner_view_search_g2p_inherit" model="ir.ui.view">
<field name="name">res.partner.search.inherit</field>
<record id="res_partner_view_search_g2p_inherits" model="ir.ui.view">
<field name="name">res.partner.search.inherits</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="account.res_partner_view_search" />
<field name="arch" type="xml">
<filter name="supplier" position="attributes">
<attribute name="string">Service Provider</attribute>
<attribute name="string">Registration Portal User</attribute>
</filter>
</field>
</record>

<!-- Action Name -->
<record id="account.res_partner_action_supplier" model="ir.actions.act_window">
<field name="name">Registration Portal User</field>
</record>

<menuitem
id="menu_account_supplier"
name="Service Provider"
name="Registration Portal User"
action="account.res_partner_action_supplier"
groups="g2p_registry_base.group_g2p_admin"
sequence="5"
/>
</odoo>
Loading

0 comments on commit 44ce36b

Please sign in to comment.