From ed18095127b20da516fa5ada943b2dd6d5c84652 Mon Sep 17 00:00:00 2001 From: Julien Mougenot Date: Thu, 18 Jul 2019 15:18:41 +0000 Subject: [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 closes odoo/odoo#33863 Signed-off-by: VincentSchippefilt Co-authored-by: Lucas Perais --- .../static/tests/fields/relational_fields_tests.js | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'addons/web/static/tests/fields/relational_fields_tests.js') diff --git a/addons/web/static/tests/fields/relational_fields_tests.js b/addons/web/static/tests/fields/relational_fields_tests.js index b5e098d230c..229d020bfbd 100644 --- a/addons/web/static/tests/fields/relational_fields_tests.js +++ b/addons/web/static/tests/fields/relational_fields_tests.js @@ -2131,6 +2131,42 @@ QUnit.module('relational_fields', { form.destroy(); }); + QUnit.module('FieldSelectionFont'); + + QUnit.test('FieldSelectionFont displays the correct fonts on options', async function (assert) { + assert.expect(4); + + this.data.partner.fields.fonts = { + type: "selection", + selection: [['Lato', "Lato"], ['Oswald', "Oswald"]], + default: 'Lato', + string: "Fonts", + }; + + var form = await createView({ + View: FormView, + model: 'partner', + data: this.data, + arch: '
' + + '' + + '', + }); + var options = form.$('.o_field_widget[name="fonts"] > option'); + + assert.strictEqual(form.$('.o_field_widget[name="fonts"]').css('fontFamily'), 'Lato', + "Widget font should be default (Lato)"); + assert.strictEqual($(options[0]).css('fontFamily'), 'Lato', + "Option 0 should have the correct font (Lato)"); + assert.strictEqual($(options[1]).css('fontFamily'), 'Oswald', + "Option 1 should have the correct font (Oswald)"); + + await testUtils.fields.editSelect(form.$('.o_field_widget[name="fonts"]'), '"Oswald"'); + assert.strictEqual(form.$('.o_field_widget[name="fonts"]').css('fontFamily'), 'Oswald', + "Widget font should be updated (Oswald)"); + + form.destroy(); + }); + QUnit.module('FieldMany2ManyCheckBoxes'); QUnit.test('widget many2many_checkboxes', async function (assert) { -- cgit v1.2.3