Skip to content
Permalink
Browse files

⬆️1️⃣2️⃣ website_portal_debt_notebook

  • Loading branch information...
Ommo73 committed Aug 16, 2019
1 parent 35fbf0d commit 0aa7b15540e6de2adbd9f1ab4c00b6e52b48b755
@@ -34,14 +34,14 @@ Maintainers
Further information
===================

Demo: http://runbot.it-projects.info/demo/website-addons/10.0
Demo: http://runbot.it-projects.info/demo/website-addons/12.0

HTML Description: https://apps.odoo.com/apps/modules/10.0//
HTML Description: https://apps.odoo.com/apps/modules/12.0//

Usage instructions: `<doc/index.rst>`_

Changelog: `<doc/changelog.rst>`_

Notifications on updates: `via Atom <https://github.com/it-projects-llc/website-addons/commits/10.0/.atom>`_, `by Email <https://blogtrottr.com/?subscribe=https://github.com/it-projects-llc/website-addons/commits/10.0/.atom>`_
Notifications on updates: `via Atom <https://github.com/it-projects-llc/website-addons/commits/12.0/.atom>`_, `by Email <https://blogtrottr.com/?subscribe=https://github.com/it-projects-llc/website-addons/commits/12.0/.atom>`_

Tested on Odoo 10.0 77e7d952b4c72d58c1b8f34b57e355f5b98c88b0
Tested on Odoo 12.0 77e7d952b4c72d58c1b8f34b57e355f5b98c88b0
@@ -1,12 +1,13 @@
# Copyright 2019 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
# Copyright 2019 Artem Rafailov <https://it-projects.info/team/Ommo73>
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
{
"name": """Portal Debt History""",
"summary": """Allows portal users to see their debt history""",
"category": "Website",
# "live_test_url": "http://apps.it-projects.info/shop/product/DEMO-URL?version=10.0",
"images": [],
"version": "10.0.1.0.0",
"version": "12.0.1.0.0",
"application": False,

"author": "IT-Projects LLC, Kolushov Alexandr",
@@ -17,8 +18,9 @@
# "currency": "EUR",

"depends": [
"website_portal",
"portal",
"pos_debt_notebook",
"website",
],
"external_dependencies": {"python": [], "bin": []},
"data": [
@@ -1,13 +1,13 @@
# -*- coding: utf-8 -*-
# Copyright 2019 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
# Copyright 2019 Artem Rafailov <https://it-projects.info/team/Ommo73>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

from odoo import http
from odoo.http import request
from odoo.addons.website_portal.controllers.main import website_account
from odoo.addons.portal.controllers.portal import CustomerPortal


class PortalDebtHistory(website_account):
class PortalDebtHistory(CustomerPortal):

@http.route(['/my/debt_history', '/my/debt_history/<int:limit>'], type='http', auth="user", website=True)
def portal_my_debt_history(self, limit=10):
@@ -18,9 +18,10 @@ def portal_my_debt_history(self, limit=10):
debts = partner.debt_history(limit=limit)[partner.id]
values.update({
'history': debts['history'],
'debts': [value for key, value in debts['debts'].iteritems()],
'debts': [value for key, value in debts['debts'].items()],
'records_count': limit,
'records_count_all': debts['records_count'],
'page_name': 'debt',
})

return request.render("website_portal_debt_notebook.portal_my_debt_history", values)
@@ -1,30 +1,31 @@
<odoo>
<?xml version="1.0"?>
<!--Copyright 2019 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>
Copyright 2019 Artem Rafailov <https://it-projects.info/team/Ommo73>
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). -->
<template id="assets_frontend" inherit_id="website.assets_frontend" name="Website Portal Sale">
<xpath expr="." position="inside">
<link rel='stylesheet' href='/website_portal_sale/static/src/less/website_portal_sale.less'/>
</xpath>
</template>
<odoo>

<template id="portal_my_home_menu_debt" name="Portal layout : debt menu entry" inherit_id="website_portal.portal_layout" priority="5">
<xpath expr="//ul[contains(@class,'o_portal_submenu')]" position="inside">
<li>
<a href="/my/debt_history">Debt / Credit History</a>
<template id="portal_my_home_menu_debt" name="Portal layout : debt menu entries" inherit_id="portal.portal_breadcrumbs" priority="30">
<xpath expr="//ol[hasclass('o_portal_submenu')]" position="inside">
<li t-if="page_name == 'debt'" class="breadcrumb-item active">
Debt / Credit History
</li>
</xpath>
</template>

<template id="portal_my_home_sale_debt" name="Portal My Home : debt menu entry" inherit_id="website_portal.portal_my_home" priority="5">
<xpath expr="//div[contains(@class,'o_my_home_content')]" position="inside">
<h3 class="page-header">
<a href="/my/debt_history">Debt / Credit History</a>
</h3>
<template id="portal_my_home_debt" name="Portal layout : debt menu entry" inherit_id="portal.portal_my_home" priority="5">
<xpath expr="//div[@class='o_portal_docs list-group']" position="after">
<a class="list-group-item list-group-item-action d-flex align-items-center justify-content-between" href="/my/debt_history">Debt / Credit History</a>
</xpath>
</template>

<template id="portal_my_debt_history" name="My Debt History">
<t t-call="website_portal.portal_layout">
<t t-call="portal.portal_layout">
<t t-set="breadcrumbs_searchbar" t-value="True"/>
<t t-call="portal.portal_searchbar">
<t t-set="title">Debt / Credit History</t>
</t>
<div style="background-color:white;padding:15px;border-radius:5px;
box-shadow: 0 1px 25px rgba(0,0,0,0.25), 0 10px 10px rgba(0,0,0,0.22);">
<h3 class="page-header">Credits</h3>
<table class="table table-hover o_my_status_table client-list">
<thead>
@@ -76,6 +77,7 @@
<t t-call="website.pager"/>
</div>
</t>
</div>
</t>
</template>

0 comments on commit 0aa7b15

Please sign in to comment.
You can’t perform that action at this time.