summaryrefslogtreecommitdiff
path: root/addons/base_setup
diff options
context:
space:
mode:
authorJulien Mougenot <jum@odoo.com>2019-07-18 15:18:41 +0000
committerVincent Schippefilt <vsc@odoo.com>2019-07-29 08:29:26 +0000
commited18095127b20da516fa5ada943b2dd6d5c84652 (patch)
tree98529e7fd7dc90d1a48173114878594a43c31555 /addons/base_setup
parenta8c93df9c8663ae90afbabeeffeff7d509aeaa26 (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/base_setup')
-rw-r--r--addons/base_setup/models/res_config_settings.py14
-rw-r--r--addons/base_setup/views/res_config_settings_views.xml8
2 files changed, 4 insertions, 18 deletions
diff --git a/addons/base_setup/models/res_config_settings.py b/addons/base_setup/models/res_config_settings.py
index a3f9cb1ec84..8ca043ba295 100644
--- a/addons/base_setup/models/res_config_settings.py
+++ b/addons/base_setup/models/res_config_settings.py
@@ -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')
diff --git a/addons/base_setup/views/res_config_settings_views.xml b/addons/base_setup/views/res_config_settings_views.xml
index 2398075bf0e..76cccad3b38 100644
--- a/addons/base_setup/views/res_config_settings_views.xml
+++ b/addons/base_setup/views/res_config_settings_views.xml
@@ -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>