[MERGE] Forward-port of branch 13.0 to 13.2

This commit is contained in:
Antoine Vandevenne (anv) 2020-02-20 11:37:05 +01:00
commit 8620437a11
48 changed files with 4235 additions and 3346 deletions

View File

@ -28,9 +28,9 @@ def setup(app):
app.connect('html-page-context', update_meta)
def update_meta(app, pagename, templatename, context, doctree):
meta = context.get('meta')
if meta is None:
meta = context['meta'] = {}
if not context.get('meta'): # context['meta'] can be None
context['meta'] = {}
meta = context.setdefault('meta', {}) # we want {} by default
meta.setdefault('banner', app.config.odoo_cover_default)
def navbarify(node, navbar=None):

View File

@ -1,11 +1,11 @@
{% extends "basic/layout.html" %}
{% set script_files = script_files + [
'_static/jquery.min.js',
'_static/bootstrap.js',
'_static/doc.js',
'_static/jquery.noconflict.js',
] %}
{%- block scripts %}
{{ super() }}
<script type="text/javascript" src="{{ pathto('_static/jquery.min.js', 1) }}"></script>
<script type="text/javascript" src="{{ pathto('_static/bootstrap.js', 1) }}"></script>
<script type="text/javascript" src="{{ pathto('_static/doc.js', 1) }}"></script>
<script type="text/javascript" src="{{ pathto('_static/jquery.noconflict.js', 1) }}"></script>
{%- endblock %}
{% set classes = [] %}
{% if pagename == master_doc %}
@ -201,16 +201,6 @@
<a href="http://www.odoo.com/trial" class="btn btn-primary">Start Now</a>
</div>
<ul class="navbar-nav navbar-right nav o_sub_nav_actions">
{% if pagename != master_doc %}
<li class="divider"></li>
{% endif%}
{% block switchers_desktop %}
{% include "switchers_list.html" %}
{% endblock %}
</ul>
<ul class="nav navbar-nav navbar-right">
{% if languages or versions %}
<li class="divider"></li>
@ -224,6 +214,16 @@
<li class="divider"></li>
{% endif %}
</ul>
<ul class="navbar-nav navbar-right nav o_sub_nav_actions">
{% if pagename != master_doc %}
<li class="divider"></li>
{% endif%}
{% block switchers_desktop %}
{% include "switchers_list.html" %}
{% endblock %}
</ul>
</div>
</div>
</nav>
@ -247,10 +247,9 @@
{% else %}
{% set container = 'container' %}
{% endif %}
<div class="{{ container}} {{ ' '.join(classes) }}">
<main class="container-fluid {{ ' '.join(classes) }}">
<main class="container {{ ' '.join(classes) }}">
{% if pagename != master_doc %}
<div class="row">
<div class="o_content row">
{% if 'has-toc' not in meta and not (pagename in toc) %}
<aside>
<div class="navbar-aside text-center">
@ -263,7 +262,7 @@
</div>
</aside>
{% endif %}
<article class="doc-body {% if 'has-toc' in meta %}doc-toc{% endif %} {% if pagename in toc%}index-category{% endif %}">
<article class="doc-body {% if 'has-toc' in meta %}doc-toc{% endif %}{% if pagename in toc%}index-category{% endif %}">
{% endif %}
{% block body %} {% endblock %}
{% if pagename != master_doc %}</article>
@ -271,7 +270,6 @@
{% endif %}
<div id="mask"></div>
</main>
</div>
</div>
<div class="floating_action_container">
@ -311,29 +309,33 @@
<div class="col-xs-6 col-sm-4">
<span class="menu_title">Services</span>
<ul>
<li><a href="http://www.odoo.com/pricing">Editions</a></li>
<li><a href="http://www.odoo.com/pricing-online">Cloud Pricing</a></li>
<li><a href="http://www.odoo.com/page/upgrade">Upgrade</a></li>
<li><a href="https://www.odoo.sh">Odoo Cloud Platform</a></li>
<li class="divider"></li>
<li><a href="http://www.odoo.com/help">Support</a></li>
<li><a href="https://upgrade.odoo.com">Upgrade</a></li>
<li class="divider"></li>
<li><a href="http://www.odoo.com/partners">Find a partner</a></li>
<li><a href="http://www.odoo.com/page/become-a-partner">Become a partner</a></li>
<li class="divider"></li>
<li><a href="http://training.odoo.com/courses/odoo-functional">Training Center</a></li>
<li><a href="http://www.odoo.com/page/education-program">Education</a></li>
<li class="divider"></li>
<li><a href="http://www.odoo.com/page/security">Security</a></li>
</ul>
</div>
<div class="col-sm-4 mb64">
<div class="col-xs-12 col-sm-4 mb64">
<span class="menu_title">About us</span>
<ul>
<li><a href="http://www.odoo.com/page/about-us">Our company</a></li>
<li><a href="http://www.odoo.com/page/contactus">Contact</a></li>
<li class="divider" />
<li><a href="http://www.odoo.com/event">Events</a></li>
<li><a href="http://www.odoo.com/blog/">Blog</a></li>
<li><a href="http://www.odoo.com/blog">Blog</a></li>
<li><a href="http://www.odoo.com/blog/6">Customers</a></li>
<li class="divider" />
<li><a href="http://www.odoo.com/jobs">Jobs</a></li>
<li class="divider" />
<li><a href="http://www.odoo.com/page/legal">Legal</a> | <a href="http://www.odoo.com/privacy">Privacy</a></li>
</ul>
</div>
</div>
@ -362,3 +364,4 @@
</div>
</footer>
{%- endblock -%}

View File

@ -1,27 +0,0 @@
# -*- coding: utf-8 -*-
import sys
PY2 = sys.version_info[0] == 2
if PY2:
text_type = unicode
else:
text_type = str
def to_text(source):
""" Generates a text value (an instance of text_type) from an arbitrary
source.
* False and None are converted to empty strings
* text is passed through
* bytes are decoded as UTF-8
* rest is textified via the current version's relevant data model method
"""
if source is None or source is False:
return u''
if isinstance(source, bytes):
return source.decode('utf-8')
return text_type(source)

View File

@ -1,113 +1,91 @@
// ====== Aside =======
// ======================
aside {
.pseudo-col();
width: 100%;
max-width: 240px;
position: static;
padding: 0;
display: block;
border-right: 1px solid @gray-lighter;
@media (max-width:@screen-md-min) {
display: none;
}
}
.navbar-aside {
position : relative;
overflow : hidden;
font-family : @headings-font-family;
font-size : 0.85em;
line-height : 1.5;
font-weight : @fw_medium;
overflow-y : auto;
height : 100%;
position: relative;
overflow: hidden;
font-family: @headings-font-family;
font-size: 0.85em;
line-height: 1.5;
overflow-y: auto;
&.affix {
z-index : 2;
top : @w-sub-nav-height - 1;
position : fixed;
z-index: 2;
top: @w-sub-nav-height - 1;
position: fixed;
backface-visibility: hidden;
@media (max-width:@screen-md-min) {
display: none;
}
}
> ul.list-group {
margin : 0;
z-index : 0;
margin: 0;
z-index: 0;
}
> h3 {
margin : 0;
padding : 15px 0 10px;
margin: 0;
padding: 15px 0 10px;
text-transform: uppercase;
font-weight : @fw_semibold;
font-size : 16px;
color : @text-color;
overflow-x : hidden;
position : relative;
z-index : 1;
font-weight: @fw_semibold;
font-size: 16px;
color: @text-color;
overflow-x: hidden;
position: relative;
z-index: 1;
.box-shadow(0 10px 9px -10px #d2d2d2);
}
.logo_box {
width : 100%;
background : rgb(253, 253, 253);
position : relative;
display : block;
padding : 15px 30px 10px;
border-bottom: 1px solid fadeout(@text-color, 90%);
text-align : center;
.box-shadow(inset 0px 0 40px rgba(114, 122, 142, .1));
.logo {
float : left;
width : 90%;
margin : auto auto 10px 5%;
height : 50px;
background-image : url('img/odoo_logo_rgb.png');
background-repeat : no-repeat;
background-position: center center;
background-size : contain;
text-decoration : none;
}
}
.gith-container {
margin : 0;
z-index : 1;
position : relative;
margin: 0;
z-index: 1;
position: relative;
overflow-x: hidden;
.gith-link {
font-weight : 600;
color : @text-color;
color: @text-color;
text-decoration: none;
display : inline-block;
position : relative;
margin : 10px 0;
.transition(color .2s);
display: inline-block;
position: relative;
margin: 10px 0;
font-family: @font-family-base;
&:hover {
color : @headings-color;
color: @headings-color;
text-decoration: none;
}
&:before {
.size(20px;20px);
.opacity(.5);
content : '';
position : relative;
.square(1em);
content: '';
position: relative;
background-image: url('img/github-square_32.png');
background-size : 100%;
display : inline-block;
vertical-align : middle;
background-size: 100%;
display: inline-block;
vertical-align: middle;
.translate(0;-1px);
.transition(opacity .2s);
}
&:hover, &:focus {
&:before {
.opacity(1);
}
}
}
}
//-- All menu levels
ul {
padding : 0;
position : relative;
padding: 0;
position: relative;
margin-bottom: 0 !important;
li {
@ -120,37 +98,64 @@
}
&:first-child {
overflow : hidden;
overflow: hidden;
border-radius: 2px 0 0 0;
}
> a {
display: block;
padding: 5px 15px;
color : @text-color;
color: @text-color;
line-height: 1.2;
&:hover, &:focus {
&:focus, &:hover {
color: @headings-color;
}
}
&.parent > a:after{
content: '\e7c1';
font-family: 'Material-Design-Icons';
opacity: 0.8;
margin-top: -6px;
.o-position-absolute(50%, 10px);
.rotate(90deg);
.transition(transform 0.2s);
}
&.parent.active > a:after{
.rotate(0);
}
}
//-- Inner menu list
ul {
max-height : 0;
background-color: @gray-lighter;
padding-left : 15px;
overflow : hidden;
max-height: 0;
background-color: fade(@gray-light, 20%);
padding: 0px;
overflow: hidden;
margin-left: 0;
box-shadow: inset 0 3px 5px -2px @gray-light;
.transition(max-height 0.3s @o-ease);
> li:not(:last-child) {
box-shadow: 0 1px 0 fade(black, 4%);
&.active > ul > li:not(:first-child) {
border-top: 1px solid @gray-lighter;
}
}
}
}
//-- Active lis
li.active {
&, &:hover, &:focus {
&, &:focus, &:hover {
border-color: @gray-lighter;
background : transparent;
background: transparent;
> a {
font-weight: bold;
color: @headings-color;
}
}
@ -162,32 +167,44 @@
// First menu level
> ul > li {
border-bottom: 1px solid @gray-lighter;
background : white;
background: white;
border-bottom: 1px solid fade(black, 8%);
> a {
padding: 10px 15px;
border-left: 3px solid transparent;
}
&:hover, &:focus {
&:focus, &:hover {
> a {
box-shadow : inset 5px 0 0 -3px @gray-light;
border-left: 3px solid @gray-light;
background-color: transparent;
}
}
&.active, &.active:hover, &.active:focus{
&.active, &.active:focus, &.active:hover {
> a {
box-shadow : inset 5px 0 0 -3px @brand-primary;
border-left: 3px solid @brand-primary;
}
}
&.parent {
> a:after {
content : '\e7c1';
font-family: 'Material-Design-Icons';
opacity : 0.5;
.o-position-absolute(auto, 10px);
&.active.parent + li {
box-shadow: 0 -3px 5px -4px fade(@gray-darker, 40%);
}
> ul > li {
> a {
padding-left: 20px;
}
> ul > li {
> a {
padding-left: 30px;
}
> ul > li > a {
padding-left: 40px;
}
}
}
}
@ -195,25 +212,23 @@
.floating_action_container {
position: fixed;
right : 8px;
bottom : 8px;
width : auto;
z-index : @zIndex--float_action;
right: 8px;
bottom: 8px;
width: auto;
z-index: @zIndex--float_action;
@media (min-width:@screen-md-min) {
display: none;
}
}
#floating_action {
width : 56px;
height : 56px;
display : inline-block;
z-index : 0;
.square(56px);
display: inline-block;
z-index: 0;
background-color: transparent;
border-radius : 50%;
padding : 16px;
box-shadow : 0 8px 17px 0 rgba(0, 0, 0, 0.1), 0 6px 20px 0 rgba(0, 0, 0, 0.05);
border-radius: 50%;
padding: 16px;
box-shadow: 0 8px 17px 0 rgba(0, 0, 0, 0.1), 0 6px 20px 0 rgba(0, 0, 0, 0.05);
background-color: @brand-primary;
.transition(transform 500ms @o-ease);
@ -222,55 +237,52 @@
}
&.active {
.transform(~"translateZ(0px) rotateZ(-180deg)");
.transform(~ "translateZ(0px) rotateZ(-180deg)");
}
}
#floating_action_menu {
position : absolute;
z-index : 1;
overflow : hidden;
right : 0;
width : 380px;
bottom : 0;
padding : 0;
display : block;
.o-position-absolute(auto,0,0);
z-index: 1;
overflow: hidden;
width: 380px;
padding: 0;
display: block;
border-radius: 2px;
visibility : hidden;
visibility: hidden;
.transition(all 0.5s);
.box-shadow(0 0 0 transparent);
.content {
margin: 0;
.opacity(0);
opacity:0;
li {
border : none;
border: none;
border-top: 1px solid #DDD;
&:first-child {
border-top: none;
}
}
a {
display : inline-block;
cursor : pointer;
color : @headings-color;
display: inline-block;
cursor: pointer;
color: @headings-color;
text-decoration: none;
float : left;
width : 100%;
padding : 5px 10px;
float: left;
width: 100%;
padding: 5px 10px;
}
}
.bubble {
position : absolute;
.size(1px; 1px);
background : @brand-primary;
content : '';
bottom : 28px;
right : 28px;
color : #fff;
.o-position-absolute(auto,28px,28px);
.square(1px);
background: @brand-primary;
content: '';
color: #fff;
border-radius: 50%;
.transition(all 300ms @o-ease);
}
@ -281,17 +293,17 @@
}
&.active {
display : block;
display: block;
visibility: visible;
.transition(all 500ms @o-ease);
.bubble, &:before {
&:before, .bubble {
.size(1000px; 2000px);
border-radius: 50%;
.opacity(0);
margin-right : -500px;
opacity: 0;
margin-right: -500px;
margin-bottom: -500px;
display : block;
display: block;
.transition(all .4s @o-ease);
}
@ -301,9 +313,27 @@
.content {
position: relative;
z-index : 1;
z-index: 1;
.opacity(1);
.transition(all 500ms @ease-material-3);
}
}
}
}
#mask {
.opacity(0);
position: fixed;
z-index: @zIndex--mask;
top: 0;
left: 0;
.size(100%; 0);
background-color: fade(black, 20%);
.transition(opacity .3s);
&.active {
.opacity(1);
display: block;
.square(100%);
.transition(opacity .3s);
}
}

View File

@ -0,0 +1,516 @@
// ================================================
// ================ Components ====================
// ================================================
// Ripple buttons
// ----------------------------------------
@-webkit-keyframes ripple {
to {
opacity: 0;
-webkit-transform: scale(2.5);
}
}
@keyframes ripple {
to {
opacity: 0;
.scale(2.5);
}
}
.ripple {
z-index: 2;
.inner-ripple {
display: block;
position: absolute;
border-radius: 100%;
opacity: 1;
z-index: -1;
background: rgba(0, 0, 0, .05);
pointer-events: none;
.scale(0);
&.inner-ripple-animated {
.animation(ripple 0.35s ease-in);
}
}
}
// Code Fields
// ----------------------------------------
article.doc-body .code-fields {
display: table;
width: 100%;
padding: 5px;
font-size: 0.8em;
border: 2px solid @gray-lighter;
.code-field {
display: table-row;
}
.code-field-body {
display: block;
padding-left: 15px;
@media screen and (min-width: @screen-md-min) {
display: table-cell;
padding-left: 0;
}
}
.code-field-name {
width: auto;
display: block;
font-weight: @fw_semibold;
color: @headings-color;
&:after {
content: ":";
}
@media screen and (min-width: @screen-md-min) {
text-align: right;
width: 20%;
padding-right: 10px;
display: table-cell;
}
}
ul {
list-style: none;
margin: 0.2em 0;
> li {
margin: 0 0 8px;
padding-left: 0px;
line-height: 1.5;
&:before {
display: none;
}
}
strong {
color: @headings-color;
font-family: @font-family-monospace;
}
em {
color: @headings-color;
font-family: @font-family-monospace;
font-weight: @fw_semibold;
}
}
}
// Cards
// ----------------------------------------
.card-img {
.o-gradient();
.o-position-absolute(0, 0);
.translate3d(0;0;0);
.square(100%);
display: block;
background-size: cover;
background-position: 50%;
}
.card.top {
position: relative;
overflow: hidden;
margin: 0;
padding: 0 0 2%;
.transform-origin(50% 0px 0px);
.o-gradient();
@media screen and (min-width: @screen-sm-min) {
padding: 12% 0 5%;
}
@media screen and (min-width: @screen-md-min) {
padding: 10% 0 5%;
}
@media screen and (min-width: @screen-lg-min) {
padding: 8% 0 4%;
}
&.stacked {
background: transparent;
.transition(background 1s);
}
&:before {
content: "";
display: block;
background-image: url("img/banner_bg.png");
background-size: cover;
background-position: 50%;
.o-position-absolute(0, 0);
.square(100%);
}
.card-img {
background-image: url("img/banner_bg.png");
}
.container {
position: relative;
font-size: 32px;
@media screen and (min-width: @screen-sm-min) {
&:not(.o_long_title) {
font-size: 40px;
}
&.o_short_title {
font-size: 50px;
}
}
h1 {
font-weight: @fw_light;
font-size: 1em;
color: white;
line-height: 0.9;
}
}
}
.card.top.has_banner {
background: @footer-bg-color;
&:before {
display: none;
}
.card-img {
opacity: 0.35;
}
}
// Alerts
// ----------------------------------------
main .alert {
padding: 8px 15px;
border-radius: 0;
margin: 5px auto 15px;
border-width: 0 0 0 3px;
// 'INFO' is the default style
border-color: @brand-info;
background-color: lighten(@brand-info, 45%);
&, p {
line-height: 1.3;
font-size: 14px;
}
p {
margin-bottom: 5px;
&:last-child {
margin-bottom: 0;
}
}
> ul {
margin: 0.5em 0;
> li {
margin: 0;
}
}
h3.alert-title {
font-size: 1em;
line-height: 1em;
margin: 0 0 5px;
font-weight: bold;
font-family: @font-family-base;
color: darken(@brand-info, 5%);
&:before {
.mdi-icon( "\e639");
.translate(0, 0.1em);
margin-right: 0.2em;
}
}
&.alert-info {
> h3.alert-title {
display: none;
}
}
&.alert-go_to {
border-color: @o-violet-dark;
background-color: lighten(@o-violet-dark, 52%);
color: darken(@o-violet-dark, 5%);
> h3.alert-title {
color: darken(@o-violet-dark, 15%);
&:before {
content: "\e70d";
}
}
}
&.alert-success {
border-color: lighten(@brand-success, 30%);
background-color: lighten(@brand-success, 45%);
> h3.alert-title {
color: darken(@brand-success, 10%);
&:before {
content: "\e625";
}
}
}
&.alert-warning, &.warning {
border-color: lighten(@brand-warning, 30%);
background-color: lighten(@brand-warning, 35%);
> h3.alert-title {
color: @brand-warning;
&:before {
content: "\e6a4";
}
}
}
&.alert-danger {
border-color: lighten(@brand-danger, 30%);
background-color: lighten(@brand-danger, 40%);
> h3.alert-title {
color: darken(@brand-danger, 10%);
&:before {
content: "\e6a4";
}
}
}
&.alert-exercise {
border-color: lighten(@doc_exercise, 30%);
background-color: lighten(@doc_exercise, 40%);
color: darken(@doc_exercise, 35%);
> h3.alert-title {
color: @doc_exercise;
}
> h3.alert-title:before {
.translate(0;0);
top: 28px;
content: "\e709";
}
}
&.doc-content {
@media (min-width: @screen-lg-min) {
max-width: 55%;
}
}
}
// Elements
// ----------------------------------------
hr.divider {
border-color: fadeout(@gray-lightest, 60%);
position: absolute;
width: 900%;
margin-left: -13px;
}
img.img-responsive {
box-shadow: 0 3px 15px @gray-lighter;
border: 1px solid @gray-lighter;
margin-bottom: 25px;
&:not(:first-child) {
margin-top: 25px;
}
}
.figure {
h4 {
margin: 0.5em 0 1.5em;
padding-left: 1em;
font-size: 1em;
font-style: italic;
}
}
.pq-patch {
em {
display: block;
border-radius: 4px 4px 0 0;
background: @gray-lighter;
padding-left: 10px;
font-size: 0.9em;
font-weight: @fw_semibold;
+ .pq-section .highlight {
border-radius: 0 0 4px 4px;
}
}
}
span.menuselection {
font-weight: @fw_medium;
}
.list-group-item {
border: none;
background: transparent;
}
blockquote {
font-family: @font-family-serif;
font-weight: @fw_semibold;
font-style: italic;
footer {
font-family: @font-family-base;
background: transparent;
text-align: left;
color: @text-color;
font-weight: normal;
font-style: normal;
cite {
font-style: italic;
}
}
@media (min-width:@screen-md-min) {
border-left: 3px solid fade(@brand-primary, 50%);
}
}
.code, code {
font-size: 0.8em;
font-weight: @fw_semibold;
color: darken(@brand-primary, 30%);
background-color: lighten(@brand-primary, 50%);
}
.btn {
border-radius: 0;
}
.table, table {
font-size: 0.9em;
}
.code-attribute, .code-class, .code-classmethod, .code-data, .code-function, .code-method, .code-staticmethod {
// indents *all* content
padding-left: 20px;
margin-bottom: 2em;
// except for item title which gets dedented back
> h6 {
margin-left: -20px;
margin-bottom: 0.3em;
.viewcode-link {
display: none;
float: right;
}
&:hover .viewcode-link {
display: inline;
}
}
p {
margin-bottom: 0.5em;
}
}
article.doc-body {
&.index-category {
min-height: 300px;
min-height: 30vh;
li.toctree-l1 {
padding: 5px 0;
}
}
}
article.doc-body .content-switcher {
margin-top: 0;
> ul {
font-size: 10px;
padding: 0;
margin: 0;
.transition(all .2s ease);
> li {
font-weight: @fw_semibold;
color: @gray-light;
border-bottom: 1px solid transparent;
margin: 0 20px 0 0;
padding-left: 0;
font-size: 1.3em;
cursor: pointer;
display: inline-block;
list-style: none;
.transition(all .2s);
opacity: 0.6;
&:before {
content: none;
}
&.active {
border-bottom: 1px solid @brand-primary;
opacity: 1;
}
}
}
&:hover > ul > li {
.opacity(1);
}
> .tabs > * {
display: none;
max-width: 100%;
overflow-x: auto;
}
> .tabs > .active {
display: block;
}
}
.highlight {
background: @doc_code-bg;
color: @gray-light;
border-radius: @border-radius-base;
margin-bottom: (@line-height-computed / 2);
pre {
margin-bottom: 0;
}
}
pre {
font-size: 0.8em;
color: @gray-light;
background: @doc_code-bg;
font-family: @font-family-monospace;
font-weight: @fw_semibold;
position: relative;
border: none;
max-width: 100%;
overflow: auto;
margin: 0 0 (@line-height-computed / 2);
}

View File

@ -1,6 +1,15 @@
(function ($) {
$(document).ready(function () {
$(function () {
// -- Initialize fallbacks for requestAnimationFrame
window.requestAnimationFrame = window.requestAnimationFrame
|| window.webkitRequestAnimationFrame
|| window.mozRequestAnimationFrame
|| window.msRequestAnimationFrame
|| window.oRequestAnimationFrame
|| function (callback) { setTimeout(callback, 10); };
// ======= Define variables =======
// =================================
@ -12,14 +21,33 @@
win_w = $win.width();
// -- Main elements
var $body = $('body'),
$header = $body.find('> header'),
$sub_nav = $header.find(".o_sub_nav");
$wrap = $body.find('> #wrap'),
$card_top = $wrap.find('> .card.top'),
$card_top_t = $card_top.find('> .container'),
$main = $wrap.find('main'),
$footer = $body.find('> footer');
var $body = $('body'),
$header = $body.find('> header'),
$sub_nav = $header.find(".o_sub_nav"),
$wrap = $body.find('> #wrap'),
$main = $wrap.find('main'),
$footer = $body.find('> footer');
// -- Detect page type
var page_type = (function () {
if ($wrap.hasClass('index')) {
return 'index';
} else if ($main.find('article').hasClass('doc-tocindex-category')){
return 'category-index';
} else {
return 'article';
}
})();
// -- CP > "Card Top"
var $cp = $wrap.find('> .card.top'),
$cp_image = $cp.find('> .card-img'),
$cp_text = $cp.find('> .container'),
cp_h = $cp.outerHeight(),
has_cp_image = $cp_image.length > 0,
cp_image_alpha = has_cp_image ? $cp_image.css('opacity') : undefined,
cp_end_point = has_cp_image ? cp_h/2 : undefined;
// -- Floating action
var $mask = $body.find('#mask'),
@ -27,37 +55,34 @@
$float_menu = $body.find("#floating_action_menu");
// -- Elements' heights
var body_h = $body.height(),
header_h = $header.outerHeight(),
sub_nav_h = $sub_nav.height();
var body_h = $body.height(),
header_h = $header.outerHeight(),
main_h = $main.height(),
sub_nav_h = $sub_nav.height();
// -- Aside
var $aside = $main.find('aside'),
has_aside = $aside.length > 0,
$aside_nav = undefined;
aside_links = undefined;
$aside_nav = has_aside ? $aside.find('> .navbar-aside') : undefined,
aside_links = has_aside ? $aside_nav.find("li > a") : undefined;
if (has_aside) {
$aside_nav = $aside.find('> .navbar-aside');
aside_links = $aside_nav.find("li > a");
}
// ======= Affix =================
// ===============================
function set_affix(body_h) {
var aside_offset = $aside.offset().top - sub_nav_h,
aside_width = $aside.width(),
main_bottom = 40;
function set_affix() {
var aside_offset_top = $aside.offset().top - sub_nav_h,
aside_offset_bot = parseInt($wrap.css('padding-bottom')),
aside_width = $aside.width();
$aside_nav.css('width', aside_width);
$aside_nav.affix({
target: window,
$aside.css('height', main_h);
$aside_nav.css('width', aside_width).affix({
offset: {
top : aside_offset,
bottom : main_bottom
top : aside_offset_top,
bottom : aside_offset_bot,
}
});
};
}
// ======= Footer animations =====
// ===============================
@ -67,22 +92,22 @@
if (!footer_effect) {
footer_stop();
return;
};
}
$footer.toggleClass('o_footer_effect', footer_effect);
$body.css('padding-bottom', $footer.outerHeight());
var checkIfSearch = function(e) {
var checkIfSearch = function (e) {
if ((e.ctrlKey || e.metaKey) && String.fromCharCode(e.which).toLowerCase() === 'f') {
footer_stop();
}
};
$win.on('keydown.footer', function(e) {
$win.on('keydown.footer', function (e) {
checkIfSearch(e);
});
};
var footer_stop = function() {
var footer_stop = function () {
$footer.removeClass('o_footer_effect');
$body.css('padding-bottom', 0);
$win.off('keydown.footer');
@ -92,24 +117,59 @@
// ======= Docs Functions ==========
// =================================
// -- Layouting
var layouting = function () {
if ($main.hasClass("index")) {
$main.find("#index .index-tree > .row").each(function() {
var childs = $(this).find(".col-md-3");
if (childs.length == 2) {
childs.removeClass("col-md-3").addClass("col-md-6");
}
if (childs.length == 3) {
childs.removeClass("col-md-3").addClass("col-md-4");
}
})
$(".floating_action_container").remove();
var init = function () {
var $floating_container = $body.find("> .floating_action_container");
// Adapt Title font size according to its length
$cp_text
.toggleClass('o_short_title', $cp_text.text().trim().length < 15)
.toggleClass('o_long_title', $cp_text.text().trim().length > 45);
if (page_type == 'index') {
var half_cols_selector = '.tutorials,.api';
$main.find("#index .index-tree").find(half_cols_selector)
.wrap('<div class="o_half_col col-sm-6"/>')
.find('.col-md-3').removeClass('col-md-3 col-sm-6').addClass('col-sm-12 col-md-6');
var half_cols_els = $main.find(".o_half_col");
for(var i = 0; i < half_cols_els.length; i+=2) {
half_cols_els.slice(i, i+2).wrapAll("<div class='row'></div>");
}
}
if (has_aside) { $aside_nav.find("li").has("ul").addClass("parent"); };
}
if (page_type == 'index' || page_type == 'category-index') {
$floating_container.add($mask).remove();
$main.toggleClass('o_slim_page', page_type == 'category-index');
}
if (page_type == 'article') {
attach_permalink_markers();
// Hide empty-permalink first sections
var $f_s = $main.find('article.doc-body > section:first-child');
$f_s.toggleClass('hidden', $f_s[0].childElementCount == 1 && $f_s.children().is('i:empty'));
if (has_aside) {
if (aside_links.length < 2) {
has_aside = false;
$main.addClass("o_aside_removed");
$floating_container.add($mask).add($aside).remove();
return;
}
floating_menu_layout();
set_scroll_to(aside_links);
ripple_animation(aside_links);
$aside_nav.find("li").has("ul").addClass("parent");
}
}
bind_window_events();
};
// -- Float action menu
var floating_menu_layout = function() {
var floating_menu_layout = function () {
var lis = $aside_nav.find("> ul > li").clone(true)
.addClass("ripple")
.css({
@ -117,53 +177,46 @@
overflow: 'hidden'
});
lis.find("ul").remove().end()
.find("a").removeClass("ripple").on("click", function() {
floating_menu_toggle();
.find("a").removeClass("ripple").on("click", function () {
_toggle_float();
});
$float_menu.find(".content").empty().append(lis);
$float.add($mask).on("click", function () {
floating_menu_toggle();
_toggle_float();
return false;
});
}
var floating_menu_toggle = function() {
$float.toggleClass("active");
setTimeout(function() {
$float_menu.toggleClass("active");
$mask.toggleClass("active");
}, 300);
};
// -- Scroll To
var scroll_to = function(el_list) {
var offset = 80;
el_list.each(function() {
var $link = $(this),
href = $link.attr("href");
var set_scroll_to = function (el_list) {
el_list.each(function () {
var $link = $(this),
target_id = $link.attr("href");
$link.on("click", function() {
var val = $(href).offset().top - 60;
$('html, body').animate({
scrollTop: val
}, 400);
$link.on("click", function () {
$aside_nav.find("li").removeClass("active");
$link.parents("li").addClass("active");
window.location.hash = $link.prop('hash');
_scroll_and_set_hash(target_id);
return false;
})
})
}
});
});
$body.scrollspy({
target: 'aside',
offset: 200,
});
};
// -- Ripple buttons
var ripple_animation = function(el_list) {
el_list.each(function() {
var ripple_animation = function (el_list) {
el_list.each(function () {
var btn = $(this);
btn
.css({
position: 'relative',
overflow: 'hidden'
})
.bind('mousedown', function(e) {
.bind('mousedown', function (e) {
var ripple;
if (btn.find('.inner-ripple').length === 0) {
ripple = $('<span class="inner-ripple"/>');
@ -186,43 +239,17 @@
top: y + 'px',
left: x + 'px'
}).addClass('inner-ripple-animated');
setTimeout(function() {
setTimeout(function () {
ripple.removeClass('inner-ripple-animated');
}, 351);
});
});
};
// -- Cards animation
var cards_animate = function(type, speed) {
type = type || 'in';
speed = speed || 2000;
var $container = $("main.index"),
$cards = $container.find(".card"),
$titles = $container.find("h2");
$cards.each(function() {
var $card = $(this),
cardOffset = this.getBoundingClientRect(),
offset = cardOffset.left * 0.8 + cardOffset.top,
delay = parseFloat(offset / speed).toFixed(2);
$card.css("transition-delay", delay + "s");
});
if (type === "in") {
$titles.fadeTo(0, 0);
$titles.fadeTo(1000, 1);
$container.addClass("animating");
} else {
$titles.fadeTo(300, 0);
$container.removeClass("animating");
}
};
// -- Header buttons
var header_buttons = function () {
var timer;
$header.on('click', '.o_primary_nav .dropdown-toggle', function(e) {
$header.on('click', '.o_primary_nav .dropdown-toggle', function (e) {
e.preventDefault();
var $a = $(this);
@ -233,12 +260,12 @@
if ($a.closest('.o_primary_nav').children('.open').length > 0) {
$header.addClass("o_sub_opened");
} else {
timer = setTimeout(function() {
timer = setTimeout(function () {
$header.removeClass("o_sub_opened");
}, 200);
}
});
$header.on('click', '.o_primary_nav .o_secondary_nav', function(e) {
$header.on('click', '.o_primary_nav .o_secondary_nav', function (e) {
if (e.target === e.currentTarget) {
$header.find('.open').removeClass('open');
$header.find('.o_sub_opened').andSelf().removeClass('o_sub_opened');
@ -246,28 +273,53 @@
});
// -- Mobile menu opening
$header.on('click', '.o_mobile_menu_toggle', function(e) {
$header.on('click', '.o_mobile_menu_toggle', function (e) {
e.preventDefault();
$(this).find('i').toggleClass('fa-bars fa-times');
$header.toggleClass('o_mobile_menu_opened');
});
};
var card_top_animation = function (win_top){
var scrollFactor = 1.6,
bannerHeight = Math.max(450, $card_top.outerHeight(true) - 60),
top = Math.min(win_top, bannerHeight/scrollFactor),
base_value = top * (scrollFactor - 1),
opacity = top/bannerHeight * scrollFactor;
// -- Attach permalink markers to sections' title
var attach_permalink_markers = function () {
$main.find('article.doc-body > section').each( function () {
var $section = $(this),
$title = $section.find('> h2, > h3, > h4, > h5, > h6'),
target_id = $section.attr('id'),
$icon = $('<i/>').addClass('mdi-content-link');
$card_top.css('transform', 'translateY(' + base_value + 'px)');
$card_top_t.css({
'transform' : 'translateY( -' + ( base_value - (top/2)) + 'px)',
'opacity' : 1 - opacity
if ($title.length <= 0) {
return;
}
$title.addClass('o_has_permalink_marker').append($icon);
$icon.on('click', function () {
_scroll_and_set_hash("#" + target_id);
$title.addClass('o_marked').delay(1000).queue(function (){
$title.removeClass('o_marked').dequeue();
});
return false;
});
});
}
};
$(".content-switcher").each(function(index, switcher) {
var cp_animation = function (win_top, cp_end_point){
var top = Math.min(win_top, cp_h);
$cp_image.css({
'opacity' : cp_image_alpha - (top * (cp_image_alpha/cp_end_point)),
'transform' : 'scale(' + (1 + (top * (0.1/cp_end_point))) +')'
});
$cp_text.css({
'transform' : 'translateY(' + (top/4) + 'px)',
'opacity' : 1 - (top/cp_h)
});
};
$(".content-switcher").each(function (index, switcher) {
var $switcher = $(switcher),
$links = $switcher.find('> ul > li'),
$tabs = $switcher.find('> .tabs > *'),
@ -278,66 +330,77 @@
$links.eq(index).add($tabs.eq(index)).addClass('active');
}
select(0);
$switcher.on('click', '> ul > li', function() {
$switcher.on('click', '> ul > li', function () {
select($(this).index());
return false;
});
});
// ======= Utils ==================
// =================================
var _scroll_and_set_hash = function (target_id) {
$('html, body').animate({
scrollTop: $(target_id).offset().top - 60
}, 100);
window.location.hash = target_id;
};
var _toggle_float = function () {
$float.toggleClass("active");
setTimeout(function () {
$float_menu.toggleClass("active");
$mask.toggleClass("active");
}, 300);
};
var bind_window_events = function () {
// ======= On resize ==============
// Update properties and conditionally call functions according to resolution
$win.on('resize', function () {
// Update size variables
win_w = $win.width();
body_h = $body.height();
cp_h = $cp.outerHeight();
main_h = $main.height();
cp_end_point = has_cp_image ? cp_h/2 : undefined;
if (win_w >= screen_md){
footer_animation();
(has_aside)? set_affix(): '';
} else {
footer_stop();
}
});
// ======= On scroll ==============
$win.on('scroll', function () {
var win_top = $win.scrollTop();
$win[0].requestAnimationFrame(function () {
cp_animation(win_top, cp_end_point);
});
if (win_w >= screen_md) {
$header.toggleClass('o_scrolled', win_top > header_h);
}
});
};
// ======= Onload ==================
// =================================
// -- Call default functions
layouting();
cards_animate();
init();
header_buttons();
ripple_animation($(".ripple"));
if (has_aside) {
floating_menu_layout();
scroll_to(aside_links);
ripple_animation(aside_links);
}
// -- Conditionally call specific functions according to resolution
if (win_w >= screen_md){
footer_animation();
if (has_aside) {
$win.load(function (){
// wait until page load before affix
body_h = $body.height();
set_affix(body_h);
})
}
};
// ======= On resize ==============
// ================================
// Update properties and conditionally call functions according to resolution
$win.on('resize', function () {
win_w = $win.width();
body_h = $body.height();
if (win_w >= screen_md){
footer_animation();
if (has_aside) { set_affix(body_h); };
} else {
footer_stop();
};
});
// ======= On scroll ==============
// ================================
$win.on('scroll', function () {
if (win_w >= screen_md) {
var win_top = $win.scrollTop();
header_h = $header.outerHeight();
$header.toggleClass('o_scrolled', win_top > header_h);
card_top_animation(win_top);
} else {
$card_top.css('transform', '');
}
});
(has_aside)? set_affix(): '';
}
});
})(jQuery);

View File

@ -53,7 +53,7 @@
z-index: 2;
background-color: fade(white, 60%);
color: @header-link-normal;
font-family: @headings-font-family;
font-family: "Work Sans", sans-serif;
font-size: 12px;
.transition(all .2s ease);
.transition-property(~'background, box-shadow' );

View File

@ -0,0 +1,120 @@
// ================================================
// ======= Index pages (covers and toctree) =======
// ================================================
#wrap.index {
@media screen and (min-width: @screen-md-min) {
> .card.top {
padding: 10% 0 2%;
}
}
> main.index {
margin: 10px auto;
.o_content {
box-shadow: none;
background: none;
}
}
}
main.index {
.toc-section h2 {
// section title
padding: 0 0 4px;
border-bottom: 1px solid @gray-lighter;
margin: 1.4em 0 0.8em;
font-size: 16px;
font-family: @font-family-base;
letter-spacing: 0;
font-weight: bold;
color: @text-muted;
}
.card {
border-radius: 4px;
position: relative;
overflow: hidden;
margin-bottom: @card_margin-bottom;
padding-top: 56%;
background-color: @doc_paper;
.deep-1;
.card-img {
span {
display: block;
background-size: cover;
background-position: 50%;
.square(100%);
}
}
figcaption {
color: @text-color;
box-shadow: inset 0 1px 0 @gray-lighter;
font-weight: bold;
line-height: 1.2;
font-size: 14px;
background-color: white;
padding: 8px 12px 6px;
.o-position-absolute(0, -1px, auto, -1px);
}
}
.toc-single-entry .card figcaption {
@media screen and(min-width: @screen-md) {
font-size: 1.5em;
padding: 20px 15px;
}
}
}
.toctree-wrapper > ul {
list-style: none;
padding: 0;
li {
line-height: 1.4;
&.toctree-l1, &.toctree-l3 {
padding-left: 0;
&:before {
content: none;
}
&:first-child {
margin-top: 0;
}
}
&.toctree-l1 {
margin: 0 0 15px;
> span {
font-size: 21px;
}
}
&.toctree-l2 {
> span {
font-weight: @fw_medium;
}
> ul {
margin: 0 0 15px;
&:empty {
display: none;
}
}
a {
text-decoration: none;
&:hover {
text-decoration: underline;
}
}
}
}
}

View File

@ -1,214 +1,164 @@
.pseudo-col(){
position: relative;
min-height: 1px;
padding-right: 15px;
padding-left: 15px;
float: left;
width: 100%;
}
.code-col(){
content: "";
background: @doc_code-bg;
.box-shadow(inset 40px 0 40px -18px rgba(22, 24, 29, 0.3));
position: absolute;
width: 43%;
height: 100%;
top: 0;
right: 0;
}
// ================================================
// ================ Layout =======================
// ================================================
// Bootrstrap adaptations
// ------------------------------------------------------------------
body, header {
position: relative;
}
// Index layout
#wrap {
> .container.index {
background-color: @gray-lightest;
width: 100%;
position: relative;
> .index {
.container;
}
}
}
#main_title {
margin: 10px;
@media (min-width:@screen-md-min) {
margin: 0 0 9px 0;
}
}
.container .container {
max-width: 100%;
padding:0;
margin:0;
max-width: 100%;
padding: 0;
margin: 0;
}
article.doc-content *[class^="col-"] {
padding:0;
.img-responsive {
display: inline-block;
}
main{
aside, article.doc-body, .doc-content, .doc-aside {
.pseudo-col();
}
.doc-content, .doc-aside {
position:relative;
}
aside {
width: 25%;
max-width: 300px;
position:static;
padding:0;
display:block;
float:left;
@media (max-width:@screen-md-min) {
display: none;
}
}
article.doc-body {
background: @doc_paper;
border-left: 1px solid @gray-lighter;
padding: 15px 30px;
@media (min-width: @screen-md-min) {
width: 75%;
&.doc-toc {
width: 100%;
}
}
> *{
max-width: 100%;
}
}
.img-responsive.center-block {
display: block;
}
main.has_code_col{
.container;
article.doc-content *[class*="col-"] {
padding: 0;
}
aside {
display: none;
}
article.doc-body {
width: 100%;
// Main Components
// ------------------------------------------------------------------
#wrap {
z-index: 1;
position: relative;
background: @gray-lightest;
padding-bottom: 40px;
}
> *{
max-width: 100%;
main {
position: relative;
display: block;
.o_content {
background-color: @doc_paper;
.deep-1;
@media (min-width: @screen-sm-min) {
margin: -40px auto 0;
border-radius: 2px;
}
}
section {
position: relative;
display:block;
float: left;
width: 100%;
article.doc-body {
.pseudo-col();
padding: 15px;
@media (min-width: @screen-sm-min) {
padding: 15px 30px;
}
@media (min-width: @screen-md-min) {
max-width: 700px;
}
@media (min-width: @screen-lg-min) {
margin-left: 7%;
margin-top: 20px;
}
> * {
max-width: 100%;
}
}
}
main.o_aside_removed, main.o_slim_page {
max-width: 700px;
@media (min-width: @screen-lg-min) {
width: 100%;
padding-right: 0;
&:before {
.code-col();
}
section {
> * {
width: 54.633333%;
max-width: 600px;
float: left;
clear: left;
}
> h1, > h2, > h3, > h4, > h5, > h6 {
width: 100%;
float: none;
clear: none;
}
.doc-aside {
width: 41%;
float: none;
clear: none;
margin-right: 15px;
margin-left: 57%;
.content-switcher{
margin-top:0;
> ul {
margin-bottom: 0;
}
> ul > li {
color: @gray-light;
}
}
}
}
max-width: 760px;
}
article.doc-body {
@media (min-width: @screen-md-min) {
padding-left: 30px;
}
}
}
}
main.index .toctree-wrapper{
@media screen and(min-width: @screen-md){
main.has_code_col {
max-width: 700px;
> .row:first-child { //trigg first section
> .col-md-3:nth-child(3), > .col-md-3:nth-child(5) { //trig cards (title + 2, title + 4)
margin-right: 50%;
}
@media (min-width: @screen-lg-min) {
max-width: @container-lg;
}
position: relative;
.toc-single-entry{
position: absolute;
top: 0;
right: 0;
width: 50%;
padding-right: floor((@grid-gutter-width / 2)); // compensate bootstrap default gutter
> .col-md-3 {
width: 100%;
}
> *[class^="col-"] {
padding-left: 0; //remove Bootstrap default gutter
}
.card {
min-height: (@card_min-height * 2 ) + @card_margin-bottom;
}
.doc-aside, .doc-content {
.pseudo-col();
@media (max-width: @screen-md-max) {
padding: 0;
}
}
aside {
display: none;
}
article.doc-body {
> section {
max-width: 100%;
}
@media (min-width: @screen-lg-min) {
width: 100%;
max-width: none;
margin:0;
&:before {
.code-col();
}
> section {
position: relative;
display: block;
float: left;
width: 100%;
> * {
width: 48%;
float: left;
clear: left;
}
> h2, > h3, > h4, > h5, > h6, > h1 {
width: 48%;
float: none;
clear: none;
}
.doc-aside {
width: 49%;
float: none;
clear: none;
margin-left: 51%;
color: @gray-light;
font-size: 14px;
line-height: 1.45;
pre {
font-size: 12px;
}
}
}
}
}
}
}
article.doc-toc .toctree-wrapper > ul > li > span {
display: block;
font-size: 28px;
}
.code-fields{
display: table;
width: 100%;
.code-field{
display: table-row;
}
.code-field-body{
display: block;
padding-left: 15px;
@media screen and (min-width: @screen-md-min){
display: table-cell;
padding-left: 0;
}
}
.code-field-name{
width:auto;
display:block;
@media screen and (min-width: @screen-md-min){
width:20%;
padding-right: 20px;
display: table-cell;
}
}
ul {
margin: .2em 0;
padding: 0;
}
font-size: 28px;
}

View File

@ -2,6 +2,25 @@
// ================ Mixins =======================
// ================================================
// Code column layout mixins
// ------------------------------------------------------------------
.pseudo-col() {
position: relative;
min-height: 1px;
padding-right: 15px;
padding-left: 15px;
float: left;
width: 100%;
}
.code-col() {
content: "";
background: @doc_code-bg;
.box-shadow(inset 40px 0 40px -18px rgba(22, 24, 29, 0.3));
.o-position-absolute(0,0);
.size(50%, 100%);
}
// Utilities
// ------------------------------------------------------------------
.o-no-select {
@ -131,65 +150,11 @@
}
}
// Elevation Shadows
// Visual cue indicating the amount of separation between surfaces.
// An objects elevation determines the appearance of its shadow.
// ------------------------------------------------------------------
.deep-1-shadow() {
// Shadows
// --------------------------------------------------
.deep-1() {
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.17);
}
.deep-2-shadow() {
box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.1), 0 2px 2px 0 rgba(0, 0, 0, 0.05);
}
.deep-3-shadow() {
box-shadow: 0 13px 25px 0 rgba(0, 0, 0, 0.1), 0 11px 7px 0 rgba(0, 0, 0, 0.09);
}
.deep-4-shadow() {
box-shadow: 0 20px 40px 0 rgba(0, 0, 0, 0.1), 0 14px 12px 0 rgba(0, 0, 0, 0.07);
}
.deep-5-shadow() {
box-shadow: 0 27px 55px 0 rgba(0, 0, 0, 0.1), 0 17px 17px 0 rgba(0, 0, 0, 0.05);
}
.deep-transition() {
.o-transition(box-shadow, 0.3s, @o-ease);
}
.deep-1() {
.deep-1-shadow();
&.deep_hover:hover {
.deep-transition();
.deep-2-shadow();
}
}
.deep-2() {
.deep-2-shadow();
&.deep_hover:hover {
.deep-transition();
.deep-3-shadow();
}
}
.deep-3() {
.deep-3-shadow();
&.deep_hover:hover {
.deep-transition();
.deep-4-shadow();
}
}
.deep-4() {
.deep-4-shadow();
&.deep_hover:hover {
.deep-transition();
.deep-5-shadow();
}
}
.deep-5() {
.deep-5-shadow();
}
.transform(@args) {
-webkit-transform : @args;
@ -199,7 +164,8 @@
transform : @args;
}
//-- Material Design Icons
// Material Design Icons
// --------------------------------------------------
.mdi-icon(@content) {
font-family: 'Material-Design-Icons';
content: @content;
@ -210,13 +176,8 @@
-moz-osx-font-smoothing: grayscale;
}
.keyframes(@name; @arguments) {
@-moz-keyframes @name { @arguments(); }
@-webkit-keyframes @name { @arguments(); }
@keyframes @name { @arguments(); }
}
//-- Documentation Dropdown style
// Documentation Dropdown style
// --------------------------------------------------
.o-doc-dropdown {
> a.dropdown-toggle {
padding: 0 5px 0 10px;
@ -314,35 +275,3 @@
}
}
}
// Shadows
// --------------------------------------------------
.shadow-none {
.box-shadow(none);
}
.deep-1 {
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.17);
}
.deep-2 {
box-shadow: 0 6px 10px 0 rgba(0, 0, 0, 0.1), 0 2px 2px 0 rgba(0, 0, 0, 0.05);
}
.deep-3 {
box-shadow: 0 13px 25px 0 rgba(0, 0, 0, 0.1), 0 11px 7px 0 rgba(0, 0, 0, 0.09);
}
.deep-4 {
box-shadow: 0 20px 40px 0 rgba(0, 0, 0, 0.1), 0 14px 12px 0 rgba(0, 0, 0, 0.07);
}
.deep-5 {
box-shadow: 0 27px 55px 0 rgba(0, 0, 0, 0.1), 0 17px 17px 0 rgba(0, 0, 0, 0.05);
}
// overwrite bootstrap inline forcing
.img-responsive {
display: inline-block;
}
.img-responsive.center-block {
display: block;
}

View File

@ -5,10 +5,6 @@
header, footer{
display: none;
}
.fadeInUp, .fadeIn{
.opacity(1)!important;
.animation(none);
}
#main_navbar{
position: relative;

File diff suppressed because it is too large Load Diff

View File

@ -6,9 +6,10 @@
@import "variables";
@import "mixins";
@import "animations";
@import "typography";
@import "components";
@import "layout";
@import "index";
@import "header";
@import "footer";
@import "aside";
@ -28,6 +29,20 @@
background-color: @footer-bg-color;
color: @gray-lighter;
}
> .o_sub_nav #o_sub-menu #searchbox {
display: flex;
align-items: center;
justify-content: center;
> form {
display: flex;
flex-grow: 1;
> .form-control {
border-radius: 0;
}
}
}
> .o_sub_nav #o_sub-menu .o_breadcrumb {
@ -71,7 +86,6 @@
line-height: @w-sub-nav-height;
letter-spacing: -0.1px;
word-spacing: -1px;
font-size: 0.9em;
display: inline-block;
height: 100%;
max-width: 80px;
@ -252,587 +266,6 @@
}
}
#wrap {
z-index: 1;
position: relative;
background: @gray-lightest;
padding-bottom: 40px;
}
main {
z-index: 0;
position: relative;
margin: -10px auto 0;
display: block;
border-radius: 2px;
background-color: @doc_paper;
.deep-1;
@media screen and(min-width: @screen-sm) {
margin: -40px auto 0px;
}
}
main.index {
.box-shadow(none);
padding-top: 50px;
background:transparent;
.row > h2 { // section title
margin-bottom: 1em;
margin-top: 1.5em;
}
.card {
border-radius: 2px;
position: relative;
overflow: hidden;
margin-bottom: @card_margin-bottom;
min-height: @card_min-height;
background-color: @doc_paper;
will-change: transform;
.deep-2;
.transform(scale3d(0, 0, 0) translate3d(50px, 0, 0));
.transition( all .5s @o-ease );
a, a:hover {
color: @text-color;
text-decoration: none;
border-radius: 2px 2px 0 0;
}
.card-img{
.transition(all .5s @o-ease);
overflow:hidden;
span {
position: relative;
display: block;
background-size: cover;
background-position: 50%;
will-change: transform;
.square(100%);
.transform(scale3d(1, 1, 1) translate3d(0, 0, 0));
.transform-origin(50%);
.opacity(1);
.transition(all .5s @o-ease);
}
}
figcaption {
.opacity(1);
display: block;
font-weight: @fw_regular;
font-family: @headings-font-family;
color: @headings-color;
margin: 0;
background-color: white;
font-size: 1.2em;
width: 100%;
padding: 8px 12px;
.o-position-absolute(0);
.transition(all .5s @o-ease );
}
&:hover .card-img span{
.transform(scale3d(1.02, 1.02, 1.02) translate3d(0, 0, 0));
}
}
.toc-single-entry .card figcaption {
@media screen and(min-width: @screen-md){
font-size: 1.5em;
padding: 20px 15px;
}
}
.col-md-6 .card, .col-md-4 .card{
@media screen and(min-width: @screen-md){
min-height: 300px;
figcaption{
font-size: 1.5em;
padding: 20px 15px;
}
}
}
&.animating .card {
.transform(scale3d(1, 1, 1) translate3d(0, 0, 0));
}
}
.card-img {
.o-gradient();
.o-position-absolute(0, 0);
.translate3d(0;0;0);
.square(100%);
display: block;
background-size: cover;
background-position: 50%;
}
.card.top {
padding: 10% 0 8%;
position: relative;
overflow: hidden;
margin: 0;
.o-gradient();
.animation(fadeIn 1s);
.box-shadow(none);
.transform-origin(50% 0px 0px);
@media screen and (min-width: @screen-sm-min) and (max-width: (@screen-md-min - 1)) {
padding-top: 12%;
}
#wrap.index & {
padding: 0 0 4%;
@media screen and (min-width: @screen-sm-min) {
padding-top: 12%;
}
@media screen and (min-width: @screen-lg-min) {
padding-top: 8%;
}
}
&.stacked{
background:transparent;
.transition(background 1s);
}
&:before {
content:"";
display: block;
background-image: url("img/banner_bg.png");
background-size: cover;
background-position: 50%;
.o-position-absolute(0, 0);
.square(100%);
}
&:hover {
.box-shadow(none);
}
.card-img {
background-image: url("img/banner_bg.png");
}
@media screen and (min-width: @screen-sm-min) and (max-width: (@screen-md-min - 1)) {
padding: 12% 0 8%;
#wrap.index & {
padding: 12% 0 4%;
}
}
.container {
position: relative;
h1 {
.h2;
color: white;
@media screen and (min-width: @screen-sm-min) {
.h1;
color: white;
}
}
}
}
.card.top.has_banner {
background: @footer-bg-color;
&:before {
display: none;
}
.card-img {
opacity: 0.35;
}
}
// the first level of an application toctree should look more like sections
.toctree-wrapper > ul {
list-style: none;
padding: 0;
> li.toctree-l1 > span {
font-family: @headings-font-family;
// copy h2 content :/
.h2()
}
}
// Elements
// -----------------------------------------------
hr.divider {
border-color: fadeout(@gray-lightest, 60%);
position: absolute;
width: 900%;
margin-left: -13px;
}
main .alert {
padding: 15px;
border-radius: 0;
border-width: 0 0 0 3px;
position: relative;
max-width: 95%;
display: inline-block;;
@media (min-width: @screen-sm-min){
padding-left: 5.5em;
}
> p, > ul {
margin: .5em 0;
}
.alert-info; // 'INFO' is the default style
> h3, > .alert-title {
font-size: 1.642857143em;
line-height: 1em;
margin: 0 0 10px 0;
font-size: 14px;
font-weight: @fw_bold;
font-family: @headings-font-family;
&:before {
.mdi-icon("\e639");
.o-position-absolute(50%, auto, auto, 6px);
.translate(0, -0.15em);
font-size: 4em;
@media (max-width: @screen-sm-min){
display:none;
}
}
}
&.alert-success {
border-color: lighten(@brand-success, 30%);
background-color: lighten(@brand-success, 45%);
color: darken(@brand-success, 35%);
> .alert-title, > h3 {
color: @brand-success
}
> .alert-title:before, > h3:before {
content: "\e625";
}
}
&.alert-info, &.tip {
border-color: lighten(@brand-info, 30%);
background-color: lighten(@brand-info, 45%);
color: darken(@brand-info, 35%);
> .alert-title, > h3 {
color: @brand-info
}
> .alert-title:before, > h3:before {
content: "\e639";
}
}
&.alert-warning, &.warning {
border-color: lighten(@brand-warning, 30%);
background-color: lighten(@brand-warning, 35%);
color: darken(@brand-warning, 35%);
> .alert-title, > h3 {
color: @brand-warning
}
> .alert-title:before, > h3:before {
content: "\e6a4";
}
}
&.alert-danger {
border-color: lighten(@brand-danger, 30%);
background-color: lighten(@brand-danger, 40%);
color: darken(@brand-danger, 35%);
> .alert-title, > h3 {
color: @brand-danger
}
> .alert-title:before, > h3:before {
content: "\e6a4";
}
}
&.alert-exercise {
border-color: lighten(@doc_exercise, 30%);
background-color: lighten(@doc_exercise, 40%);
color: darken(@doc_exercise, 35%);
> .alert-title, > h3 {
color: @doc_exercise;
}
> .alert-title:before, > h3:before {
.translate(0;0);
top: 28px;
content: "\e709";
}
}
&.alert-go_to {
border-color: lighten(@brand-info, 30%);
background-color: lighten(@brand-info, 45%);
border-width: 2px;
margin: 2em auto;
a{
color: darken(@brand-info, 25%);
}
> .alert-title, > h3 {
color: @brand-info
}
> .alert-title:before, > h3:before {
content: "\e70d";
}
}
&.doc-content{
@media (min-width: @screen-lg-min) {
max-width: 55%;
}
}
}
img.img-responsive {
margin-bottom: (@line-height-computed / 2);
}
.figure {
h4 {
margin: 0.5em 0 1.5em;
padding-left: 1em;
font-size: 1em;
font-style: italic;
}
}
.pq-patch{
background: @gray-light;
em {padding-left: 10px;}
}
span.menuselection{
font-weight: @fw_semibold;
}
.list-group-item {
border: none;
background:transparent;
}
dt { margin: .5em 0 .3em;}
blockquote {
font-family: @font-family-serif;
font-weight: @fw_semibold;
font-style: italic;
footer {
font-family: @font-family-base;
background: transparent;
text-align: left;
color: @text-color;
font-weight: normal;
font-style: normal;
cite {
font-style: italic;
}
}
@media (min-width:@screen-md-min) {
border-left: 3px solid fade(@brand-primary, 50%);
}
}
code, .code {
font-size: 0.8em;
font-weight: @fw_semibold;
color: darken(@brand-primary, 30%);
background-color: lighten(@brand-primary, 50%);
}
.btn {
border-radius: 0;
}
dd {
margin-left: 40px;
}
.code-fields {
font-size: .9em;
border: 2px solid @gray-light;
.code-field {
}
.code-field-body {
}
.code-field-name {
font-weight: @fw_semibold;
color: @headings-color;
&:after{
content:":";
}
@media screen and (min-width: @screen-md-min){
font-size: .9em;
text-align: right;
}
}
ul {
list-style: none;
strong {
color: @headings-color;
font-family:@font-family-monospace;
}
em {
color: @headings-color;
font-family:@font-family-monospace;
font-weight: @fw_semibold;
font-size: .9em;
}
}
}
table, .table {
font-size: 0.9em;
}
.code-class,
.code-staticmethod, .code-classmethod, .code-method, .code-function,
.code-attribute, .code-data {
// indents *all* content
padding-left: 20px;
margin-bottom: 2em;
// except for item title which gets dedented back
> h6 {
margin-left: -20px;
margin-bottom: 0.3em;
.viewcode-link {
display: none;
float: right
}
&:hover .viewcode-link {
display: inline;
}
}
p {
margin-bottom: .5em;
}
}
main.has_code_col{
@media (min-width: @screen-lg-min) {
.doc-aside {
color: @gray-light;
pre{
font-size: 12px;
}
}
}
}
article.doc-body {
background: @doc_paper;
section.doc-content:first-of-type{
> p:first-child{
.lead;
}
}
&.index-category {
min-height: 300px;
min-height: 30vh;
li.toctree-l1 {
padding: 5px 0;
}
}
}
.content-switcher {
margin-top: 1.5em;
> ul {
font-size: 10px;
padding: 0;
margin: 0 0 10px;
.transition(all .2s ease);
> li {
color: text-color;
font-weight: @fw_semibold;
border-bottom: 1px solid transparent;
margin: 5px;
font-size: 1.3em;
cursor: pointer;
display: inline-block;
list-style: none;
.transition(all .2s);
.opacity(0.6);
&.active {
border-bottom: 1px solid @brand-primary;
.opacity(1);
}
}
}
&:hover > ul > li {
.opacity(1);
}
> .tabs > * {
display: none;
max-width: 100%;
overflow-x: auto;
}
> .tabs > .active {
display: block;
}
}
.highlight {
background: @doc_code-bg;
color: @gray-light;
border-radius: @border-radius-base;
margin-bottom: (@line-height-computed / 2);
pre {
margin-bottom: 0;
}
}
pre {
font-size: 0.8em;
color: @gray-light;
background: @doc_code-bg;
font-family: @font-family-monospace;
font-weight: @fw_semibold;
position: relative;
border: none;
max-width: 100%;
overflow: auto;
margin: 0;
margin-bottom: (@line-height-computed / 2);
}
#mask {
.opacity(0);
position: fixed;
z-index: @zIndex--mask;
top: 0;
left: 0;
.size(100%; 0);
background-color: fade(black, 20%);
.transition(opacity .3s);
&.active {
.opacity(1);
display: block;
.square(100%);
.transition(opacity .3s);
}
}
// Special Pages
@ -841,5 +274,3 @@ pre {
#thinking-modular > .clearfix.themes {
margin-bottom: 3em;
}

View File

@ -1,21 +1,20 @@
// =============================================================================
// Typography
// =============================================================================
@margin-base: 5px;
// Font rendering
// ----------------------------------------
body {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeLegibility;
}
// Headings
// ----------------------------------------
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
h1, h2, h3, h4, h5, h6 {
text-rendering: geometricPrecision;
letter-spacing: -0.01em;
line-height: 1.4;
@media (min-width: @screen-lg-min) {
.has_code_col .doc-aside &{
@ -24,35 +23,152 @@ h1, h2, h3, h4, h5, h6,
}
}
h1, h2, .h1, .h2 {
margin-top: @line-height-computed * 1.5;
font-weight: @fw_light;
b, strong, a {
font-weight: @fw_regular;
.headings-margin-small () {
> h2, > h3, > h4, > h5, > h6 {
margin-top: @margin-base*2;
}
}
h3, .h3, h4, .h4, h5, h6, .h5, .h6 {
font-weight: @fw_regular;
b, strong, a {
font-weight: @fw_medium;
}
}
h4, .h4, h5, h6, .h5, .h6 {
margin-top: @line-height-computed;
margin-bottom: (@line-height-computed / 3);
.headings-bordered () {
padding-bottom: @margin-base;
border-bottom: 2px solid #f4f6f7;
}
// Lists
// ----------------------------------------
article.doc-body {
ul, ol {
&:not(:empty) {
margin-bottom: (@line-height-computed / 2);
// Vertical rhythm
> section {
padding-bottom: @margin-base*2;
> :last-child {
margin-bottom: 0;
}
> h2, > h3, > h4, > h5, > h6 {
margin-bottom: @margin-base;
margin-top: @margin-base*8;
&:last-child {
margin-bottom: -@margin-base*6;
.headings-bordered();
}
}
> h2 {
.headings-bordered();
}
> h5, > h6 {
font-weight: 500;
}
&:first-of-type {
.headings-margin-small();
&:empty, &.hidden {
display: none;
+ section {
.headings-margin-small();
}
}
}
}
ul, ol {
&:not(:empty) {
margin-bottom: (@line-height-computed / 3);
// Typography components
> section {
line-height: 26px;
}
a, a:hover {
text-decoration: underline;
}
blockquote {
font-size: 15px;
line-height: 26px;
&:not(:first-child) {
margin-top: 17px;
}
}
dl {
dt code {
font-size: 0.9em;
}
dd {
margin: 2px 0 @grid-gutter-width/2 @grid-gutter-width/2;
}
}
ol, ul {
line-height: 26px;
padding: 0;
list-style: none;
counter-reset: a;
li {
margin: 5px 0;
position: relative;
padding-left: 30px;
&:before {
content: "";
display: block;
.o-position-absolute(9px, @left: 10px);
.square(6px);
border-radius: 50%;
background: #939da3;
}
p {
margin: 0;
}
h2, h3, h4, h5, h6 {
margin-top: 0;
padding-top: 0;
}
}
}
ol > li:before {
counter-increment: a;
content: counter(a);
color: #fff;
font-size: 13px;
font-weight: bold;
line-height: 1;
text-align: center;
padding: 4px 0;
.square(20px);
border-radius: 10px;
.o-position-absolute(3px, @left: 0);
}
.o_has_permalink_marker {
transition: all, 0.3s;
padding-left: 0;
i {
cursor: pointer;
visibility: hidden;
margin-left: 0.1em;
font-size: 0.8em;
padding: 0.2em;
.rotate(-45deg);
}
&:hover {
i {
visibility: visible;
}
}
&.o_marked {
padding-left: 10px;
background-color: #fff7d1;
}
}
}

View File

@ -78,11 +78,8 @@
// Typography
// ===============================================
//== Fonts
@import url(https://fonts.googleapis.com/css?family=Work+Sans:300,400,500,600,700&subset=latin,latin-ext);
//== Font sizes/weigths
@font-size-base : 15px;
@font-size-base : 16px;
@fw_light : 300;
@fw_regular : 400;
@ -91,19 +88,20 @@
@fw_bold : 700;
//== Paragraphs
@font-family-base : -apple-system, BlinkMacSystemFont, Helvetica, "Helvetica Neue", Arial, sans-serif;
@text-color : saturate(@gray-dark, 5%);
@font-family-base : -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
@text-color : #373e42;
//== Headings
@headings-color : saturate(@gray-darker, 15%);
@headings-font-family : "Work Sans", sans-serif;
@headings-font-weight : @fw_light;
@headings-font-family : @font-family-base;
@headings-font-weight : @fw_regular;
@headings-small-color : @headings-color;
@display1-size : 6rem;
@display2-size : 5.5rem;
@display3-size : 4.5rem;
@display4-size : 3.5rem;
@font-size-h2: 30px;
@font-size-h3: 24px;
@font-size-h4: 19px;
@font-size-h5: 17px;
@font-size-h6: 17px;
//== Global textual link color.
@link-color : @o-violet-dark;
@ -160,8 +158,7 @@
// Cards
// --------------------------------------------------
@card_min-height: 200px;
@card_margin-bottom: 20px;
@card_margin-bottom: 25px;

View File

@ -10,11 +10,11 @@
{%- if pagename != "search" and builder != "singlehtml" %}
<li id="searchbox" style="display: none; margin: 0 0 0 10px;" role="search">
<form class="search form-inline" action="{{ pathto('search') }}" method="get">
<form class="search form-inline input-group-sm" action="{{ pathto('search') }}" method="get">
<input type="text" class="form-control" name="q" id="q" placeholder="Search..." />
<input type="hidden" name="area" value="default" />
<input type="hidden" name="check_keywords" value="yes" />
<button type="submit" value="Go" class="btn btn-default">Go</button>
<button type="submit" value="Go" class="btn btn-default btn-sm">Go</button>
</form>
</li>
<script type="text/javascript">$('#searchbox').show(0);</script>

View File

@ -2,19 +2,12 @@
import os.path
import posixpath
import re
import urllib
from docutils import nodes
from sphinx import addnodes, util
from sphinx import addnodes, util, builders
from sphinx.locale import admonitionlabels
from . import pycompat
try:
from urllib import url2pathname
except ImportError:
# P3
from urllib.request import url2pathname
from urllib.request import url2pathname
def _parents(node):
@ -45,6 +38,11 @@ class BootstrapTranslator(nodes.NodeVisitor, object):
]
def __init__(self, builder, document):
# order of parameter swapped between Sphinx 1.x and 2.x, check if
# we're running 1.x and swap back
if not isinstance(builder, builders.Builder):
builder, document = document, builder
super(BootstrapTranslator, self).__init__(document)
self.builder = builder
self.body = []
@ -58,6 +56,7 @@ class BootstrapTranslator(nodes.NodeVisitor, object):
self.context = []
self.section_level = 0
self.config = builder.config
self.highlightlang = self.highlightlang_base = self.builder.config.highlight_language
self.highlightopts = getattr(builder.config, 'highlight_options', {})
@ -67,7 +66,7 @@ class BootstrapTranslator(nodes.NodeVisitor, object):
self.param_separator = ','
def encode(self, text):
return pycompat.to_text(text).translate({
return text.translate({
ord('&'): u'&amp;',
ord('<'): u'&lt;',
ord('"'): u'&quot;',
@ -76,7 +75,7 @@ class BootstrapTranslator(nodes.NodeVisitor, object):
})
def starttag(self, node, tagname, **attributes):
tagname = pycompat.to_text(tagname).lower()
tagname = tagname.lower()
# extract generic attributes
attrs = {name.lower(): value for name, value in attributes.items()}
@ -111,7 +110,7 @@ class BootstrapTranslator(nodes.NodeVisitor, object):
# only "space characters" SPACE, CHARACTER TABULATION, LINE FEED,
# FORM FEED and CARRIAGE RETURN should be collapsed, not al White_Space
def attval(self, value, whitespace=re.compile(u'[ \t\n\f\r]')):
return self.encode(whitespace.sub(u' ', pycompat.to_text(value)))
return self.encode(whitespace.sub(u' ', str(value)))
def astext(self):
return u''.join(self.body)
@ -432,7 +431,12 @@ class BootstrapTranslator(nodes.NodeVisitor, object):
tagname = 'th'
else:
tagname = 'td'
self.body.append(self.starttag(node, tagname))
attrs = {}
if 'morerows' in node:
attrs['rowspan'] = node['morerows']+1
if 'morecols' in node:
attrs['colspan'] = node['morecols']+1
self.body.append(self.starttag(node, tagname, **attrs))
self.context.append(tagname)
def depart_entry(self, node):
self.body.append(u'</{}>'.format(self.context.pop()))
@ -647,7 +651,7 @@ class BootstrapTranslator(nodes.NodeVisitor, object):
self.body.append(title if title else util.nodes.clean_astext(env.titles[ref]))
self.body.append(u'</h2>')
entries = [(title, ref)] if not toc else ((e[0], e[1]) for e in toc[0]['entries'])
entries = [(title, ref)] if not toc else ((e[0], e[1]) for e in list(toc)[0]['entries'])
for subtitle, subref in entries:
baseuri = self.builder.get_target_uri(node['parent'])

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 KiB

View File

@ -5,5 +5,4 @@ Configuration
.. toctree::
:titlesonly:
configuration/account_type
configuration/fiscal_year

View File

@ -1,84 +0,0 @@
==================================================
What is an account type and how do I configure it?
==================================================
What is an account type ?
==========================
An account type is a name or code given to an account that indicates the
account's purpose.
In Odoo, Account Types are used for information purpose, to generate
country-specific legal reports, set the rules to close a fiscal year and
generate opening entries.
Basically Account types categorize general account with some specific
category according to its behaviour or purpose.
Which are the account types in Odoo ?
=====================================
Odoo covers all accounting types. Therefore, you cannot create new
account types. Just pick the one related to your account.
+-----------------------------+
| **List of account types** |
+=============================+
| Receivable |
+-----------------------------+
| Payable |
+-----------------------------+
| Bank and Cash |
+-----------------------------+
| Current Assets |
+-----------------------------+
| Non-current Assets |
+-----------------------------+
| Prepayments |
+-----------------------------+
| Fixed Assets |
+-----------------------------+
| Current Liabilities |
+-----------------------------+
| Non-current Liabilities |
+-----------------------------+
| Equity |
+-----------------------------+
| Current Year Earnings |
+-----------------------------+
| Other Income |
+-----------------------------+
| Income |
+-----------------------------+
| Depreciation |
+-----------------------------+
| Expenses |
+-----------------------------+
| Direct Costs |
+-----------------------------+
How do I configure my accounts?
===============================
Account types are automatically created when installing a chart of
account. By default, Odoo provides a lot of chart of accounts, just
install the one related to your country.
It will install generic accounts. But if it does not cover all your
cases, you can create your own accounts too.
.. note::
If you are a Saas User, your country chart of account is automatically installed.
To create a new accounts, go to the Accounting application. Open the
menu :menuselection:`Adviser --> Chart of Accounts`, the click on the
**Create** button.
.. image:: ./media/type01.png
:align: center
.. demo:fields:: account.action_account_form
.. demo:action:: account.action_account_form
View *Create Account* in our Online Demonstration

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

View File

@ -6,3 +6,4 @@ Getting Started
:titlesonly:
getting_started/setup
getting_started/chart_of_accounts

View File

@ -0,0 +1,173 @@
=================
Chart of Accounts
=================
The **Chart of Accounts (COA)** is the list of all the accounts used to record financial
transactions in the general ledger of an organization.
The accounts are usually listed in the order of appearance in the financial reports. Most of the
time, they are listed as follows :
- Balance Sheet accounts
* Assets
* Liabilities
* Equity
- Profit & Loss
* Income
* Expense
When browsing your Chart of Accounts, you can filter the accounts by number, in the left column, and
also group them by Account Type.
.. image:: media/chart_of_accounts01.png
:align: center
:alt: Group the accounts by type in Odoo Accounting
Configuration of an Account
===========================
The country you select at the creation of your database (or additional company on your database)
determines which **Fiscal Localization Package** is installed by default. This package includes a
standard Chart of Accounts already configured according to the country's regulations. You can use
it directly or set it according to your company's needs.
.. warning::
It is not possible to modify the **Fiscal Localization** of a company once a Journal Entry has
been posted.
To create a new account, go to :menuselection:`Accounting --> Configuration --> Chart of Accounts`,
click on *Create*, and fill out the form.
Code and Name
-------------
Each account is identified by its **Code** and **Name**, which also indicates the account's purpose.
Type
----
Configuring correctly the **Account Type** is critical as it serves multiple purposes:
- Information on the account's purpose and behavior
- Generate country-specific legal and financial reports
- Set the rules to close a fiscal year
- Generate opening entries
To configure an account type, open the **Type** field's drop-down selector and select the right
type among the following list:
+---------------+--------------+-------------------------+
| Report | Category | Account Types |
+===============+==============+=========================+
| Balance Sheet | Assets | Receivable |
| | +-------------------------+
| | | Bank and Cash |
| | +-------------------------+
| | | Current Assets |
| | +-------------------------+
| | | Non-current Assets |
| | +-------------------------+
| | | Prepayments |
| | +-------------------------+
| | | Fixed Assets |
| +--------------+-------------------------+
| | Liabilities | Payable |
| | +-------------------------+
| | | Credit Card |
| | +-------------------------+
| | | Current Liabilities |
| | +-------------------------+
| | | Non-current Liabilities |
| +--------------+-------------------------+
| | Equity | Equity |
| | +-------------------------+
| | | Current Year Earnings |
+---------------+--------------+-------------------------+
| Profit & Loss | Income | Income |
| | +-------------------------+
| | | Other Income |
| +--------------+-------------------------+
| | Expense | Expense |
| | +-------------------------+
| | | Depreciation |
| | +-------------------------+
| | | Cost of Revenue |
+---------------+--------------+-------------------------+
|Other | Other | Off-Balance Sheet |
+---------------+--------------+-------------------------+
Assets, Deferred Expenses, and Deferred Revenues Automation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Some Account Types display a new field **to automate** the creation of :ref:`Assets
<assets-automation>` entries, :ref:`Deferred Expenses <deferred-expenses-automation>` entries,
and :ref:`Deferred Revenues <deferred-revenues-automation>` entries.
You have three choices for the **Automation** field:
#. **No:** this is the default value. Nothing happens.
#. **Create in draft:** whenever a transaction is posted on the account, a draft entry is created,
but not validated. You must first fill out the corresponding form.
#. **Create and validate:** you must also select a Model. Whenever a transaction is posted on the
account, an entry is created and immediately validated.
.. note::
Please refer to the related documentation for more information.
Default Taxes
-------------
Select a **default tax** that will be applied when this account is chosen for a product sale or
purchase.
Tags
----
Some accounting reports require **tags** to be set on the relevant accounts. By default, you can
choose among the tags that are used by the *Cash Flow Statement*.
Account Groups
--------------
**Account Groups** are useful to list multiple accounts as *sub-accounts* of a bigger account and
thus consolidate reports such as the **Trial Balance**.
To create a new Account Group, open the account you want to configure as sub-account, click on the
*Group* drop-down selector, select *Create and Edit...*, fill out the form, and save. Next,
set all the sub-accounts with the right Account Group.
To display your **Trial Balance** report with your Account Groups, go to :menuselection:`Accounting
--> Reporting --> Trial Balance`, then open the *Options* menu and select **Hierarchy and
Subtotals**.
.. image:: media/chart_of_accounts02.png
:align: center
:alt: Account Groups in the Trial Balance in Odoo Accounting
Allow Reconciliation
--------------------
Some accounts, such as accounts made to record the transactions of a payment method, can be used for
the reconciliation of journal entries.
For example, an invoice paid with a credit card can be *marked as paid* if reconciled with the
payment. Therefore, the account used to record credit card payments needs to be configured as
*allowing reconciliation*.
To do so, check the **Allow Reconciliation** box and save.
Deprecated
----------
It is not possible to delete an account once a transaction has been recorded on it. You can make
them unusable by using the **Deprecated** feature.
To do so, check the **Deprecated** box and save.
.. seealso::
* :doc:`../../payables/supplier_bills/assets`
* :doc:`../../payables/supplier_bills/deferred_expenses`
* :doc:`../../receivables/customer_invoices/deferred_revenues`

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -251,4 +251,4 @@ You have three choices for the **Automate Assets** field:
fully automate its purchase. (see: :ref:`product-assets-account`).
.. seealso::
* :doc:`../../others/configuration/account_type`
* :doc:`../../overview/getting_started/chart_of_accounts`

View File

@ -164,6 +164,8 @@ model button fills out the form according to that model.
:align: center
:alt: Deferred Expense model button in Odoo Accounting
.. _deferred-expenses-automation:
Automate the Deferred Expenses
==============================
@ -190,4 +192,4 @@ You have three choices for the **Automate Deferred Expense** field:
products`_).
.. seealso::
* :doc:`../../others/configuration/account_type`
* :doc:`../../overview/getting_started/chart_of_accounts`

View File

@ -164,6 +164,8 @@ model button fills out the form according to that model.
:align: center
:alt: Deferred Revenue model button in Odoo Accounting
.. _deferred-revenues-automation:
Automate the Deferred Revenues
==============================
@ -189,5 +191,5 @@ You have three choices for the **Automate Deferred Revenue** field:
automate its sale. (see: `Choose a different Income Account for specific products`_).
.. seealso::
* :doc:`../../others/configuration/account_type`
* :doc:`../../overview/getting_started/chart_of_accounts`
* `Odoo Academy: Deferred Revenues (Recognition) <https://www.odoo.com/r/EWO>`_

10
contributing.rst Normal file
View File

@ -0,0 +1,10 @@
:banner: banners/contributing.png
============
Contributing
============
.. toctree::
:titlesonly:
contributing/documentation

View File

@ -0,0 +1,12 @@
:banner: banners/contributing.png
=================================
Contributing to the documentation
=================================
.. toctree::
:titlesonly:
documentation/introduction_guide
documentation/rst_cheat_sheet
documentation/guidelines

View File

@ -0,0 +1,162 @@
:banner: banners/contributing.png
==========
Guidelines
==========
.. _contributing/relative-links:
Use relative links for internal URLs
====================================
If you need to reference an internal documentation page or a file that is not sitting in the same
directory as your current page, always make use of *relative file paths* rather than *absolute file
paths*. An absolute file path indicates the location of the target from the root of its file tree. A
relative file path makes use of smart notations (such as ``../`` git that redirects to the parent
folder) to indicate the location of the target *relative* to that of the source document.
Example
-------
Given the following source file tree:
::
documentation-user
├── sales
│ └── products_prices
│ │ └── products
│ │ │ └── import.rst
│ │ │ └── variants.rst
│ │ └── prices.rst
A reference to the rendered :file:`prices.html` and :file:`variants.html` could be made from
:file:`import.rst` as follows:
#. Absolute:
- ``https://odoo.com/documentation/user/13.0/sales/products_prices/prices.html``
- ``https://odoo.com/documentation/user/13.0/sales/products_prices/products/variants.html``
#. Relative:
- ``../prices.html``
- ``variants.html``
The relative links are clearly superior in terms of readability and stability: the references
survive version updates, folder name changes and file tree restructurations.
.. _contributing/line-length-limit:
Start a new line before the 100th character
===========================================
In RST, it is possible to break a line without forcing a line break on the rendered HTML. Make use
of this feature to write **lines of maximum 100 characters**. A line break in a sentence results in
an additional whitespace in HTML. That means that you do not need to leave a trailing whitespace at
the end of a line to separate words.
.. tip::
You can safely break a line around the separators (``-->``) of ``menuselection`` directives and
anywhere in a hyperlink reference. For the ``doc``, ``ref`` and ``download`` directives, this is
only true for the label part of the reference.
Example: Line breaks within directive and inline markup
-------------------------------------------------------
.. code-block:: rst
To register your seller account in Odoo, navigate to :menuselection:`Sales --> Configuration
--> Settings --> Amazon Connector --> Amazon Accounts` and click on **CREATE**. The **Seller
ID** can be found under the link **Your Merchant Token**.
Be consistent with indentation
==============================
Use only spaces (never tabs).
Use as many spaces at the beginning of an indented line as needed to align it with the first
character of the directive in the line above. This usually implies 3 spaces but you only need 2 for
bulleted lists.
Example: The first ``:`` is below the ``i`` (3 spaces)
------------------------------------------------------
.. code-block:: rst
.. image:: media/example.png
:align: center
:alt: example
Example: The ``:titlesonly:`` and page references start below the ``t`` (3 spaces)
----------------------------------------------------------------------------------
.. code-block:: rst
.. toctree::
:titlesonly:
payables/supplier_bills
payables/pay
Example: Continuation lines resume below the ``I``s of “Invoice” (2 spaces)
----------------------------------------------------------------------------
.. code-block:: rst
- Invoice on ordered quantity: invoice the full order as soon as the sales order is confirmed.
- Invoice on delivered quantity: invoice on what you delivered even if it's a partial delivery.
.. _contributing/menuselection:
Use the menuselection directive
===============================
Although chaining characters ```` and menu names works fine to indicate a user which menus to
click, it is best to use the ``menuselection`` directive (see
:ref:`contributing/specialized-directives`) for the same result. Indeed, it renders the menus chain
consistently with the rest of the documentation and would automatically adapt to the new graphic
chart if we were to switch to a new one. This directive is used inline as follows:
``:menuselection:`Settings --> Products --> Variants```.
.. _contributing/resilient-code:
Write resilient code
====================
- Prefer the use of ``#.`` in numbered lists instead of ``1.``, ``2.``, etc. This removes the risk
of breaking the numbering when adding new elements to the list and is easier to maintain.
- Avoid using implicit hyperlink targets and prefer internal hyperlink targets instead. Referencing
the implicit target ``How to print quotations?`` is more prone to break than a reference to the
explicit target ``_print_quotation`` which never appears in the rendered HTML and is thus even
less likely to be modified.
.. _contributing/hyperlink-target-prefix:
Prefix hyperlink targets with application names
===============================================
As hyperlink targets are visible from the entire documentation when referenced with the ``ref``
directive, it is recommended to prefix the target name with that of the related application. For
instance, naming a target ``_amazon/form`` instead of ``_form`` avoids unwanted behaviors and makes
the purpose of the target clear.
.. _contributing/hyperlink-target-resilience:
Dont break hyperlink targets
=============================
When refactoring (improving without adding new content) section headings or hyperlink targets, take
care not to break any hyperlink reference to these targets or update them accordingly.
.. _contributing/single-underscore:
Use single-underscore suffixes for hyperlink references
=======================================================
| Although using a double-underscore suffix works most of the time for classic hyperlink references,
it is not recommended as double-underscores normally indicate an anonymous hyperlink reference.
This is a special kind of hyperlink reference that makes use of nameless hyperlink targets
consisting only of two underscore.
| tl;dr: Double-underscore suffixes work until they dont and are bad practice, use
single-underscore suffixes instead.

View File

@ -0,0 +1,399 @@
:banner: banners/contributing.png
==================
Introduction guide
==================
**First of all, thank you for landing here and helping us improve the user documentation of Odoo!**
This introductory guide will help you acquire the tools and knowledge you need to write
documentation, whether you plan to make a minor content change or document an application from
scratch.
.. note::
This tutorial only concern the `user documentation
<https://www.odoo.com/documentation/user/index.html>`_ of Odoo. The documentation for `developing
in Odoo <https://www.odoo.com/documentation/master/index.html>`_ in maintained alongside the
source code of Odoo at `github.com/odoo/odoo <https://github.com/odoo/odoo/tree/master/doc>`_.
.. _contributing/rst-intro:
reStructuredText
================
Our documentation is written in **reStructuredText** (RST), a `lightweight markup language
<https://en.wikipedia.org/wiki/Lightweight_markup_language>`_ consisting of normal text augmented
with markup which allows including headings, images, notes, and so on. This might seem a bit
abstract but there is no need to worry. :abbr:`RST (reStructuredText)` is not hard to learn,
especially if you intend to make only small changes to the content.
If you need to learn about a specific markup, head over to :doc:`our cheat sheet for RST
<rst_cheat_sheet>` which contains all the information that you should ever need for the user
documentation of Odoo.
.. important::
We kindly ask you to observe a set of :doc:`guidelines <guidelines>` as you write :abbr:`RST
(reStructuredText)`. This ensures that you stay consistent with the rest of the documentation and
facilitates the approval of your content changes as they are reviewed by a redactor at Odoo.
.. seealso::
- :doc:`rst_cheat_sheet`
- :doc:`guidelines`
.. _contributing/getting-started:
Getting started
===============
As our documentation is maintained on GitHub, you will need a free GitHub account. Click `here
<https://github.com/join>`_ to create one.
Now, depending on whether you want to update existing content, or rather work on new content and
make file changes, you have two courses of action:
#. **For small changes** in ``.rst`` files only, i.e. addition/edition of paragraphs or typos, **we
suggest that you use the GitHub interface**. This is the easiest and fasted way to submit your
request for changes for the documentation and is suitable for non-technical people. Read
:ref:`contributing/github-interface` to learn how to use this method.
#. **For more complex cases**, it is necessary to **use Git and work from a local copy of the
documentation**. This method seems intimidating but only requires basic knowledge of Git. See
:ref:`contributing/canonical-git-workflow` for more information on this method.
.. _contributing/github-interface:
Use the GitHub interface
========================
#. Verify that you are browsing the documentation in the version that you intend to change. The
version can be selected from the dropdown in the top menu.
.. image:: media/version-selector.png
#. Head over to the page that you want to change and click on the **Edit on GitHub** button in the
bottom of the left menu.
.. image:: media/edit-on-github.png
#. If you do not have edit rights on the repository (`odoo/documentation-user
<https://github.com/odoo/documentation-user>`_), you need to fork it by clicking on the
appropriate button. In other terms, you create a copy of the entire repository on your own
account. If you do have the edit rights, skip this step.
.. image:: media/fork-repository.png
#. Make the appropriate changes while taking care of following the :doc:`guidelines <guidelines>`.
#. Click on the **Preview changes** button to review your contribution in a more human-readable
format. Be aware that the preview is not able to handle all markups correctly. Notes and tips,
for instance, are not correctly rendered. The version of your content published to the website
will be, however.
#. Go to the bottom of the page to create a commit (:dfn:`what packs your changes together and
labels them with a commit message`) of your changes.
#. | In first text box, describe your changes. For instance, "Fix a typo" and "Add documentation
for invoicing of sales orders" are two clear commit messages.
| In the second text box, justify *why* you made these changes, if you feel that it is not
obvious.
#. Select the option "Create a new branch for this commit and start a pull request." if you have
the choice (if you have partial or full edit writes on the repository). If not, skip this
step.
#. Click on the green button. It is either labelled "Commit changes" or "Propose file change".
.. image:: media/commit-changes.png
#. In the dropdown for the selection of the base branch (i.e., the version of the documentation that
your changes concern), make sure to select the same version as in the first step of this guide
and click on the **Create pull request** button.
.. image:: media/select-branches-base.png
#. Double-check your :abbr:`PR (Pull Request)` and, when ready, click again on the **Create pull
request** button to submit your changes for review by a redactor at Odoo.
.. image:: media/create-pull-request.png
#. You're done! If your changes are approved straight away they will appear in the documentation the
very next day. It may also be the case that the reviewer has a question or a remark, so make sure
to check your notifications or your emails, depending on your account settings.
.. _contributing/canonical-git-workflow:
Use the canonical Git workflow
==============================
.. _contributing/prepare-machine:
Prepare your machine
--------------------
.. _contributing/install-git:
Install Git
~~~~~~~~~~~
We use `Git <https://en.wikipedia.org/wiki/Git>`_ to manage the files of the user documentation.
It is a tool that allows to track the history of changes made to a file and, more importantly, to
work on different versions of those files at the same time. It means that you do not need to worry
about overwriting someone elses pending work when you start editing the documentation.
You must then configure Git to identify yourself as the author of your future contribution. Enter
the same email address as the one you used to register on GitHub.
#. Download and install **Git** on your machine.
#. Verify that `the installation folder of Git is included in your system's PATH variable
<win-add-to-path_>`_.
#. Execute the following commands in a terminal:
.. code-block:: console
$ git config --global user.name “Your Name”
$ git config --global user.email “youremail@example.com”
.. _contributing/fetch-sources:
Fetch the sources
~~~~~~~~~~~~~~~~~
As stated earlier, our documentation (in all its versions) is maintained on GitHub at
`github.com/odoo/documentation-user <https://github.com/odoo/documentation-user>`_. A modification
is made by the mean of a :abbr:`PR (Pull Request)` (:dfn:`proposal of content changes`) to allow for
a review of the changes before updating the sources of the documentation.
Prior to submitting a modification, you need to make a copy of the sources and download that copy on
your machine.
#. Go to `github.com/odoo/documentation-user <https://github.com/odoo/documentation-user>`_ and
click on the **Fork** button in the top right corner.
.. image:: media/fork-button.png
#. Execute the following commands in a terminal:
.. code-block:: console
$ git clone https://github.com/odoo/documentation-user
$ cd documentation-user/
.. important::
If you do not have edit rights on the repository owned by Odoo, replace "odoo" with your
Github username in the URL of the command above. If you do have edit rights, it is not
necessary to fork the repository.
#. In order to ease the collaboration between writers coming from many different systems and teams,
execute the following group of commands that correspond to your :abbr:`OS (Operating System)` in
a terminal.
- Windows:
.. code-block:: doscon
$ cd documentation-user/
$ git config --global core.autocrlf true
$ git config commit.template %CD%\commit_template.txt
- Linux or Mac OS:
.. code-block:: console
$ cd documentation-user/
$ git config --global core.autocrlf input
$ git config commit.template `pwd`/commit_template.txt
.. _contributing/python:
Python
~~~~~~
Because the documentation is written in :abbr:`RST (reStructuredText)`, it needs to be built
(:dfn:`converted to HTML`) in order to display nicely. This is done by the documentation generator
which takes the original :abbr:`RST (reStructuredText)` files as input, transforms the markups
in a human-readable format, and outputs HTML files to be read in your web browser.
The documentation generator that we use is called `Sphinx <http://www.sphinx-doc.org/en/master/>`_.
and is written in `Python <https://en.wikipedia.org/wiki/Python_(programming_language)>`_. You have
to install Python in order to use Sphinx. For the record, Sphinx is the program and Python the
programming language, but you do not need to know much more about them so don't panic!
Python comes with its own package manager: `pip
<https://en.wikipedia.org/wiki/Pip_(package_manager)>`_. It allows installing Python dependencies in
a single command.
#. Download and install the latest release of **Python 3** on your machine.
#. Make sure to have **pip** installed on your machine (on Windows, you can install pip alongside
Python).
#. Execute the following commands in a terminal to verify that both installations finished
successfully:
.. code-block:: console
$ python3 --version
$ pip3 --version
#. Execute the following commands in a terminal to install the Python dependencies of the
documentation:
.. code-block:: console
$ cd documentation-user/
$ pip3 install -r requirements.txt
.. note::
Depending on your :abbr:`OS (Operating System)`, you may need to run the commands ``python`` and
``pip`` instead of ``python3`` and ``pip3``
.. _contributing/make:
Make
~~~~
`Make <https://en.wikipedia.org/wiki/Make_(software)>`_ is a tool that packs a bunch of
command-lines into one to be easier to remember and to type. In our case, it is used to execute
complex Sphinx build commands by using a single and simpler one instead.
#. Download and install **Make** on your machine.
#. Verify that `the installation folder of Make is included in your system's PATH variable
<win-add-to-path_>`_.
.. _contributing/pngquant:
pngquant
~~~~~~~~
`pngquant <https://pngquant.org/>`_ is a tool that we use to compress PNG images so that the
documentation does not end up weighting several Gigabytes in a few year span.
#. Download and install **pngquant** on your machine.
#. Verify that `the installation folder of pngquant is included in your system's PATH variable
<win-add-to-path_>`_.
.. _contributing/prepare-version:
Prepare your version
--------------------
Now that your machine is all set up, it is time to do the same for your version of the documentation
files. As it would not be convenient to have several people working on the version 13.0 in parallel
(conflicts of content would occur all the time), and in order to be able to create a :abbr:`PR
(Pull Request)`, you must `create a new branch
<https://www.atlassian.com/git/tutorials/using-branches>`_ starting from the branch 13.0. In other
words, you copy the entirety of this versions files and give it another name. For this example, we
will go with ``13.0-my_contribution``.
Execute the following commands in a terminal to...
#. Navigate to the documentation folder:
.. code-block:: console
$ cd documentation-user/
#. Switch to the version 13.0:
.. code-block:: console
$ git checkout 13.0
#. Create your own branch which will be a copy of 13.0:
.. code-block:: console
$ git checkout -b 13.0-my_contribution
.. _contributing/perform-changes:
Perform your changes
--------------------
You can now perform any change you want to the documentation files. These changes must be compliant
with :abbr:`RST (reStructuredText)` syntax (see :doc:`rst_cheat_sheet`) and with our
:doc:`guidelines <guidelines>`.
.. important::
If your changes include the addition of a new image, for instance :file:`my_image.png`, proceed
as follows:
#. Make sure that the image is in ``.png`` format.
#. Execute the following commands in a terminal:
.. code-block:: console
$ cd path-to-the-directory-of-the-image/
$ pngquant my_image.png
#. Delete :file:`my_image.png`.
#. Rename :file:`my_image-fs8.png` to :file:`my_image.png`.
.. _contributing/preview-changes:
Preview your changes
--------------------
To preview your changes in a generated documentation, proceed as follows:
#. Execute the following commands in a terminal:
.. code-block:: console
$ cd documentation-user/
$ make clean
$ make html
.. tip::
You can omit the :command:`make clean` command when no recent change has been made to the
hierarchy of documentation files.
#. Fix any error or warning shown in the logs of the build.
#. Open the file :file:`documentation-user/_build/html/index.html` with your default web browser.
.. note::
These steps have for only purpose to show you the final results of your changes. They have no
impact on the documentation source files.
.. _contributing/submit-changes:
Submit your changes
-------------------
.. important::
We expect you to have basic knowledge of Git, which should be enough to cover the basic flow of a
one-time contribution. If you plan on submitting several contributions, work on older versions of
the documentation or perform any other advanced action, we recommend you to be confident with
Git. Help yourself with `this manual of Git <https://www.atlassian.com/git>`_ and `this
interactive tutorial <https://learngitbranching.js.org/>`_.
#. Execute the following commands in a terminal:
.. code-block:: console
$ git add *
$ git commit
$ git push -u origin 13.0-my_contribution
#. Go to `github.com/odoo/documentation-user/pulls
<https://github.com/odoo/documentation-user/pulls>`_ and click on the **New pull request**
button.
.. image:: media/new-pull-request.png
#. If you forked the base repository in the section :ref:`contributing/fetch-sources`, click on the
link **compare across forks** If not, skip this step.
.. image:: media/compare-across-forks.png
#. In the dropdown for the selection of the base branch (i.e., the version of the documentation that
your changes concern), make sure to select the version that your changes target (here **13.0**).
.. image:: media/select-branches-fork.png
#. Double-check your :abbr:`PR (Pull Request)` and, when ready, click again on the **Create pull
request** button to submit your changes for review by a redactor at Odoo.
.. image:: media/create-pull-request.png
#. You're done! If your changes are approved straight away they will appear in the documentation the
very next day. It may also be the case that the reviewer has a question or a remark, so make sure
to check your notifications or your emails, depending on your account settings.
.. _win-add-to-path: https://www.howtogeek.com/118594/how-to-edit-your-system-path-for-easy-command-line-access/

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,549 @@
:banner: banners/contributing.png
===============
RST cheat sheet
===============
.. _contributing/headings:
Headings
========
| For each formatting line (e.g., ``===``), write as many symbols (``=``) as there are characters in
the header.
| The symbols used for the formatting are, in fact, not important. Only the order in which they are
written matters, as it determines the size of the decorated heading. This means that you may
encounter different heading formatting and in a different order, in which case you should follow
the formatting in place in the document. In any other case, use the formatting shown below.
+--------------+---------------+-------------------------------+
| Heading size | Formatting | Min/Max number of occurrences |
+==============+===============+===============================+
| H1 | | ``=======`` | 1/1 |
| | | ``Heading`` | |
| | | ``=======`` | |
+--------------+---------------+-------------------------------+
| H2 | | ``Heading`` | 0/∞ |
| | | ``=======`` | |
+--------------+---------------+-------------------------------+
| H3 | | ``Heading`` | 0/∞ |
| | | ``-------`` | |
+--------------+---------------+-------------------------------+
| H4 | | ``Heading`` | 0/∞ |
| | | ``~~~~~~~`` | |
+--------------+---------------+-------------------------------+
| H5 | | ``Heading`` | 0/∞ |
| | | ``*******`` | |
+--------------+---------------+-------------------------------+
| H6 | | ``Heading`` | 0/∞ |
| | | ``^^^^^^^`` | |
+--------------+---------------+-------------------------------+
.. _contributing/markup:
Markup
======
.. _contributing/inline-markup:
Inline markup
-------------
Use the following markups to emphasize your text to your liking:
+--------------+----------+
| \*\*Text\*\* | **Text** |
+--------------+----------+
| \*Text\* | *Text* |
+--------------+----------+
| \`\`Text\`\` | ``Text`` |
+--------------+----------+
.. seealso::
- :ref:`contributing/specialized-directives`
.. _contributing/bulleted-list:
Bulleted list
-------------
.. code-block:: rst
- This is a bulleted list.
- It has two items, the second
item uses two lines.
.. code-block:: rst
* This is a bulleted list too.
* The principle stays the same.
.. _contributing/numbered-list:
Numbered list
-------------
.. code-block:: rst
#. This is a numbered list.
#. Numbering is automatic.
.. code-block:: rst
1. This is a numbered list too.
2. Use this format to specify the numbering.
.. _contributing/nested-list:
Nested lists
------------
.. code-block:: rst
- This is the first item of a bulleted list.
1. It has a nested numbered list
2. with two items.
.. _contributing/hyperlinks:
Hyperlinks
==========
.. _contributing/hyperlink-references:
Hyperlink references
--------------------
Hyperlink references are links to a URL with a custom label. They follow this syntax:
```label <URL>`_``
.. note::
The URL can be a relative path to a file within the documentation.
Example
~~~~~~~
This excerpt of :abbr:`RST (reStructuredText)`: ``For instance, `this is a hyperlink reference
<https://odoo.com>`_.`` is rendered as follows in HTML: “For instance, `this is a hyperlink
reference <https://odoo.com>`_.”
.. _contributing/external-hyperlink-targets:
External hyperlink targets
--------------------------
| External hyperlink targets allow creating shortcuts for hyperlink references.
| The definition syntax is as follows: ``.. _target: URL``
| There are two ways to reference them, depending on the use case:
#. ``target_`` creates a hyperlink with the target name as label and the URL as reference. Note that
the ``_`` moved after the target!
#. ```label <target_>`_`` does exactly what you expect: the label replaces the name of the target,
and the target is replaced by the URL.
Example
~~~~~~~
RST
***
.. code-block:: rst
.. _proof-of-concept: https://en.wikipedia.org/wiki/Proof_of_concept
A proof-of-concept_ is a simplified version, a prototype of what is expected to agree on the main
lines of expected changes. `PoC <proof-of-concept_>`_ is a common abbreviation.
Render
******
A `proof-of-concept <https://en.wikipedia.org/wiki/Proof_of_concept>`_ is a simplified version, a
prototype of what is expected to agree on the main lines of expected changes. `PoC
<https://en.wikipedia.org/wiki/Proof_of_concept>`_ is a common abbreviation.
.. _contributing/internal-hyperlink-targets:
Internal hyperlink targets
--------------------------
Internal hyperlink targets follow the same syntax as external hyperlink targets but without any URL.
Indeed, they are internal. They allow referencing a specific part of a document by using the target
as an anchor. When the user clicks on the reference, the documentation scrolls to the part of the
page containing the target.
.. important::
Targets can be referenced from other files than the ones in which they are defined.
| The definition syntax is: ``.. _target:``
| There are two ways to reference them, both using the ``ref`` directive:
#. ``:ref:`target``` creates a hyperlink to the anchor with the heading defined below as label.
#. ``:ref:`label <target>``` creates a hyperlink to the anchor with the given label.
See :ref:`contributing/relative-links` to learn how to write proper relative links for internal
references.
.. note::
Notice that there is no ``_`` at the end, as it is done with :ref:`hyperlink targets
<contributing/hyperlink-references>`.
Example
~~~~~~~
RST
***
.. code-block:: rst
.. _sales/quotation/start-of-page:
This can easily be done by creating a new product, see :ref:`product` for additional help.
.. _sales/quotation/product:
How to create a product?
=========================
As explained at the :ref:`start of the page <sales/quotation/start-of-page>`, ...
Render
******
This can easily be done by creating a new product, see `How to create a product?
<https://example.com/product>`_ for additional help.
**How to create a product?**
As explained at the `start of the page <https://example.com/scroll-to-start-of-page>`_, ...
.. _contributing/implicit-hyperlink-targets:
Implicit hyperlink targets
--------------------------
| Implicit hyperlink targets are a special kind of internal hyperlink targets: they are
automatically generated by section titles, footnotes, etc. Consequently, they dont have a
definition syntax.
| They can be referenced the same first way as external hyperlink targets by using the name of the
section title as URL.
Example
~~~~~~~
RST
***
.. code-block:: rst
This can easily be done by creating a new user, see `How to create a new user?`_ for
additional help. ...
Render
******
This can easily be done by creating a new user, see `How to create a new user?
<https://example.com/how-to-create-a-user>`_ for additional help. ...
.. _contributing/doc:
The ``doc`` directive
---------------------
| The ``doc`` directive allows referencing a documentation page wherever it is in the file tree
through a relative file path.
| As usual, there are two ways to use the directive:
#. ``:doc:`path_to_doc_page``` creates a hyperlink reference to the documentation page with the
title of the page as label.
#. ``:doc:`label <path_to_doc_page>``` creates a hyperlink reference to the documentation page with
the given label.
Example
~~~~~~~
RST
***
.. code-block:: rst
Please refer to :doc:`this documentation <customer_invoices>` and to
:doc:`../sales/invoicing/proforma`.
Render
******
Please refer to `this documentation <https://example.com/doc/accounting/invoices.html>`_ and to
`Send a pro-forma invoice <https://example.com/doc/sales/proforma.html>`_.
.. _contributing/download:
The ``download`` directive
--------------------------
The ``download`` directive allows referencing files (that are not necessarily :abbr:`RST
(reStructuredText)` documents) within the source tree to be downloaded.
Example
~~~~~~~
RST
***
.. code-block:: rst
Download this :download:`module structure template <extras/my_module.zip>` to start building your
module in no time.
Render
******
Download this `module structure template <https://example.com/doc/odoosh/extras/my_module.zip>`_ to
start building your module in no time.
.. _contributing/image:
The ``image`` directive
-----------------------
The ``image`` directive allows inserting images in a document. It comes with a set of optional
parameter directives that can individually be omitted if considered redundant.
Example
~~~~~~~
RST
***
.. code-block:: rst
.. image:: media/create_invoice.png
:align: center
:alt: Create an invoice
:height: 100
:width: 200
:scale: 50
:class: img-thumbnail
:target: ../invoicing.html#create-an-invoice
Render
******
.. image:: media/create-invoice.png
:align: center
:alt: Create an invoice
:height: 100
:width: 200
:scale: 50
:class: img-thumbnail
:target: https://example.com/doc/sales/invoicing.html#create-an-invoice
.. _contributing/admonitions:
Admonitions (alert blocks)
==========================
.. _contributing/seealso:
Seealso
-------
RST
~~~
.. code-block:: rst
.. seealso::
- :doc:`customer_invoices`
- `Pro-forma invoices <../sales/invoicing/proforma.html#activate-the-feature>`_
Render
~~~~~~
.. seealso::
- `Customer invoices <https://example.com/doc/accounting/invoices.html>`_
- `Pro-forma invoices <https://example.com/doc/sales/proforma.html#activate-the-feature>`_
.. _contributing/note:
Note
----
RST
~~~
.. code-block:: rst
.. note::
Use this to get the attention of the reader about additional information.
Render
~~~~~~
.. note::
Use this to get the attention of the reader about additional information.
.. _contributing/tip:
Tip
---
RST
~~~
.. code-block:: rst
.. tip::
Use this to inform the reader about a useful trick that requires an
action.
Render
~~~~~~
.. tip::
Use this to inform the reader about a useful trick that requires an
action.
.. _contributing/important:
Important
---------
RST
~~~
.. code-block:: rst
.. important::
Use this to notify the reader about an important information.
Render
~~~~~~
.. important::
Use this to notify the reader about an important information.
.. _contributing/warning:
Warning
-------
RST
~~~
.. code-block:: rst
.. warning::
Use this to require the reader to proceed with caution with what is
described in the warning.
Render
~~~~~~
.. warning::
Use this to require the reader to proceed with caution with what is
described in the warning.
.. _contributing/danger:
Danger
------
RST
~~~
.. code-block:: rst
.. danger::
Use this to alarm the reader about a serious threat.
Render
~~~~~~
.. danger::
Use this to alarm the reader about a serious threat.
.. _contributing/formatting-tips:
Formatting tips
===============
.. _contributing/line-break:
Break the line but not the paragraph
------------------------------------
RST
~~~
.. code-block:: rst
| First super long line that you break in two…
here is rendered as a single line.
| Second line that follows a line break.
Render
~~~~~~
| First super long line that you break in two…
here is rendered as a single line.
| Second line that follows a line break.
.. _contributing/comments:
Add comments
------------
If you made a particular choice of writing or formatting that a future writer should be able to
understand and take into account, consider writing a comment. Comments are blocks of text that do
not count as a part of the documentation and that are used to pass a message to writers of the
source code. They consist of a line starting with two dots and a space, followed by the comment.
``.. For instance, this line will not be rendered in the documentation.``
.. _contributing/tables:
Use tables
----------
Make use of `this convenient table generator <https://www.tablesgenerator.com/text_tables>`_ to
build your tables. Then, copy-paste the generated formatting into your document.
.. _contributing/specialized-directives:
Spice your writing with specialized directives
----------------------------------------------
Use these additional directives to fine-tune your content:
+-------------------+------------------------------------------+-------------------------------------------------------------------------------------------------------------------+
| **Directive** | **Purpose** | **Example** |
| | +-----------------------------------------------------------+-------------------------------------------------------+
| | | **RST** | **HTML** |
+-------------------+------------------------------------------+-----------------------------------------------------------+-------------------------------------------------------+
| ``abbr`` | Self-defining abbreviations | ``:abbr:`SO (Sales Order)``` | :abbr:`SO (Sales Order)` |
+-------------------+------------------------------------------+-----------------------------------------------------------+-------------------------------------------------------+
| ``command`` | Highlight a command | ``:command:`python example.py``` | :command:`python example.py` |
+-------------------+------------------------------------------+-----------------------------------------------------------+-------------------------------------------------------+
| ``dfn`` | Define a term | ``:dfn:`a definition for a new term``` | :dfn:`a definition for a new term` |
+-------------------+------------------------------------------+-----------------------------------------------------------+-------------------------------------------------------+
| ``file`` | Indicate a file path | ``:file:`~/odoo/odoo-bin``` | :file:`~/odoo/odoo-bin` |
+-------------------+------------------------------------------+-----------------------------------------------------------+-------------------------------------------------------+
| ``menuselection`` | Guide a user through a sequence of menus | ``:menuselection:`Sales --> Configuration --> Settings``` | :menuselection:`Sales --> Configuration --> Settings` |
+-------------------+------------------------------------------+-----------------------------------------------------------+-------------------------------------------------------+
.. _contributing/escaping:
Escape markup symbols (Advanced)
--------------------------------
Markup symbols escaped with backslashes (``\``) are rendered normally. For instance, ``this
\*\*line of text\*\* with \*markup\* symbols`` is rendered as “this \*\*line of text\*\* with
\*markup\* symbols”.
When it comes to backticks (`````), which are used in many case such as :ref:`hyperlink references
<contributing/hyperlink-references>`, using backslashes for escaping is no longer an option because
the outer backticks interpret enclosed backslashes and thus prevent them from escaping inner
backticks. For instance, ```\`this formatting\```` produces an ``[UNKNOWN NODE title_reference]``
error. Instead, `````this formatting````` should be used to produce the following result:
```this formatting```.

View File

@ -13,3 +13,4 @@ Practical Information
portal/my_odoo_portal
support
legal
contributing

View File

@ -1 +1,2 @@
Sphinx<2
Sphinx>=2.4.0
Werkzeug==0.14.1

View File

@ -10,4 +10,3 @@ Support
support/where_can_i_get_support
support/what_can_i_expect
support/supported_versions
support/user_doc

View File

@ -1,152 +0,0 @@
.. :banner: banners/support.png
===============================
Contribute to the documentation
===============================
First of all...
===============
**... Thank you for landing here and helping us to improve the user documentation of Odoo.**
Edit an existing page
=====================
#. As our documentation is maintained on GitHub, you'll need a free `GitHub account
<https://github.com/join>`_.
#. Pick a page in our :doc:`user documentation <../index>`.
**Please take care of selecting the right version of Odoo.**
#. Click on **Edit on Github** in the left menu.
.. image:: ./media/edit_on_github.png
:align: center
:alt: Click on "Edit on Github".
#. If this is the first time you edit our documentation, click on **Fork repository**, otherwise
you won't see this step.
#. Use Github's editor to add your text. Text is tagged with a simple syntax called `RST
<http://docutils.sourceforge.net/rst.html>`_. Don't worry, it's not so hard to learn 🤓...
See the following section of this document for a quick overview of RST commands.
.. image:: ./media/add_text.png
:align: center
:alt: Use Github's editor to add your text.
#. Click on **Preview changes** to review your contribution in a human-readable format.
.. image:: ./media/preview_changes.png
:align: center
:alt: Click on "Preview changes" to review your contribution.
#. In the **Propose file change** section, add a short title to your contribution.
The title should summarize your changes. You may use the second box to add an extended
description if your contribution requires a longer explanation.
.. image:: ./media/propose_changes.png
:align: center
:alt: Add a title and submit your contribution.
#. Submit your contribution by clicking on **Propose file change**.
#. Click on **Create pull request**.
#. Wait for an Odoo maintainer to add your contribution. Thank you for your help!
.. warning::
There is no automatic port of your edit to another version of the documentation.
If your change should apply to multiple versions of Odoo, please warn us in your contribution message.
RST Cheat Sheet
---------------
.. TODO merge with our internal tutorial : https://docs.google.com/document/d/19QkK9zDpoHJ57QtBgAs0sjInfO8zR_3mfCIr-CxS85Y/
Here is a summary of the markup elements you may use while editing our documentation.
+------------------------------+--------------------------+---------------------------------------+
| Code | Display | Comments |
+==============================+==========================+=======================================+
| .. code-block:: rst | Text in *italics* | |
| | | |
| Text in *italics* | | |
+------------------------------+--------------------------+---------------------------------------+
| .. code-block:: rst | Text in **bold** letters | |
| | | |
| Text in **bold** letters | | |
+------------------------------+--------------------------+---------------------------------------+
| .. code-block:: rst | 1. Numbered | - Must be surrounded by white lines. |
| | 2. Bullet | |
| 1. Numbered | 3. List | |
| 2. Bullet | | |
| 3. List | | |
+------------------------------+--------------------------+---------------------------------------+
| .. code-block:: rst | - Numbered | - Must be surrounded by white lines. |
| | - Bullet | |
| - Bullet | - List | |
| - Point | | |
| - List | | |
+------------------------------+--------------------------+---------------------------------------+
| .. code-block:: rst | This is `a hyper link | - Here is `how to enter backticks |
| | <https://www.odoo.com>`_.| on your keyboard |
| This is `a hyper link | | <https://superuser.com/a/254077>`_. |
| <https://www.odoo.com>`_. | | - Don't forget terminal *underscore*. |
+------------------------------+--------------------------+---------------------------------------+
.. note::
There are many more commands available, see `comprehensive documentation
<http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html>`_ of RST.
Add images to your documents
============================
.. warning::
This procedure is possible only for users who have **push** access on the documentation repository (eg: mainly, Odoo maintainers).
We are working on improving this.
1. First of all, prepare your screenshots.
- They must be good-quality PNG images.
- Crop your screenshots to display only the relevant part of the screen. Large screenshots are hard
to read and don't display well in a documentation.
- Always take your screenshots on a demo instance of Odoo; **never** include any personal data.
2. Upload them to the ``media/`` directory which is located next to the page you are editing. If the directory does not exist, create it.
3. When editing your page, use this code piece in order to load your image:
.. code-block:: rst
.. image:: ./media/your_image_file.png
:align: center
:alt: Text that is displayed when your image is not available (eg: for screen readers and other accessibility tools)
4. Submit your changes
.. Add a page about a new topic
.. ============================
.. TODO publish our internal tutorial : https://docs.google.com/document/d/1EP32VFjN08piZoGn1BXT6ZOVb5AKUTieeeuK10nxZz8/
Technical Details for Nerds
===========================
Advanced users may, of course, fork and clone the `GitHub repository <https://github.com/odoo/documentation-user>`_.
Then submit a pull request with the canonical Git/GitHub workflow.
See our `README <https://github.com/odoo/documentation-user/blob/13.0/README.rst>`_ file about building
the documentation.
Developer documentation
=======================
Documentation that targets developers of Odoo apps is maintained alongside `the source code of Odoo <https://github.com/odoo/odoo/tree/13.0/doc>`_.
.. note::
User documentation might contain technicalities yet, when they are related to configuration and everyday use of Odoo.