diff options
| author | Julien Mougenot <jum@odoo.com> | 2019-07-18 15:18:41 +0000 |
|---|---|---|
| committer | Vincent Schippefilt <vsc@odoo.com> | 2019-07-29 08:29:26 +0000 |
| commit | ed18095127b20da516fa5ada943b2dd6d5c84652 (patch) | |
| tree | 98529e7fd7dc90d1a48173114878594a43c31555 /addons/web/static/src/js/fields/relational_fields.js | |
| parent | a8c93df9c8663ae90afbabeeffeff7d509aeaa26 (diff) | |
[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>
Diffstat (limited to 'addons/web/static/src/js/fields/relational_fields.js')
| -rw-r--r-- | addons/web/static/src/js/fields/relational_fields.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/addons/web/static/src/js/fields/relational_fields.js b/addons/web/static/src/js/fields/relational_fields.js index d50e03540f2..0f13228526e 100644 --- a/addons/web/static/src/js/fields/relational_fields.js +++ b/addons/web/static/src/js/fields/relational_fields.js @@ -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, }; |
