[IMP] base: some cleaning in general settings

Use a new view to choose the document template.
Remove layout fields from base company form.
Reword Edit Header -> Edit Layout
Set a default logo for a new company in data instead of demo data

task: 60668
This commit is contained in:
eco-odoo
2018-07-20 11:59:12 +02:00
committed by Yannick Tivisse
parent b67209b001
commit 7c6bc684a9
6 changed files with 69 additions and 6 deletions
@@ -94,7 +94,7 @@ class ResConfigSettings(models.TransientModel):
@api.multi
def change_report_template(self):
self.ensure_one()
template = self.env.ref('base.view_company_report_form')
template = self.env.ref('base.view_company_document_template_form')
return {
'name': _('Choose Your Document Layout'),
'type': 'ir.actions.act_window',
@@ -40,7 +40,7 @@
</div>
<div class="mt16">
<button name="change_report_template" string="Change Document Template" type="object" class="oe_link" icon="fa-arrow-right"/>
<button name="edit_external_header" string="Edit Header" type="object" class="oe_link" groups="base.group_no_one"/>
<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>
</div>
+16
View File
@@ -603,6 +603,22 @@
margin-top: 32px !important;
}
}
&.o_company_document_layout {
.image_selection_container {
div {
width: 50%;
img {
margin-left: 0 !important;
}
}
}
td {
padding: 0 45px 0 0;
}
img[name="logo"] {
max-height: 300px;
}
}
}
// Overriden style when form view in modal
@@ -12,6 +12,7 @@
<field name="phone"></field>
<field name="email">info@yourcompany.com</field>
<field name="website">www.yourcompany.com</field>
<field name="image" type="base64" file="base/static/img/res_company_logo.png"/>
</record>
<record model="res.partner" id="base.partner_root">
-1
View File
@@ -25,7 +25,6 @@
<field name="phone">+1 555 123 8069</field>
<field name="email">info@yourcompany.example.com</field>
<field name="website">www.example.com</field>
<field name="image" type="base64" file="base/static/img/res_company_logo.png"/>
</record>
<record id="user_demo" model="res.users">
+50 -3
View File
@@ -28,7 +28,6 @@
<field name="zip" placeholder="ZIP" class="o_address_zip"/>
<field name="country_id" placeholder="Country" class="o_address_country" options='{"no_open": True}'/>
</div>
<field name="report_header" placeholder="e.g. Global Business Solutions"/>
</group>
<group>
<field name="website" widget="url" placeholder="e.g. www.odoo.com"/>
@@ -39,7 +38,6 @@
<field name="currency_id" options="{'no_create': True, 'no_open': True}" id="company_currency" context="{'active_test': False}"/>
<field name="parent_id" groups="base.group_multi_company"/>
<field name="sequence" invisible="1"/>
<field name="report_footer" placeholder="e.g. Your Bank Accounts, one per line"/>
</group>
<group name="social_media"/>
</group>
@@ -182,6 +180,55 @@
</xpath>
</field>
</record>
<record id="view_company_document_template_form" model="ir.ui.view">
<field name="name">res.company.document.template.form</field>
<field name="model">res.company</field>
<field name="mode">primary</field>
<field name="priority">2048</field>
<field name="arch" type="xml">
<form class="o_company_document_layout">
<group col="2">
<group>
<label for="external_report_layout" string="Template" colspan="2" />
<field name="external_report_layout" colspan="2" nolabel="1"
class="image_selection_container"
widget="image_selection" options="{
'background': {
'image_link': '/base/static/img/preview_background.png',
'preview_link': '/base/static/pdf/preview_background.pdf'
},
'boxed': {
'image_link': '/base/static/img/preview_boxed.png',
'preview_link': '/base/static/pdf/preview_boxed.pdf'
},
'clean': {
'image_link': '/base/static/img/preview_clean.png',
'preview_link': '/base/static/pdf/preview_clean.pdf'
},
'standard': {
'image_link': '/base/static/img/preview_standard.png',
'preview_link': '/base/static/pdf/preview_standard.pdf'
}
}" />
</group>
<group>
<label for="logo" colspan="2" string="Company logo" />
<field name="logo" widget="image" nolabel="1" colspan="2" />
<label for="report_header" colspan="2" string="Company Tagline" />
<field name="report_header" nolabel="1" colspan="2"
placeholder="e.g. Global Business Solutions" />
<label for="report_footer" colspan="2"
string="Extra information in the footer" />
<field name="report_footer" nolabel="1" colspan="2"
placeholder="e.g. Opening hours, bank accounts (one per line)" />
</group>
</group>
<footer>
<button special="save" string="Save" class="btn btn-primary" type="object" />
<button special="cancel" string="Cancel" />
</footer>
</form>
</field>
</record>
</data>
</odoo>