[MIG] report_label

[IMP] allow to create report.paperformat.label without creating each time report.paperformat item
[FIX] Remove useless data that are specific Label: Agipa 114016
[REF] simplify UI, removing custom entry for ir.actions.server
[ADD] migration script to migrate name field
[IMP] Add label_background_color to allow to easily define background-color for label. (That can be usefull to debug label positions)
[DOC] update screenshots to new V16 versions
[IMP] Set body and html margin to 0 to to able to be predictive when designing a label sheet
[IMP] replace style by class in the label template, reducing the size of the html code generated.
[IMP] replace label_template by label_template_view_id on the ir.actions.server model, removing useless xml and python code. (provide migration scripts)
[REF] Split wizard file into wizard and wizard line file, following OCA guidelines
This commit is contained in:
Sylvain LE GAL
2023-01-03 11:17:16 +01:00
parent fe3537b11b
commit 85bb60b356
25 changed files with 217 additions and 189 deletions

View File

@@ -5,42 +5,17 @@
<field name="model">ir.actions.server</field>
<field name="inherit_id" ref="base.view_server_action_form" />
<field name="arch" type="xml">
<header position="inside">
<button
name="report_label_associated_view"
type="object"
string="View QWeb templates"
attrs="{'invisible':['|', ('state', '!=', 'report_label'), ('label_template', '=', False)]}"
help="Display a button in the sidebar of related model to open a wizard"
/>
</header>
<field name="type" position="after">
<field
name="label_paperformat_id"
attrs="{'invisible': [('state', '!=', 'report_label')]}"
/>
<field
name="label_template"
name="label_template_view_id"
attrs="{'invisible': [('state', '!=', 'report_label')]}"
/>
</field>
</field>
</record>
<record id="report_label_action" model="ir.actions.act_window">
<field name="name">Label Reports</field>
<field name="res_model">ir.actions.server</field>
<field name="view_mode">tree,form</field>
<field name="domain">[("state", "=", "report_label")]</field>
<field name="context">{"default_state": "report_label"}</field>
</record>
<menuitem
id="report_label_menu"
name="Label Reports"
action="report_label_action"
parent="base.reporting_menuitem"
sequence="3"
/>
</odoo>

View File

@@ -1,50 +1,49 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="paperformat_label_view_form" model="ir.ui.view">
<record id="view_paperformat_label_view_form" model="ir.ui.view">
<field name="model">report.paperformat.label</field>
<field name="inherit_id" ref="base.paperformat_view_form" />
<field name="mode">primary</field>
<field name="arch" type="xml">
<!-- Hide irrelevant fields -->
<field name="header_line" position="attributes">
<attribute name="invisible">1</attribute>
</field>
<field name="header_spacing" position="attributes">
<attribute name="invisible">1</attribute>
</field>
<field name="report_ids" position="attributes">
<attribute name="invisible">1</attribute>
</field>
<!-- Add label paper format fields -->
<sheet position="inside">
<group name="label">
<group name="label_size" string="Label Size" colspan="2">
<field name="label_height" />
<field name="label_width" />
<form string="Paper format configuration">
<sheet>
<group>
<field name="name" />
<field name="paperformat_id" />
</group>
<group name="label_padding" string="Label Padding">
<field string="Top (mm)" name="label_padding_top" />
<field string="Right (mm)" name="label_padding_right" />
<field string="Bottom (mm)" name="label_padding_bottom" />
<field string="Left (mm)" name="label_padding_left" />
<group name="label">
<group
name="label_settings"
string="Label Settings"
colspan="2"
>
<field name="label_height" />
<field name="label_width" />
<field name="label_background_color" widget="color" />
</group>
<group name="label_padding" string="Label Padding">
<field string="Top (mm)" name="label_padding_top" />
<field string="Right (mm)" name="label_padding_right" />
<field string="Bottom (mm)" name="label_padding_bottom" />
<field string="Left (mm)" name="label_padding_left" />
</group>
<group name="label_margin" string="Label Margin">
<field string="Top (mm)" name="label_margin_top" />
<field string="Right (mm)" name="label_margin_right" />
<field string="Bottom (mm)" name="label_margin_bottom" />
<field string="Left (mm)" name="label_margin_left" />
</group>
</group>
<group name="label_margin" string="Label Margin">
<field string="Top (mm)" name="label_margin_top" />
<field string="Right (mm)" name="label_margin_right" />
<field string="Bottom (mm)" name="label_margin_bottom" />
<field string="Left (mm)" name="label_margin_left" />
</group>
</group>
</sheet>
</sheet>
</form>
</field>
</record>
<record id="paperformat_label_view_tree" model="ir.ui.view">
<field name="model">report.paperformat.label</field>
<field name="arch" type="xml">
<tree string="Label paper format configuration">
<tree>
<field name="name" />
<field name="paperformat_id" />
<field name="label_height" />
<field name="label_width" />
</tree>