Holger Brunn
5 years ago
committed by
Alexei Rivera
9 changed files with 103 additions and 88 deletions
-
3partner_label/__init__.py
-
8partner_label/__manifest__.py
-
5partner_label/models/__init__.py
-
7partner_label/models/res_company.py
-
27partner_label/models/res_config_settings.py
-
46partner_label/reports/res_partner.xml
-
3partner_label/tests/__init__.py
-
14partner_label/tests/test_partner_label.py
-
78partner_label/views/base_config_settings.xml
@ -1,4 +1 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright 2017 Therp BV <http://therp.nl> |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
from . import models |
@ -1,5 +1,2 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright 2017 Therp BV <http://therp.nl> |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
from . import res_company |
|||
from . import base_config_settings |
|||
from . import res_config_settings |
@ -1,39 +1,31 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<odoo> |
|||
<template id="view_res_partner_label"> |
|||
<t t-raw="'<base href=%s>' % base_url"/> |
|||
<!DOCTYPE html> |
|||
<html> |
|||
<head> |
|||
<meta charset="utf-8"/> |
|||
</head> |
|||
<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-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> |
|||
<t t-call="web.basic_layout"> |
|||
<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-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> |
|||
</body> |
|||
</html> |
|||
</t> |
|||
</t> |
|||
</template> |
|||
<report id="report_res_partner_label" |
|||
string="Partner Labels" |
|||
model="res.partner" |
|||
name="partner_label.view_res_partner_label" |
|||
report_type="qweb-pdf" |
|||
paperformat="report.paperformat_euro" |
|||
paperformat="base.paperformat_euro" |
|||
/> |
|||
</odoo> |
@ -1,4 +1 @@ |
|||
# -*- coding: utf-8 -*- |
|||
# Copyright 2017 Therp BV <http://therp.nl> |
|||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|||
from . import test_partner_label |
@ -1,31 +1,63 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<odoo> |
|||
<record id="view_general_configuration" model="ir.ui.view"> |
|||
<field name="model">base.config.settings</field> |
|||
<field name="inherit_id" ref="base_setup.view_general_configuration" /> |
|||
<field name="model">res.config.settings</field> |
|||
<field name="inherit_id" ref="base_setup.res_config_settings_view_form" /> |
|||
<field name="arch" type="xml"> |
|||
<group name="report" position="after"> |
|||
<group name="partner_labels" string="Labels configuration"> |
|||
<label for="partner_labels_width" /> |
|||
<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 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 |
|||
<xpath expr="//div[@id='business_documents']" position="after"> |
|||
<div id="partner_labels"> |
|||
<h2>Labels configuration</h2> |
|||
<div class="row mt16 o_settings_container"> |
|||
<div class="col-12 col-lg-6 o_setting_box"> |
|||
<div class="o_setting_right_pane"> |
|||
<div class="content-group"> |
|||
<div class="mt16 row"> |
|||
<label for="partner_labels_width" class="col-3 col-lg-3 o_light_label"/> |
|||
<field name="partner_labels_width" class="oe_inline" />mm |
|||
</div> |
|||
<div class="mt16 row"> |
|||
<label for="partner_labels_height" class="col-3 col-lg-3 o_light_label"/> |
|||
<field name="partner_labels_height" class="oe_inline" />mm |
|||
</div> |
|||
<div class="mt16 row"> |
|||
<label for="partner_labels_padding" class="col-3 col-lg-3 o_light_label"/> |
|||
<field name="partner_labels_padding" class="oe_inline" />mm |
|||
</div> |
|||
<div class="mt16 row"> |
|||
<label for="partner_labels_paperformat_id" class="col-3 col-lg-3 o_light_label"/> |
|||
<field name="partner_labels_paperformat_id" class="oe_inline" /> |
|||
</div> |
|||
<div class="mt16"> |
|||
<button type="object" name="action_partner_labels_preview" string="Preview" class="oe_link" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="col-12 col-lg-6 o_setting_box"> |
|||
<div class="o_setting_right_pane"> |
|||
<div class="content-group"> |
|||
<div class="mt16 row"> |
|||
<label for="partner_labels_margin_top" class="col-3 col-lg-3 o_light_label"/> |
|||
<field name="partner_labels_margin_top" class="oe_inline" />mm |
|||
</div> |
|||
<div class="mt16 row"> |
|||
<label for="partner_labels_margin_bottom" class="col-3 col-lg-3 o_light_label"/> |
|||
<field name="partner_labels_margin_bottom" class="oe_inline" />mm |
|||
</div> |
|||
<div class="mt16 row"> |
|||
<label for="partner_labels_margin_left" class="col-3 col-lg-3 o_light_label"/> |
|||
<field name="partner_labels_margin_left" class="oe_inline" />mm |
|||
</div> |
|||
<div class="mt16 row"> |
|||
<label for="partner_labels_margin_right" class="col-3 col-lg-3 o_light_label"/> |
|||
<field name="partner_labels_margin_right" class="oe_inline" />mm |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<label for="partner_labels_padding" /> |
|||
<div><field name="partner_labels_padding" class="oe_inline" /> mm</div> |
|||
<label for="partner_labels_paperformat_id" /> |
|||
<div> |
|||
<field name="partner_labels_paperformat_id" class="oe_inline" /> |
|||
<button type="object" name="action_partner_labels_preview" string="Preview" /> |
|||
</div> |
|||
</group> |
|||
</group> |
|||
</div> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue