[IMP] base: Configure document layout

The onboarding modal for setting up the few base fields of a company
has now been moved to a wizard
It is accessible from the general settings, but also in the onboarding
section of sale and account modules.

The following company settings are editable with that wizard:

- Set report **layout**:
The user can chose the overall look of the report. The current choices
are : *Standard* (default), *Background*, *Boxed* and *Clean*.

- Set company **logo**:
Changes the company logo.

- Set report **colors**:
The user can set the primary and secondary colors of the report through
a newly added widget allowing to pick a custom color.
When changing the **logo**, colors are automatically set to its most dominant
colors.
> A "Reset colors" button also triggers the color calculation.

- Set report **font**:
Changes the overall font of the report. Only Google Fonts are used
for enhanced compatibility.

- Company **tagline**, also called "header"
- **Footer**
- **Paper format**
- Report **preview**:
A mockup of a final report
Automatically updates when changing **layout**, **logo**, **colors** or **font**

Co-authored by: Julien Mougenot <jum@odoo.com>

closes odoo/odoo#33863

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>


Co-authored-by: Lucas Perais <lpe@odoo.com>
This commit is contained in:
Julien Mougenot
2019-07-29 08:29:26 +00:00
committed by Vincent Schippefilt
co-authored by Lucas Perais
parent a8c93df9c8
commit ed18095127
123 changed files with 1960 additions and 243 deletions
-7
View File
@@ -459,13 +459,6 @@ Best Regards,'''))
""" Mark the dashboard onboarding panel as closed. """
self.env.company.account_dashboard_onboarding_state = 'closed'
@api.model
def action_open_account_onboarding_invoice_layout(self):
""" Onboarding step for the invoice layout. """
action = self.env.ref('account.action_open_account_onboarding_invoice_layout').read()[0]
action['res_id'] = self.env.company.id
return action
@api.model
def action_open_account_onboarding_sale_tax(self):
""" Onboarding step for the invoice layout. """
@@ -0,0 +1,49 @@
odoo.define('account.dashboard.setup.tour', function (require) {
"use strict";
var core = require('web.core');
var tour = require('web_tour.tour');
var _t = core._t;
tour.register('account_render_report', {
test: true,
url: '/web',
}, [tour.STEPS.SHOW_APPS_MENU_ITEM,
{
trigger: '.o_app[data-menu-xmlid="account.menu_finance"]',
position: 'bottom',
edition: 'community'
}, {
trigger: '.o_app[data-menu-xmlid="account_accountant.menu_accounting"]',
position: 'bottom',
edition: 'enterprise'
}, {
trigger: 'a:contains(' + _t("Customer Invoices") + ')',
edition: 'enterprise'
}, {
trigger: '.o_data_row:first',
extra_trigger: '.breadcrumb',
}, {
trigger: '.o_control_panel button:contains("' + _t('Print') + '")',
}, {
trigger: '.o_control_panel div.o_dropdown_menu a:contains("' + _t('Invoices without Payment') + '")',
}, {
trigger: 'iframe .o_report_layout_standard h2',
content: 'Primary color is correct',
run: function () {
if (this.$anchor.css('color') !== "rgb(18, 52, 86)") {
console.error('The primary color should be the one set on the company.');
}
},
}, {
trigger: 'iframe .o_report_layout_standard #informations div strong',
content: 'Secondary color is correct',
run: function () {
if (this.$anchor.css('color') !== "rgb(120, 145, 1)") {
console.error('The secondary color should be the one set on the company.');
}
},
}
]);
});
+1
View File
@@ -19,3 +19,4 @@ from . import test_templates_consistency
from . import test_account_fiscal_year
from . import test_account_all_l10n
from . import test_reconciliation_matching_rules
from . import test_account_onboarding
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests.common import SavepointCase
from odoo.tests.common import SavepointCase, HttpCase, tagged
class TestAccountNoChartCommon(SavepointCase):
@@ -0,0 +1,18 @@
from odoo.tests.common import tagged, HttpCase
@tagged('-at_install', 'post_install', 'document_layout')
class TestAccountDocumentLayout(HttpCase):
def test_render_account_document_layout(self):
report_layout = self.env.ref('web.report_layout_standard')
main_company = self.env.ref('base.main_company')
main_company.write({
'primary_color': '#123456',
'secondary_color': '#789101',
'external_report_layout_id': report_layout.view_id.id,
})
self.env.ref('account.account_invoices_without_payment').write({
'report_type': 'qweb-html',
})
self.start_tour("/web", 'account_render_report', login='admin', timeout=200)
+1 -1
View File
@@ -27,7 +27,6 @@
<script type="text/javascript" src="/account/static/src/js/bank_statement.js"></script>
<script type="text/javascript" src="/account/static/src/js/section_and_note_fields_backend.js"></script>
<script type="text/javascript" src="/account/static/src/js/tours/account.js"></script>
<script type="text/javascript" src="/account/static/src/js/bills_tree_upload.js"/>
</xpath>
</template>
@@ -41,6 +40,7 @@
<template id="assets_tests" name="Account Assets Tests" inherit_id="web.assets_tests">
<xpath expr="." position="inside">
<script type="text/javascript" src="/account/static/tests/tours/reconciliation.js"></script>
<script type="text/javascript" src="/account/static/tests/tours/account_dashboard_setup_bar_tests.js"></script>
</xpath>
</template>
@@ -8,8 +8,8 @@
<t t-set="done_icon" t-value="'fa-star'" />
<t t-set="btn_text">Customize</t>
<t t-set="done_text">Looks great!</t>
<t t-set="method" t-value="'action_open_account_onboarding_invoice_layout'" />
<t t-set="model" t-value="'res.company'" />
<t t-set="method" t-value="'action_open_base_document_layout'" />
<t t-set="model" t-value="'base.document.layout'" />
<t t-set="state" t-value="state.get('account_onboarding_invoice_layout_state')" />
</t>
</template>
@@ -94,27 +94,6 @@
<t t-call="account.onboarding_chart_of_account_step" name="chart_of_account_step" />
</t>
</template>
<!-- INVOICE FORM -->
<record id="account_invoice_onboarding_invoice_layout_form" model="ir.ui.view">
<field name="name">account.invoice.layout.onboarding.form</field>
<field name="model">res.company</field>
<field name="inherit_id" ref="base.view_company_document_template_form" />
<field name="mode">primary</field>
<field name="priority">1000</field>
<field name="arch" type="xml">
<xpath expr="//button[@special='save']" position="replace">
<button string="Apply" class="btn btn-primary" type="object" name="action_save_onboarding_invoice_layout" />
</xpath>
</field>
</record>
<record id="action_open_account_onboarding_invoice_layout" model="ir.actions.act_window">
<field name="name">Configure your document layout</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.company</field>
<field name="view_mode">form</field>
<field name="view_id" ref="account_invoice_onboarding_invoice_layout_form" />
<field name="target">new</field>
</record>
<!-- SAMPLE INVOICE EMAIL -->
<record model="ir.ui.view" id="email_compose_onboarding_sample_invoice">
<field name="name">mail.compose.message.form.account_invoice_onboarding_sample_invoice
+1
View File
@@ -12,3 +12,4 @@ from . import account_report_print_journal
from . import setup_wizards
from . import wizard_tax_adjustments
from . import account_invoice_send
from . import base_document_layout
@@ -0,0 +1,10 @@
from odoo import models
class BaseDocumentLayout(models.TransientModel):
_inherit = 'base.document.layout'
def document_layout_save(self):
super(BaseDocumentLayout, self).document_layout_save()
for wizard in self:
wizard.company_id.action_save_onboarding_invoice_layout()
@@ -89,20 +89,6 @@ class ResConfigSettings(models.TransientModel):
return False
return self._prepare_report_view_action(self.external_report_layout_id.key)
def change_report_template(self):
self.ensure_one()
template = self.env.ref('base.view_company_document_template_form')
return {
'name': _('Choose Your Document Layout'),
'type': 'ir.actions.act_window',
'view_mode': 'form',
'res_id': self.env.company.id,
'res_model': 'res.company',
'views': [(template.id, 'form')],
'view_id': template.id,
'target': 'new',
}
# NOTE: These fields depend on the context, if we want them to be computed
# we have to make them depend on a field. This is because we are on a TransientModel.
@api.depends('company_id')
@@ -89,18 +89,18 @@
</div>
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_right_pane">
<span class="o_form_label">Document Template</span>
<span class="o_form_label">Document Layout</span>
<span class="fa fa-lg fa-building-o" title="Values set here are company-specific." aria-label="Values set here are company-specific." groups="base.group_multi_company" role="img"/>
<div class="text-muted">
Choose your document's header and footer layout
Choose the layout of your documents
</div>
<div class="content-group">
<div class="mt16" groups="base.group_no_one">
<label for="external_report_layout_id" string="Template" class="col-3 col-lg-3 o_light_label"/>
<label for="external_report_layout_id" string="Layout" class="col-3 col-lg-3 o_light_label"/>
<field name="external_report_layout_id" domain="[('type','=', 'qweb')]" class="oe_inline"/>
</div>
<div class="mt16">
<button name="change_report_template" string="Change Document Template" type="object" class="oe_link" icon="fa-arrow-right"/>
<button name="%(base.action_base_document_layout_configurator)d" string="Configure Document Layout" type="action" class="oe_link" icon="fa-arrow-right"/>
<button name="edit_external_header" string="Edit Layout" type="object" class="oe_link" groups="base.group_no_one"/>
<button name="%(web.action_report_externalpreview)d" string="Preview Document" type="action" class="oe_link" groups="base.group_no_one"/>
</div>
-12
View File
@@ -86,11 +86,6 @@ class ResCompany(models.Model):
}
return action
def action_save_onboarding_quotation_layout(self):
""" Set the onboarding step as done """
if bool(self.logo) and self.logo != self._get_logo():
self.set_onboarding_step_done('account_onboarding_invoice_layout_state')
def get_and_update_sale_quotation_onboarding_state(self):
""" This method is called on the controller rendering method and ensures that the animations
are displayed only one time. """
@@ -102,11 +97,4 @@ class ResCompany(models.Model):
]
return self.get_and_update_onbarding_state('sale_quotation_onboarding_state', steps)
@api.model
def action_open_sale_onboarding_quotation_layout(self):
""" Onboarding step for the quotation layout. """
action = self.env.ref('sale.action_open_sale_onboarding_quotation_layout').read()[0]
action['res_id'] = self.env.company.id
return action
_sql_constraints = [('check_quotation_validity_days', 'CHECK(quotation_validity_days > 0)', 'Quotation Validity is required and must be greater than 0.')]
+2 -26
View File
@@ -8,8 +8,8 @@
<t t-set="done_icon" t-value="'fa-star'" />
<t t-set="done_text">Looks great!</t>
<t t-set="btn_text">Customize</t>
<t t-set="method" t-value="'action_open_sale_onboarding_quotation_layout'" />
<t t-set="model" t-value="'res.company'" />
<t t-set="model" t-value="'base.document.layout'" />
<t t-set="method" t-value="'action_open_base_document_layout'" />
<t t-set="state" t-value="state.get('account_onboarding_invoice_layout_state')" />
</t>
</template>
@@ -68,30 +68,6 @@
<field name="view_id" ref="sale_onboarding_order_confirmation_form" />
<field name="target">new</field>
</record>
<!-- QUOTATION LAYOUT -->
<record id="sale_onboarding_quotation_layout_form" model="ir.ui.view">
<field name="name">sale.onboarding.quotation.layout.form</field>
<field name="model">res.company</field>
<field name="inherit_id" ref="base.view_company_document_template_form" />
<field name="mode">primary</field>
<field name="priority">1000</field>
<field name="arch" type="xml">
<xpath expr="//button[@special='save']" position="after">
<button string="Preview" type="action" class="btn btn-secondary" name="web.action_report_externalpreview"/>
</xpath>
<xpath expr="//button[@special='save']" position="replace">
<button string="Apply" class="btn btn-primary" type="object" name="action_save_onboarding_quotation_layout" />
</xpath>
</field>
</record>
<record id="action_open_sale_onboarding_quotation_layout" model="ir.actions.act_window">
<field name="name">Configure your document layout</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.company</field>
<field name="view_mode">form</field>
<field name="view_id" ref="sale_onboarding_quotation_layout_form" />
<field name="target">new</field>
</record>
<!-- SAMPLE QUOTATION -->
<record model="ir.ui.view" id="sale_onboarding_sample_quotation_form">
<field name="name">mail.compose.message.sale.onboarding.sample.quotation.form</field>
+5 -1
View File
@@ -2,24 +2,28 @@
<odoo>
<data>
<record id="report_layout_standard" model="report.layout">
<field name="name">Standard</field>
<field name="view_id" ref="web.external_layout_standard"/>
<field name="image">/web/static/img/preview_standard.png</field>
<field name="pdf">/web/static/pdf/preview_standard.pdf</field>
</record>
<record id="report_layout_background" model="report.layout">
<field name="name">Background</field>
<field name="view_id" ref="web.external_layout_background"/>
<field name="image">/web/static/img/preview_background.png</field>
<field name="pdf">/web/static/pdf/preview_background.pdf</field>
</record>
<record id="report_layout_boxed" model="report.layout">
<field name="name">Boxed</field>
<field name="view_id" ref="web.external_layout_boxed"/>
<field name="image">/web/static/img/preview_boxed.png</field>
<field name="pdf">/web/static/pdf/preview_boxed.pdf</field>
</record>
<record id="report_layout_clean" model="report.layout">
<field name="name">Clean</field>
<field name="view_id" ref="web.external_layout_clean"/>
<field name="image">/web/static/img/preview_clean.png</field>
<field name="pdf">/web/static/pdf/preview_clean.pdf</field>
</record>
</data>
</odoo>
</odoo>
-1
View File
@@ -4,4 +4,3 @@
from . import ir_qweb
from . import ir_http
from . import models
from . import report_layout
-1
View File
@@ -1,2 +1 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_report_layout,access_report_layout,model_report_layout,,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
access_report_layout access_report_layout model_report_layout 1 1 1 1
@@ -0,0 +1,93 @@
Copyright 2011 The Montserrat Project Authors (https://github.com/JulietaUla/Montserrat)
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
@@ -0,0 +1,93 @@
Copyright 2016 The Oswald Project Authors (https://github.com/googlefonts/OswaldFont)
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,95 @@
Copyright (c) 2010, Matt McInerney (matt@pixelspread.com),
Copyright (c) 2011, Pablo Impallari (www.impallari.com|impallari@gmail.com),
Copyright (c) 2011, Rodrigo Fuenzalida (www.rfuenzalida.com|hello@rfuenzalida.com), with Reserved Font Name Raleway
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1,202 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
File diff suppressed because one or more lines are too long
@@ -23,6 +23,7 @@ var utils = require('web.utils');
var view_dialogs = require('web.view_dialogs');
var field_utils = require('web.field_utils');
var time = require('web.time');
var ColorpickerDialog = require('web.ColorpickerDialog');
require("web.zoomodoo");
@@ -373,11 +374,11 @@ var NumericField = InputField.extend({
// Private
//--------------------------------------------------------------------------
/**
/**
* Evaluate a string representing a simple formula,
* a formula is composed of numbers and arithmetic operations
* (ex: 4+3*2)
*
*
* Supported arithmetic operations: + - * / ^ ( )
* Since each number in the formula can be expressed in user locale,
* we parse each float value inside the formula using the user context
@@ -385,7 +386,7 @@ var NumericField = InputField.extend({
* We assume that this function is used as a calculator so operand ^ (xor)
* is replaced by operand ** (power) so that users that are used to
* excel or libreoffice are not confused
*
*
* @private
* @param expr
* @return a float representing the result of the evaluated formula
@@ -1756,7 +1757,7 @@ var FieldBinaryImage = AbstractFieldBinary.extend({
},
/**
* Returns the image URL from a model.
*
*
* @private
* @param {string} model model from which to retrieve the image
* @param {string} res_id id of the record
@@ -1769,7 +1770,7 @@ var FieldBinaryImage = AbstractFieldBinary.extend({
model: model,
id: JSON.stringify(res_id),
field: field,
// unique forces a reload of the image when the record has been updated
// unique forces a reload of the image when the record has been updated
unique: field_utils.format.datetime(unique).replace(/[^0-9]/g, ''),
});
},
@@ -1811,7 +1812,7 @@ var FieldBinaryImage = AbstractFieldBinary.extend({
},
/**
* Only enable the zoom on image in read-only mode, and if the option is enabled.
*
*
* @override
* @private
*/
@@ -3204,6 +3205,59 @@ var AceEditor = DebouncedField.extend({
},
});
/**
* The FieldColor widget give a visual representation of a color
* Clicking on it bring up an instance of ColorpickerDialog
*/
var FieldColor = AbstractField.extend({
template: 'FieldColor',
events: {
'click .o_field_color': '_onColorClick',
},
custom_events: {
'colorpicker:saved': '_onColorpickerSaved',
},
//--------------------------------------------------------------------------
// Private
//--------------------------------------------------------------------------
/**
* @override
* @private
*/
_render: function () {
this._super.apply(this, arguments);
this.$('.o_field_color').data('value', this.value)
.css('background-color', this.value)
.attr('title', this.value);
},
//--------------------------------------------------------------------------
// Handlers
//--------------------------------------------------------------------------
/**
* @private
* @param {MouseEvent} ev
*/
_onColorClick: function (ev) {
new ColorpickerDialog(this, {
defaultColor: this.value,
noTransparency: true,
}).open();
},
/**
* @private
* @param {OdooEvent} ev
*/
_onColorpickerSaved: function (ev) {
this._setValue(ev.data.hex);
},
});
return {
TranslatableFieldMixin: TranslatableFieldMixin,
DebouncedField: DebouncedField,
@@ -3247,6 +3301,7 @@ return {
CharCopyClipboard: CharCopyClipboard,
JournalDashboardGraph: JournalDashboardGraph,
AceEditor: AceEditor,
FieldColor: FieldColor,
};
});
@@ -59,7 +59,8 @@ registry
.add('progressbar', basic_fields.FieldProgressBar)
.add('toggle_button', basic_fields.FieldToggleBoolean)
.add('dashboard_graph', basic_fields.JournalDashboardGraph)
.add('ace', basic_fields.AceEditor);
.add('ace', basic_fields.AceEditor)
.add('color', basic_fields.FieldColor);
// Relational fields
registry
@@ -78,7 +79,8 @@ registry
.add('many2many_checkboxes', relational_fields.FieldMany2ManyCheckBoxes)
.add('one2many', relational_fields.FieldOne2Many)
.add('statusbar', relational_fields.FieldStatus)
.add('reference', relational_fields.FieldReference);
.add('reference', relational_fields.FieldReference)
.add('font', relational_fields.FieldSelectionFont);
// Special fields
registry
@@ -2786,6 +2786,32 @@ var FieldSelectionBadge = FieldSelection.extend({
},
});
var FieldSelectionFont = FieldSelection.extend({
//--------------------------------------------------------------------------
// Private
//--------------------------------------------------------------------------
/**
* Changes CSS for all options according to their value.
* Also removes empty labels.
*
* @private
* @override
*/
_renderEdit: function () {
this._super.apply(this, arguments);
this.$('option').each(function (i, option) {
if (! option.label) {
$(option).remove();
}
$(option).css('font-family', option.value);
});
this.$el.css('font-family', this.value);
},
});
/**
* The FieldReference is a combination of a select (for the model) and
* a FieldMany2one for its value.
@@ -2953,6 +2979,7 @@ return {
FieldSelectionBadge: FieldSelectionBadge,
FieldSelection: FieldSelection,
FieldStatus: FieldStatus,
FieldSelectionFont: FieldSelectionFont,
FieldReference: FieldReference,
};
@@ -298,7 +298,7 @@ var BasicController = AbstractController.extend(FieldManagerMixin, {
},
on_success: resolve,
on_fail: function () {
self.update({}, {reload: false}).then(reject).guardedCatch(reject);
self.update({}, { reload: false }).then(reject).guardedCatch(reject);
},
on_closed: reload,
});
@@ -0,0 +1,162 @@
.o_document_layout .o_group {
display: flex;
.o_document_layout_company {
flex: 5;
@include media-breakpoint-up(sm, $o-extra-grid-breakpoints) {
max-width: 50%;
}
img {
max-height: 100px;
}
.o_document_layout_colors {
vertical-align: middle;
display: flex;
flex-direction: row;
align-items: center;
.o_field_widget {
width: 30px;
margin: 0 5px 0 0;
}
.btn {
padding: 0;
margin-left: 10px;
.o_form_label {
height: 30px;
font-size: 18px;
margin: 0;
cursor: pointer;
}
}
}
select.o_input {
height: 25px;
}
}
.o_document_layout_preview {
flex: 4;
border: 1px solid;
border-color: gray;
margin-right: 12px;
padding: 12px;
display: flex;
min-height: 420px;
flex-direction: column;
}
}
.o_document_layout_preview_logo img {
padding-left: 5px;
max-height: 45px;
}
.o_document_layout_preview_html {
flex: 1;
.o_readonly {
height: 100%;
}
.o_preview_layout {
display: flex;
flex-direction: column;
height: 100%;
}
.header {
padding: 0 10px;
border-top: 1px solid;
h2 {
margin: 40px 0;
}
.o_layout_information {
margin-bottom: 20px;
}
}
.article {
flex: 1;
padding: 0 10px;
table th, table td {
text-align: right;
&:first-child {
text-align: left;
}
}
}
.footer {
border-top: 1px solid;
}
.o_preview_background_layout {
background-image: url(/base/static/img/bg_background_template.jpg);
background-size: cover;
background-position: bottom center;
background-repeat: no-repeat;
.table tbody tr:nth-child(odd) {
background-color: rgba(220, 205, 216, 0.2);
}
.row table tbody tr:nth-child(odd) {
background-color: transparent !important;
}
.footer {
border-bottom: 1px solid;
}
}
.o_preview_clean_layout {
.header {
border: none;
}
.article table {
border-bottom: 1px solid;
border-top: 1px solid;
margin: 0;
}
.clearfix table {
border-top: none;
.o_subtotal td {
border: none;
}
}
thead th {
border-top: 1px solid;
text-transform: uppercase;
}
}
.o_preview_standard_layout {
.o_subtotal, .o_total {
td {
border-top: 1px solid;
}
}
}
.o_preview_boxed_layout {
table {
border: 1px solid gray('700');
thead th {
border: 1px solid gray('700');
text-transform: uppercase;
}
tbody tr td {
border-top: none;
border-right: 1px solid gray('700');
}
}
.o_subtotal td, .o_total td {
border-right: none;
border-top: 1px solid gray('700');
}
.o_total td {
strong, span {
color: white;
}
}
}
}
@media (max-width: 620px) {
.o_document_layout .o_group {
flex-direction: column;
}
}
@media (max-width: 992px) {
.clearfix td {
display: flex;
}
}
+2 -2
View File
@@ -53,12 +53,12 @@
}
}
.o_color_picker_inputs {
display: -webkit-flex;
display: flex;
flex-direction: column;
& > .form-row {
flex: 1;
.col {
display: -webkit-flex;
display: flex;
flex-direction: column;
justify-content: space-around;
}
+9
View File
@@ -447,6 +447,15 @@
}
}
}
& > .o_field_color {
border: 2px solid rgba(0, 0, 0, 0.25);
border-radius: 100px;
width: 30px;
height: 30px;
margin: 0 5px 0 0;
display: inline-block;
}
}
span.o_field_copy:empty {
+24
View File
@@ -65,3 +65,27 @@ $lato-font-path: '../fonts/lato';
@include lato-font-pair('Reg', 400);
@include lato-font-pair('Bol', 700);
@include lato-font-pair('Bla', 900);
// ------------------------------------------------------------------
// Google fonts
// ------------------------------------------------------------------
$google-font-path: '../fonts/google';
@mixin google-font($family, $type, $weight, $style) {
@font-face {
font-family: $family;
src: url('#{$google-font-path}/#{$family}/#{$family}-#{$type}.ttf') format('truetype');
font-weight: $weight;
font-style: $style;
}
}
@mixin google-font-pair($family) {
@include google-font('#{$family}', 'Regular', 400, normal);
}
@include google-font-pair('Montserrat');
@include google-font-pair('Open Sans');
@include google-font-pair('Oswald');
@include google-font-pair('Raleway');
@include google-font-pair('Roboto');
@@ -1,5 +1,5 @@
.o_background_footer, .o_background_header, .o_report_layout_background {
font-family: 'Lato', 'Noto';
color: gray('700');
}
.o_background_header {
@@ -11,7 +11,7 @@
margin-right: 16px;
}
h3 {
color: $o-brand-odoo;
color: $o-company-primary-color;
font-weight: 700;
font-size: 1.25rem;
max-width: 300px;
@@ -22,12 +22,12 @@
white-space: nowrap;
}
ul {
border-top: 1px solid $o-brand-odoo;
border-bottom: 1px solid $o-brand-odoo;
border-top: 1px solid $o-company-secondary-color;
border-bottom: 1px solid $o-company-secondary-color;
padding: 4px 0;
margin: 0 0 4px 0;
li {
color: $o-brand-odoo;
color: $o-company-secondary-color;
}
}
}
@@ -37,7 +37,10 @@
background-position: bottom center;
background-repeat: no-repeat;
min-height: 620px;
strong {
color: $o-company-secondary-color;
}
.table {
border-top: 1px solid gray('300');
}
@@ -45,8 +48,11 @@
.table td, .table th {
border-top: none;
}
thead tr th, h2 {
color: $o-brand-odoo;
h2 {
color: $o-company-primary-color;
}
thead tr th {
color: $o-company-secondary-color
}
tbody {
color: gray('700');
@@ -75,9 +81,11 @@
&.o_total {
border-top: none !important;
td {
color: $o-brand-odoo;
border-top: 1px solid gray('400') !important;
}
strong {
color: $o-company-primary-color;
}
}
}
}
+17 -5
View File
@@ -1,5 +1,4 @@
.o_boxed_footer, .o_boxed_header, .o_report_layout_boxed {
font-family: 'Lato', 'Noto';
color: gray('700');
font-size: 15px;
}
@@ -17,15 +16,24 @@
.o_boxed_footer {
margin-top: 200px;
white-space: nowrap;
border-top: 3px solid gray('700');
border-top: 3px solid $o-company-secondary-color;
ul {
margin: 4px 0;
}
}
.o_report_layout_boxed {
#total strong {
color: $o-company-primary-color;
}
#informations strong {
color: $o-company-secondary-color;
}
> h2 {
text-transform: uppercase;
}
h2 span {
color: $o-company-primary-color;
}
table {
border: 1px solid gray('700');
thead {
@@ -33,6 +41,7 @@
tr th {
text-transform: uppercase;
border: 1px solid gray('700');
color: $o-company-secondary-color;
}
}
tbody {
@@ -50,12 +59,12 @@
border-bottom: 1px solid gray('700');
}
&.o_line_section td {
background-color: gray('700');
background-color: rgba($o-company-primary-color, 0.7);
color: #fff;
}
&.is-subtotal,
td.o_price_total {
background-color: gray('200');
background-color: rgba($o-company-secondary-color, 0.1);
}
}
}
@@ -83,13 +92,16 @@
}
&:last-child td,
&.o_total td {
background-color: gray('700');
background-color: rgba($o-company-primary-color, 0.9);
color: #fff;
&:first-child {
border-right: none;
}
}
&.o_total strong {
color: white;
}
}
}
}
+17 -18
View File
@@ -1,25 +1,21 @@
.o_clean_footer, .o_clean_header, .o_report_layout_clean {
font-family: 'Lato', 'Noto';
color: #000;
}
.o_clean_header {
border-bottom: 1px solid $o-brand-primary;
img {
max-height: 90px;
max-width: 300px;
}
.o_clean_header img {
max-height: 90px;
max-width: 300px;
}
.o_clean_footer {
margin: 0 3px;
margin-top: 200px;
border-top: 3px solid $o-brand-odoo;
border-top: 3px solid $o-company-secondary-color;
h4 {
color: $o-brand-odoo;
color: $o-company-secondary-color;
font-weight: bolder;
}
.pagenumber {
border: 3px solid $o-brand-odoo;
background-color: $o-brand-primary;
border: 3px solid $o-company-primary-color;
background-color: $o-company-secondary-color;
color: white;
padding: 4px 8px;
text-align: center;
@@ -27,11 +23,11 @@
}
.o_report_layout_clean {
h1, h2, h3 {
color: $o-brand-primary;
color: $o-company-primary-color;
font-weight: bolder;
}
strong {
color: $o-brand-odoo;
color: $o-company-secondary-color;
}
table {
&.o_main_table {
@@ -39,13 +35,11 @@
}
thead {
color: $o-brand-odoo;
color: $o-company-secondary-color;
tr th {
border-top: 3px solid $o-brand-odoo !important;
border-top: 3px solid $o-company-secondary-color !important;
text-transform: uppercase;
}
tr th:last-child {
}
tr th:first-child {
width: 48%;
}
@@ -56,7 +50,7 @@
border-top: none;
}
tr:last-child td {
border-bottom: 3px solid $o-brand-odoo;
border-bottom: 3px solid $o-company-secondary-color;
}
tr {
td {
@@ -67,6 +61,11 @@
}
}
}
#total {
strong {
color: $o-company-secondary-color;
}
}
/*Total table*/
/* compat 12.0 */
.row:not(#total) > div:has(table) {
@@ -1,3 +1,22 @@
.o_standard_footer {
margin-top: 200px;
}
.o_report_layout_standard {
h2 {
color: $o-company-primary-color;
}
#informations strong {
color: $o-company-secondary-color;
}
#total strong{
color: $o-company-primary-color;
}
table {
thead {
color: $o-company-secondary-color;
}
}
}
+5
View File
@@ -1,3 +1,7 @@
$o-company-font: 'Lato' !default;
$o-company-primary-color: rgb(0, 0, 0) !default;
$o-company-secondary-color: rgb(0, 0, 0) !default;
html, body {
height: 100%;
direction: ltr;
@@ -6,6 +10,7 @@ html, body {
body {
color: #000 !important;
word-wrap: break-word;
font-family: $o-company-font;
}
.border-black td, .border-black th {
border-top: 1px solid black !important;

Some files were not shown because too many files have changed in this diff Show More