Skip to content
Permalink
Browse files

🚒 12.0 port

  • Loading branch information...
fedoranvar committed Aug 7, 2019
1 parent 722f55a commit 2a968b83129a37b524759c5330089b6eb5b88d82
@@ -13,7 +13,8 @@ Credits

Contributors
------------
* Kolushov Alexandr <kolushov@it-projects.info>
* `Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr>`__
* `Anvar Kildebekov <https://it-projects.info/team/fedoranvar>`__

Sponsors
--------
@@ -26,12 +27,12 @@ Maintainers
Further information
===================

Demo: http://runbot.it-projects.info/demo/misc-addons/8.0
Demo: http://runbot.it-projects.info/demo/misc-addons/12.0

HTML Description: https://apps.odoo.com/8.0/website_team/
HTML Description: https://apps.odoo.com/12.0/website_team/

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

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

Tested on Odoo 8.0 27a47eb3c3d4b79d8fffb6df66f107a993ddf805
Tested on Odoo 12.0 32c2666d189047db66eb7b1392ea34b086fd341e
@@ -1,3 +1,2 @@
# -*- coding: utf-8 -*-
from . import controllers
from . import models
@@ -1,11 +1,10 @@
# -*- coding: utf-8 -*-
{
"name": """Website Team""",
"summary": """Team""",
"category": "website",
# "live_test_URL": "",
"images": [],
"version": "1.0.0",
"version": "12.0.1.0.0",
"application": False,

"author": "IT-Projects LLC, Kolushov Alexandr",
@@ -33,5 +32,5 @@
"post_init_hook": None,

"auto_install": False,
"installable": False,
"installable": True,
}
@@ -1,2 +1 @@
# -*- coding: utf-8 -*-
from . import main
@@ -1,5 +1,4 @@
# -*- coding: utf-8 -*-
from openerp import http
from odoo import http
import werkzeug
from werkzeug.exceptions import NotFound

@@ -20,8 +19,8 @@ def user(self, login):
current_user = User.search([('username_github', '=', login), ('website_published', '=', True)])

if not current_user:
current_user = User.search([('alias_name', '=', login), ('website_published', '=', True)])
if current_user.username_github is not False and current_user.username_github != current_user.alias_name:
current_user = User.search([('login', '=', login), ('website_published', '=', True)])
if current_user.username_github is not False and current_user.username_github != current_user.login:
return werkzeug.utils.redirect("/team/" + current_user.username_github)

if current_user.id is False:
@@ -1,4 +1 @@
# -*- coding: utf-8 -*-

from . import team

@@ -1,7 +1,5 @@
# -*- coding: utf-8 -*-

from openerp import models, fields, api, _
from openerp.exceptions import Warning as UserError
from odoo import models, fields, api, _
from odoo.exceptions import Warning as UserError
import re


@@ -42,12 +40,7 @@ def get_youtube_id(self, link):
return "https://www.youtube.com/embed/" + link_id + "?rel=0&amp;showinfo=0"

def get_alias_mail(self):
if self.alias_name:
alias_email_full = self.alias_name + "@" + self.alias_domain
return alias_email_full
else:
return False

return self.email if self.login else False

class ResCompany(models.Model):
_inherit = ['res.company']
@@ -1,5 +1,5 @@
<openerp>
<data>
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="website_team_twitter" name="Website Team Twitter">
<script src="https://buttons.github.io/buttons.js"></script>
<script>
@@ -27,7 +27,7 @@
</xpath>
</template>

<template name="user list" id="team_template" page="True">
<template name="user list" id="team_template">
<t t-call="website.layout">
<t t-set="title">Team </t>
<div class="oe_structure">
@@ -40,25 +40,25 @@
<div class="col-md-3">
<div class="team_profile">
<t t-if="user.partner_id.image is not None">
<a t-if="user.username_github" t-attf-href="/team/{{ user.username_github }}/"><span t-field="user.image" class="team_image image" t-field-options='{"widget": "image"}' /></a>
<a t-if="user.username_github is False and user.alias_name" t-attf-href="/team/{{ user.alias_name }}/"><span t-field="user.image" class="team_image image" t-field-options='{"widget": "image"}' /></a>
<t t-if="user.username_github is False and user.alias_name is False">
<span t-field="user.image" class="team_image image" t-field-options='{"widget": "image"}' />
<a t-if="user.username_github" t-attf-href="/team/{{ user.username_github }}/"><span t-field="user.image" class="team_image image" t-options='{"widget": "image"}' /></a>
<a t-if="user.username_github is False and user.login" t-attf-href="/team/{{ user.login }}/"><span t-field="user.image" class="team_image image" t-options='{"widget": "image"}' /></a>
<t t-if="user.username_github is False and user.login is False">
<span t-field="user.image" class="team_image image" t-options='{"widget": "image"}' />
</t>
</t>
<t t-if="user.partner_id.image is None">
<a t-if="user.username_github" t-attf-href="/team/{{ user.username_github }}/"><img class="team_image image" src="/website_team/static/src/img/ava_lack.png"/></a>
<a t-if="user.username_github is False and user.alias_name" t-attf-href="/team/{{ user.alias_name }}/"><img class="team_image image" src="/website_team/static/src/img/ava_lack.png"/></a>
<t t-if="user.username_github is False and user.alias_name is False">
<a t-if="user.username_github is False and user.login" t-attf-href="/team/{{ user.login }}/"><img class="team_image image" src="/website_team/static/src/img/ava_lack.png"/></a>
<t t-if="user.username_github is False and user.login is False">
<img class="team_image image" src="/website_team/static/src/img/ava_lack.png"/>
</t>
</t>
<div class="user">
<a t-if="user.username_github" t-attf-href="/team/{{ user.username_github }}/"><t t-esc="user.name"/></a>
<t t-if="user.username_github is False">
<a t-if="user.alias_name" t-attf-href="/team/{{ user.alias_name }}/"><t t-esc="user.name"/></a>
<a t-if="user.login" t-attf-href="/team/{{ user.login }}/"><t t-esc="user.name"/></a>
</t>
<t t-if="user.username_github is False and user.alias_name is False">
<t t-if="user.username_github is False and user.login is False">
<t t-esc="user.name"/>
</t>
</div>
@@ -88,7 +88,7 @@
</t>
</template>

<template name="user card" id="user_template" page="True">
<template name="user card" id="user_template">
<t t-call="website.layout">
<t t-set="title"><t t-esc="user.name"/></t>
<div class="container">
@@ -118,7 +118,7 @@
</div>
<div class="col-md-1 user_avatar">
<t t-if="user.partner_id.image is not None">
<span t-field="user.image" class="image" t-field-options='{"widget": "image"}' />
<span t-field="user.image" class="image" t-options='{"widget": "image"}' />
</t>
<t t-if="user.partner_id.image is None">
<img class="team_image image" src="/website_team/static/src/img/ava_lack.png"/>
@@ -138,8 +138,8 @@
<div class="github" t-if="user.username_github">
<a class="github-button" t-attf-href="https://github.com/{{ user.username_github }}" data-show-count="true" aria-label="Follow @user on GitHub">Follow</a>
</div>
<div class="email" t-if="user.alias_name">
<a t-attf-href="mailto:{{user.alias_name}}@{{user.alias_domain}}" target="_blank"><i class="fa fa-envelope-o"/></a>
<div class="email" t-if="user.login">
<a t-attf-href="mailto:{{user.login}}@{{user.email}}" target="_blank"><i class="fa fa-envelope-o"/></a>
</div>
</div>
</div>
@@ -171,11 +171,10 @@
</t>
</template>

<template id="footer_custom" inherit_id="website.footer_default" name="Footer Team Link">
<xpath expr="//div[@id='info']/ul" position="inside">
<template id="footer_custom" inherit_id="website.layout" name="Footer Team Link">
<xpath expr="//div[@id='footer']" position="replace">
<li><a href="/team">Team</a></li>
</xpath>
</template>

</data>
</openerp>
</odoo>
@@ -1,14 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<odoo>
<data>
<record id="view_users_form" model="ir.ui.view">
<field name="name">res.users.form</field>
<field name="model">res.users</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.view_users_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@class='oe_title']//field[@name='active']" position="after">
<xpath expr="//button[hasclass('oe_stat_button')]" position="after">
<div>
<label for="website_published" string="Show at team page"/>
<field name="website_published"/>
</div>
</xpath>
<xpath expr="//group[@name='preferences']" position="inside">
<field name="location"/>
@@ -42,4 +45,4 @@
<field name="parent_id" ref="website.main_menu" />
</record>
</data>
</openerp>
</odoo>

0 comments on commit 2a968b8

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