[FIX] mis_template_financial_report: feature parity with v12

This commit is contained in:
Holger Brunn
2024-04-08 10:05:39 +02:00
committed by Geraldo Lopez
parent d7b076542d
commit cf82fd121d
16 changed files with 116 additions and 117 deletions

View File

@@ -0,0 +1,11 @@
.oe_mis_builder_content.horizontal {
display: flex;
flex-wrap: wrap;
gap: 5px;
}
.oe_mis_builder_content.horizontal .oe_mis_builder_cp {
width: 100%;
}
.oe_mis_builder_content.horizontal .o_list_renderer {
flex-grow: 1;
}

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8" ?>
<templates>
<t t-inherit="mis_builder.MisReportWidget" t-inherit-mode="extension">
<xpath expr="//div[hasclass('oe_mis_builder_content')]" position="attributes">
<attribute
name="t-attf-class"
>{{state.mis_report_data.split_matrices and 'horizontal'}}</attribute>
</xpath>
<xpath expr="//table[hasclass('mis_builder')]/.." position="attributes">
<attribute
name="t-foreach"
>state.mis_report_data.split_matrices or [state.mis_report_data]</attribute>
<attribute name="t-as">matrix</attribute>
<attribute name="t-key">matrix_index</attribute>
</xpath>
<xpath
expr="//tr[@t-foreach='state.mis_report_data.header']"
position="attributes"
>
<attribute name="t-foreach">matrix.header</attribute>
</xpath>
<xpath
expr="//tr[@t-foreach='state.mis_report_data.body']"
position="attributes"
>
<attribute name="t-foreach">matrix.body</attribute>
</xpath>
</t>
</templates>

View File

@@ -1,7 +0,0 @@
.oe_mis_builder_content div.mis_builder_horizontal {
display: flex;
width: 100%;
}
.oe_mis_builder_content div.mis_builder_horizontal .table {
width: 50%;
}

View File

@@ -1,11 +1,11 @@
div.mis_builder_horizontal {
div.mis_builder_horizontal_container {
display: table;
width: 100%;
border-spacing: 5px;
}
div.mis_builder_horizontal > div {
div.mis_builder_horizontal_row {
display: table-row;
}
div.mis_builder_horizontal > div > div {
div.mis_builder_horizontal_cell {
display: table-cell;
padding: 2px;
}

View File

@@ -1,22 +0,0 @@
<template>
<t t-extend="MisReportWidgetTemplate">
<t t-jquery="table.mis_builder">
var $full_table = jQuery(this);
var $wrapper = jQuery(
'<div />'
).addClass('mis_builder_horizontal').insertAfter($full_table);
var $table = $full_table.clone().appendTo($wrapper);
$table.attr({
't-foreach': 'widget.mis_report_data.horizontal_matrices || []',
't-as': 'matrix',
});
$table.find('tr[t-foreach="widget.mis_report_data.header"]').attr(
't-foreach', 'matrix.header'
);
$table.find('tr[t-foreach="widget.mis_report_data.body"]').attr(
't-foreach', 'matrix.body'
);
$full_table.attr('t-if', '!widget.mis_report_data.horizontal_matrices');
</t>
</t>
</template>