From c35123900a73b981afc373c4e3f6a99351eddd1c Mon Sep 17 00:00:00 2001 From: Benjamin Willig Date: Fri, 9 Mar 2018 11:24:13 +0100 Subject: [PATCH] [IMP] Allow to specify margin for each side (top, bottom, ...) --- partner_label/models/base_config_settings.py | 17 +++++++++++-- partner_label/models/res_company.py | 25 ++++++++++++++++++-- partner_label/reports/res_partner.xml | 5 +++- partner_label/views/base_config_settings.xml | 9 +++++-- 4 files changed, 49 insertions(+), 7 deletions(-) diff --git a/partner_label/models/base_config_settings.py b/partner_label/models/base_config_settings.py index c60f648f1..8690a7269 100644 --- a/partner_label/models/base_config_settings.py +++ b/partner_label/models/base_config_settings.py @@ -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, diff --git a/partner_label/models/res_company.py b/partner_label/models/res_company.py index 9cc273ee4..135e076ba 100644 --- a/partner_label/models/res_company.py +++ b/partner_label/models/res_company.py @@ -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, ) diff --git a/partner_label/reports/res_partner.xml b/partner_label/reports/res_partner.xml index c7ac7845f..d8e8da5a4 100644 --- a/partner_label/reports/res_partner.xml +++ b/partner_label/reports/res_partner.xml @@ -13,7 +13,10 @@
mm