Browse Source
Merge pull request #557 from acsone/10.0-fix_label_alignment-bwi
[FIX] partner_label: labels alignment
pull/525/merge
Rafael Blasco
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with
59 additions and
9 deletions
-
partner_label/models/base_config_settings.py
-
partner_label/models/res_company.py
-
partner_label/reports/res_partner.xml
-
partner_label/views/base_config_settings.xml
|
|
@ -16,8 +16,21 @@ class BaseConfigSettings(models.TransientModel): |
|
|
|
partner_labels_padding = fields.Float( |
|
|
|
related='company_id.partner_labels_padding', required=True, |
|
|
|
) |
|
|
|
partner_labels_margin = fields.Float( |
|
|
|
related='company_id.partner_labels_margin', required=True, |
|
|
|
partner_labels_margin_top = fields.Float( |
|
|
|
related='company_id.partner_labels_margin_top', |
|
|
|
required=True, |
|
|
|
) |
|
|
|
partner_labels_margin_bottom = fields.Float( |
|
|
|
related='company_id.partner_labels_margin_bottom', |
|
|
|
required=True, |
|
|
|
) |
|
|
|
partner_labels_margin_left = fields.Float( |
|
|
|
related='company_id.partner_labels_margin_left', |
|
|
|
required=True, |
|
|
|
) |
|
|
|
partner_labels_margin_right = fields.Float( |
|
|
|
related='company_id.partner_labels_margin_right', |
|
|
|
required=True, |
|
|
|
) |
|
|
|
partner_labels_paperformat_id = fields.Many2one( |
|
|
|
'report.paperformat', string='Paperformat', required=True, |
|
|
|
|
|
@ -16,6 +16,27 @@ class ResCompany(models.Model): |
|
|
|
partner_labels_padding = fields.Float( |
|
|
|
'Padding', default=5, help='Padding in millimeters', required=True, |
|
|
|
) |
|
|
|
partner_labels_margin = fields.Float( |
|
|
|
'Margin', default=1, help='Margin in millimeters', required=True, |
|
|
|
partner_labels_margin_top = fields.Float( |
|
|
|
string="Margin Top", |
|
|
|
default=1, |
|
|
|
help="Margin top in millimeters", |
|
|
|
required=True, |
|
|
|
) |
|
|
|
partner_labels_margin_bottom = fields.Float( |
|
|
|
string="Margin Bottom", |
|
|
|
default=1, |
|
|
|
help="Margin bottom in millimeters", |
|
|
|
required=True, |
|
|
|
) |
|
|
|
partner_labels_margin_left = fields.Float( |
|
|
|
string="Margin Left", |
|
|
|
default=1, |
|
|
|
help="Margin left in millimeters", |
|
|
|
required=True, |
|
|
|
) |
|
|
|
partner_labels_margin_right = fields.Float( |
|
|
|
string="Margin Right", |
|
|
|
default=1, |
|
|
|
help="Margin right in millimeters", |
|
|
|
required=True, |
|
|
|
) |
|
|
@ -10,8 +10,19 @@ |
|
|
|
<body class="container"> |
|
|
|
<div class="page"> |
|
|
|
<t t-foreach="docs.with_context(show_address=True)" t-as="this"> |
|
|
|
<div t-attf-style="height: {{this.company_id.partner_labels_height}}mm; width: {{this.company_id.partner_labels_width}}mm; padding: {{this.company_id.partner_labels_padding}}mm; margin: {{this.company_id.partner_labels_margin}}mm; display: inline-block; overflow: hidden;"> |
|
|
|
<address t-field="this.self" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}' /> |
|
|
|
<div t-attf-style="height: {{this.company_id.partner_labels_height}}mm; |
|
|
|
width: {{this.company_id.partner_labels_width}}mm; |
|
|
|
padding: {{this.company_id.partner_labels_padding}}mm; |
|
|
|
margin-top: {{this.company_id.partner_labels_margin_top}}mm; |
|
|
|
margin-bottom: {{this.company_id.partner_labels_margin_bottom}}mm; |
|
|
|
margin-left: {{this.company_id.partner_labels_margin_left}}mm; |
|
|
|
margin-right: {{this.company_id.partner_labels_margin_right}}mm; |
|
|
|
display: inline-block; |
|
|
|
overflow: hidden; |
|
|
|
float:left; |
|
|
|
page-break-inside: avoid;"> |
|
|
|
<address t-field="this.self" |
|
|
|
t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/> |
|
|
|
</div> |
|
|
|
</t> |
|
|
|
</div> |
|
|
@ -19,7 +30,7 @@ |
|
|
|
</html> |
|
|
|
</template> |
|
|
|
<report id="report_res_partner_label" |
|
|
|
string="Labels" |
|
|
|
string="Partner Labels" |
|
|
|
model="res.partner" |
|
|
|
name="partner_label.view_res_partner_label" |
|
|
|
report_type="qweb-pdf" |
|
|
|
|
|
@ -10,8 +10,13 @@ |
|
|
|
<div><field name="partner_labels_width" class="oe_inline" /> mm</div> |
|
|
|
<label for="partner_labels_height" /> |
|
|
|
<div><field name="partner_labels_height" class="oe_inline" /> mm</div> |
|
|
|
<label for="partner_labels_margin" /> |
|
|
|
<div><field name="partner_labels_margin" class="oe_inline" /> mm</div> |
|
|
|
<label string="Margin"/> |
|
|
|
<div class="oe_inline"> |
|
|
|
Top: <field name="partner_labels_margin_top" string="Top" class="oe_inline"/>mm, |
|
|
|
Bottom: <field name="partner_labels_margin_bottom" string="Bottom" class="oe_inline"/>mm, |
|
|
|
Left: <field name="partner_labels_margin_left" string="Left" class="oe_inline"/>mm, |
|
|
|
Right: <field name="partner_labels_margin_right" string="Right" class="oe_inline"/>mm |
|
|
|
</div> |
|
|
|
<label for="partner_labels_padding" /> |
|
|
|
<div><field name="partner_labels_padding" class="oe_inline" /> mm</div> |
|
|
|
<label for="partner_labels_paperformat_id" /> |
|
|
|