changeset 3562b200d77e in modules/stock:default
details: https://hg.tryton.org/modules/stock?cmd=changeset&node=3562b200d77e
description:
        Add general reporting margin

        Also inherit from the main view to reduce the number of XML files.
        And add sum attribute to reporting with unique grouped lines.

        issue10829
        review379291002
diffstat:

 __init__.py                                                 |    2 +
 stock_reporting_margin.py                                   |   22 +
 stock_reporting_margin.xml                                  |  210 +++++++++++-
 view/reporting_margin_category_graph_amount.xml             |   12 +-
 view/reporting_margin_category_graph_margin.xml             |   11 +-
 view/reporting_margin_category_graph_profit.xml             |   11 +-
 view/reporting_margin_category_list.xml                     |   21 +-
 view/reporting_margin_category_time_series_graph_amount.xml |   12 -
 view/reporting_margin_category_time_series_graph_margin.xml |   11 -
 view/reporting_margin_category_time_series_graph_profit.xml |   11 -
 view/reporting_margin_category_time_series_list.xml         |   12 -
 view/reporting_margin_main_graph_amount.xml                 |   12 +
 view/reporting_margin_main_graph_margin.xml                 |   11 +
 view/reporting_margin_main_graph_profit.xml                 |   11 +
 view/reporting_margin_main_list.xml                         |   12 +
 view/reporting_margin_main_time_series_graph_amount.xml     |   12 +
 view/reporting_margin_main_time_series_graph_margin.xml     |   11 +
 view/reporting_margin_main_time_series_graph_profit.xml     |   11 +
 view/reporting_margin_main_time_series_list.xml             |   12 +
 view/reporting_margin_product_graph_amount.xml              |   12 +-
 view/reporting_margin_product_graph_margin.xml              |   11 +-
 view/reporting_margin_product_graph_profit.xml              |   11 +-
 view/reporting_margin_product_list.xml                      |   17 +-
 view/reporting_margin_product_time_series_graph_amount.xml  |   12 -
 view/reporting_margin_product_time_series_graph_margin.xml  |   11 -
 view/reporting_margin_product_time_series_graph_profit.xml  |   11 -
 view/reporting_margin_product_time_series_list.xml          |   15 +-
 27 files changed, 356 insertions(+), 171 deletions(-)

diffs (772 lines):

diff -r 7a60c89918d0 -r 3562b200d77e __init__.py
--- a/__init__.py       Fri Oct 08 19:16:45 2021 +0200
+++ b/__init__.py       Mon Oct 11 18:41:34 2021 +0200
@@ -58,6 +58,8 @@
         ir.Cron,
         res.User,
         stock_reporting_margin.Context,
+        stock_reporting_margin.Main,
+        stock_reporting_margin.MainTimeseries,
         stock_reporting_margin.Product,
         stock_reporting_margin.ProductTimeseries,
         stock_reporting_margin.Category,
diff -r 7a60c89918d0 -r 3562b200d77e stock_reporting_margin.py
--- a/stock_reporting_margin.py Fri Oct 08 19:16:45 2021 +0200
+++ b/stock_reporting_margin.py Mon Oct 11 18:41:34 2021 +0200
@@ -333,6 +333,28 @@
         return Transaction().context.get('include_lost', False)
 
 
+class Main(Abstract, ModelView):
+    "Stock Reporting Margin"
+    __name__ = 'stock.reporting.margin.main'
+
+    time_series = fields.Function(fields.One2Many(
+            'stock.reporting.margin.main.time_series', None, "Time Series"),
+        'get_time_series')
+
+    def get_rec_name(self, name):
+        return ''
+
+    def get_time_series(self, name):
+        pool = Pool()
+        Timeseries = pool.get('stock.reporting.margin.main.time_series')
+        return [t.id for t in Timeseries.search([])]
+
+
+class MainTimeseries(AbstractTimeseries, ModelView):
+    "Stock Reporting Margin"
+    __name__ = 'stock.reporting.margin.main.time_series'
+
+
 class ProductMixin:
     __slots__ = ()
 
diff -r 7a60c89918d0 -r 3562b200d77e stock_reporting_margin.xml
--- a/stock_reporting_margin.xml        Fri Oct 08 19:16:45 2021 +0200
+++ b/stock_reporting_margin.xml        Mon Oct 11 18:41:34 2021 +0200
@@ -20,29 +20,202 @@
             <field name="name">reporting_margin_context_form</field>
         </record>
 
+        <!-- Main -->
+
+        <record model="ir.ui.view" id="reporting_margin_main_view_list">
+            <field name="model">stock.reporting.margin.main</field>
+            <field name="type">tree</field>
+            <field name="name">reporting_margin_main_list</field>
+        </record>
+
+        <record model="ir.ui.view" 
id="reporting_margin_main_view_graph_margin">
+            <field name="model">stock.reporting.margin.main</field>
+            <field name="type">graph</field>
+            <field name="name">reporting_margin_main_graph_margin</field>
+        </record>
+
+        <record model="ir.ui.view" 
id="reporting_margin_main_view_graph_profit">
+            <field name="model">stock.reporting.margin.main</field>
+            <field name="type">graph</field>
+            <field name="name">reporting_margin_main_graph_profit</field>
+        </record>
+
+        <record model="ir.ui.view" 
id="reporting_margin_main_view_graph_amount">
+            <field name="model">stock.reporting.margin.main</field>
+            <field name="type">graph</field>
+            <field name="name">reporting_margin_main_graph_amount</field>
+        </record>
+
+        <record model="ir.action.act_window" id="act_reporting_margin_main">
+            <field name="name">Margins</field>
+            <field name="res_model">stock.reporting.margin.main</field>
+            <field name="context_model">stock.reporting.margin.context</field>
+        </record>
+        <record model="ir.action.act_window.view" 
id="act_reporting_margin_main_view1">
+            <field name="sequence" eval="10"/>
+            <field name="view" ref="reporting_margin_main_view_list"/>
+            <field name="act_window" ref="act_reporting_margin_main"/>
+        </record>
+        <record model="ir.action.act_window.view" 
id="act_reporting_margin_main_view2">
+            <field name="sequence" eval="20"/>
+            <field name="view" ref="reporting_margin_main_view_graph_margin"/>
+            <field name="act_window" ref="act_reporting_margin_main"/>
+        </record>
+        <record model="ir.action.act_window.view" 
id="act_reporting_margin_main_view3">
+            <field name="sequence" eval="30"/>
+            <field name="view" ref="reporting_margin_main_view_graph_profit"/>
+            <field name="act_window" ref="act_reporting_margin_main"/>
+        </record>
+        <record model="ir.action.act_window.view" 
id="act_reporting_margin_main_view4">
+            <field name="sequence" eval="40"/>
+            <field name="view" ref="reporting_margin_main_view_graph_amount"/>
+            <field name="act_window" ref="act_reporting_margin_main"/>
+        </record>
+        <record model="ir.action.keyword" 
id="act_reporting_margin_main_keyword1">
+            <field name="keyword">tree_open</field>
+            <field name="model" eval="'ir.ui.menu,%s' % 
ref('menu_reporting_margin')"/>
+            <field name="action" ref="act_reporting_margin_main"/>
+        </record>
+
+        <record model="ir.rule.group" 
id="rule_group_reporting_margin_main_companies">
+            <field name="name">User in companies</field>
+            <field name="model" search="[('model', '=', 
'stock.reporting.margin.main')]"/>
+            <field name="global_p" eval="True"/>
+        </record>
+        <record model="ir.rule" id="rule_reporting_margin_main_companies">
+            <field name="domain"
+                eval="[('company', 'in', Eval('companies', []))]"
+                pyson="1"/>
+            <field name="rule_group" 
ref="rule_group_reporting_margin_main_companies"/>
+        </record>
+
+        <record model="ir.model.access" id="access_reporting_margin_main">
+            <field name="model" search="[('model', '=', 
'stock.reporting.margin.main')]"/>
+            <field name="perm_read" eval="False"/>
+            <field name="perm_write" eval="False"/>
+            <field name="perm_create" eval="False"/>
+            <field name="perm_delete" eval="False"/>
+        </record>
+        <record model="ir.model.access" 
id="access_reporting_margin_main_product_admin">
+            <field name="model" search="[('model', '=', 
'stock.reporting.margin.main')]"/>
+            <field name="group" ref="product.group_product_admin"/>
+            <field name="perm_read" eval="True"/>
+            <field name="perm_write" eval="False"/>
+            <field name="perm_create" eval="False"/>
+            <field name="perm_delete" eval="False"/>
+        </record>
+
+        <record model="ir.ui.view" 
id="reporting_margin_main_time_series_view_list">
+            <field name="model">stock.reporting.margin.main.time_series</field>
+            <field name="type">tree</field>
+            <field name="name">reporting_margin_main_time_series_list</field>
+        </record>
+
+        <record model="ir.ui.view" 
id="reporting_margin_main_time_series_view_graph_margin">
+            <field name="model">stock.reporting.margin.main.time_series</field>
+            <field name="type">graph</field>
+            <field 
name="name">reporting_margin_main_time_series_graph_margin</field>
+        </record>
+
+        <record model="ir.ui.view" 
id="reporting_margin_main_time_series_view_graph_profit">
+            <field name="model">stock.reporting.margin.main.time_series</field>
+            <field name="type">graph</field>
+            <field 
name="name">reporting_margin_main_time_series_graph_profit</field>
+        </record>
+
+        <record model="ir.ui.view" 
id="reporting_margin_main_time_series_view_graph_amount">
+            <field name="model">stock.reporting.margin.main.time_series</field>
+            <field name="type">graph</field>
+            <field 
name="name">reporting_margin_main_time_series_graph_amount</field>
+        </record>
+
+        <record model="ir.action.act_window" 
id="act_reporting_margin_main_time_series">
+            <field name="name">Margins</field>
+            <field 
name="res_model">stock.reporting.margin.main.time_series</field>
+            <field name="context_model">stock.reporting.margin.context</field>
+            <field name="order" eval="[('date', 'DESC')]" pyson="1"/>
+        </record>
+        <record model="ir.action.act_window.view" 
id="act_reporting_margin_main_time_series_view1">
+            <field name="sequence" eval="10"/>
+            <field name="view" 
ref="reporting_margin_main_time_series_view_list"/>
+            <field name="act_window" 
ref="act_reporting_margin_main_time_series"/>
+        </record>
+        <record model="ir.action.act_window.view" 
id="act_reporting_margin_main_time_series_view2">
+            <field name="sequence" eval="20"/>
+            <field name="view" 
ref="reporting_margin_main_time_series_view_graph_margin"/>
+            <field name="act_window" 
ref="act_reporting_margin_main_time_series"/>
+        </record>
+        <record model="ir.action.act_window.view" 
id="act_reporting_margin_main_time_series_view3">
+            <field name="sequence" eval="30"/>
+            <field name="view" 
ref="reporting_margin_main_time_series_view_graph_profit"/>
+            <field name="act_window" 
ref="act_reporting_margin_main_time_series"/>
+        </record>
+        <record model="ir.action.act_window.view" 
id="act_reporting_margin_main_time_series_view4">
+            <field name="sequence" eval="40"/>
+            <field name="view" 
ref="reporting_margin_main_time_series_view_graph_amount"/>
+            <field name="act_window" 
ref="act_reporting_margin_main_time_series"/>
+        </record>
+        <record model="ir.action.keyword" 
id="act_reporting_margin_main_time_series_keyword1">
+            <field name="keyword">tree_open</field>
+            <field name="model">stock.reporting.margin.main,-1</field>
+            <field name="action" ref="act_reporting_margin_main_time_series"/>
+        </record>
+
+        <record model="ir.rule.group" 
id="rule_group_reporting_margin_main_time_series_companies">
+            <field name="name">User in companies</field>
+            <field name="model" search="[('model', '=', 
'stock.reporting.margin.main.time_series')]"/>
+            <field name="global_p" eval="True"/>
+        </record>
+        <record model="ir.rule" 
id="rule_reporting_margin_main_time_series_companies">
+            <field name="domain"
+                eval="[('company', 'in', Eval('companies', []))]"
+                pyson="1"/>
+            <field name="rule_group" 
ref="rule_group_reporting_margin_main_time_series_companies"/>
+        </record>
+
+        <record model="ir.model.access" 
id="access_reporting_margin_main_time_series">
+            <field name="model" search="[('model', '=', 
'stock.reporting.margin.main.time_series')]"/>
+            <field name="perm_read" eval="False"/>
+            <field name="perm_write" eval="False"/>
+            <field name="perm_create" eval="False"/>
+            <field name="perm_delete" eval="False"/>
+        </record>
+        <record model="ir.model.access" 
id="access_reporting_margin_main_time_series_main_admin">
+            <field name="model" search="[('model', '=', 
'stock.reporting.margin.main.time_series')]"/>
+            <field name="group" ref="product.group_product_admin"/>
+            <field name="perm_read" eval="True"/>
+            <field name="perm_write" eval="False"/>
+            <field name="perm_create" eval="False"/>
+            <field name="perm_delete" eval="False"/>
+        </record>
+
         <!-- Product -->
 
         <record model="ir.ui.view" id="reporting_margin_product_view_list">
             <field name="model">stock.reporting.margin.product</field>
-            <field name="type">tree</field>
+            <field name="type" eval="None"/>
+            <field name="inherit" ref="reporting_margin_main_view_list"/>
             <field name="name">reporting_margin_product_list</field>
         </record>
 
         <record model="ir.ui.view" 
id="reporting_margin_product_view_graph_margin">
             <field name="model">stock.reporting.margin.product</field>
-            <field name="type">graph</field>
+            <field name="type" eval="None"/>
+            <field name="inherit" 
ref="reporting_margin_main_view_graph_margin"/>
             <field name="name">reporting_margin_product_graph_margin</field>
         </record>
 
         <record model="ir.ui.view" 
id="reporting_margin_product_view_graph_profit">
             <field name="model">stock.reporting.margin.product</field>
-            <field name="type">graph</field>
+            <field name="type" eval="None"/>
+            <field name="inherit" 
ref="reporting_margin_main_view_graph_profit"/>
             <field name="name">reporting_margin_product_graph_profit</field>
         </record>
 
         <record model="ir.ui.view" 
id="reporting_margin_product_view_graph_amount">
             <field name="model">stock.reporting.margin.product</field>
-            <field name="type">graph</field>
+            <field name="type" eval="None"/>
+            <field name="inherit" 
ref="reporting_margin_main_view_graph_amount"/>
             <field name="name">reporting_margin_product_graph_amount</field>
         </record>
 
@@ -107,26 +280,27 @@
 
         <record model="ir.ui.view" 
id="reporting_margin_product_time_series_view_list">
             <field 
name="model">stock.reporting.margin.product.time_series</field>
-            <field name="type">tree</field>
+            <field name="type" eval="None"/>
+            <field name="inherit" 
ref="reporting_margin_main_time_series_view_list"/>
             <field 
name="name">reporting_margin_product_time_series_list</field>
         </record>
 
         <record model="ir.ui.view" 
id="reporting_margin_product_time_series_view_graph_margin">
             <field 
name="model">stock.reporting.margin.product.time_series</field>
             <field name="type">graph</field>
-            <field 
name="name">reporting_margin_product_time_series_graph_margin</field>
+            <field 
name="name">reporting_margin_main_time_series_graph_margin</field>
         </record>
 
         <record model="ir.ui.view" 
id="reporting_margin_product_time_series_view_graph_profit">
             <field 
name="model">stock.reporting.margin.product.time_series</field>
             <field name="type">graph</field>
-            <field 
name="name">reporting_margin_product_time_series_graph_profit</field>
+            <field 
name="name">reporting_margin_main_time_series_graph_profit</field>
         </record>
 
         <record model="ir.ui.view" 
id="reporting_margin_product_time_series_view_graph_amount">
             <field 
name="model">stock.reporting.margin.product.time_series</field>
             <field name="type">graph</field>
-            <field 
name="name">reporting_margin_product_time_series_graph_amount</field>
+            <field 
name="name">reporting_margin_main_time_series_graph_amount</field>
         </record>
 
         <record model="ir.action.act_window" 
id="act_reporting_margin_product_time_series">
@@ -237,25 +411,29 @@
 
         <record model="ir.ui.view" id="reporting_margin_category_view_list">
             <field name="model">stock.reporting.margin.category</field>
-            <field name="type">tree</field>
+            <field name="type" eval="None"/>
+            <field name="inherit" ref="reporting_margin_main_view_list"/>
             <field name="name">reporting_margin_category_list</field>
         </record>
 
         <record model="ir.ui.view" 
id="reporting_margin_category_view_graph_margin">
             <field name="model">stock.reporting.margin.category</field>
-            <field name="type">graph</field>
+            <field name="type" eval="None"/>
+            <field name="inherit" 
ref="reporting_margin_main_view_graph_margin"/>
             <field name="name">reporting_margin_category_graph_margin</field>
         </record>
 
         <record model="ir.ui.view" 
id="reporting_margin_category_view_graph_profit">
             <field name="model">stock.reporting.margin.category</field>
-            <field name="type">graph</field>
+            <field name="type" eval="None"/>
+            <field name="inherit" 
ref="reporting_margin_main_view_graph_profit"/>
             <field name="name">reporting_margin_category_graph_profit</field>
         </record>
 
         <record model="ir.ui.view" 
id="reporting_margin_category_view_graph_amount">
             <field name="model">stock.reporting.margin.category</field>
-            <field name="type">graph</field>
+            <field name="type" eval="None"/>
+            <field name="inherit" 
ref="reporting_margin_main_view_graph_amount"/>
             <field name="name">reporting_margin_category_graph_amount</field>
         </record>
 
@@ -325,25 +503,25 @@
         <record model="ir.ui.view" 
id="reporting_margin_category_time_series_view_list">
             <field 
name="model">stock.reporting.margin.category.time_series</field>
             <field name="type">tree</field>
-            <field 
name="name">reporting_margin_category_time_series_list</field>
+            <field name="name">reporting_margin_main_time_series_list</field>
         </record>
 
         <record model="ir.ui.view" 
id="reporting_margin_category_time_series_view_graph_margin">
             <field 
name="model">stock.reporting.margin.category.time_series</field>
             <field name="type">graph</field>
-            <field 
name="name">reporting_margin_category_time_series_graph_margin</field>
+            <field 
name="name">reporting_margin_main_time_series_graph_margin</field>
         </record>
 
         <record model="ir.ui.view" 
id="reporting_margin_category_time_series_view_graph_profit">
             <field 
name="model">stock.reporting.margin.category.time_series</field>
             <field name="type">graph</field>
-            <field 
name="name">reporting_margin_category_time_series_graph_profit</field>
+            <field 
name="name">reporting_margin_main_time_series_graph_profit</field>
         </record>
 
         <record model="ir.ui.view" 
id="reporting_margin_category_time_series_view_graph_amount">
             <field 
name="model">stock.reporting.margin.category.time_series</field>
             <field name="type">graph</field>
-            <field 
name="name">reporting_margin_category_time_series_graph_amount</field>
+            <field 
name="name">reporting_margin_main_time_series_graph_amount</field>
         </record>
 
         <record model="ir.action.act_window" 
id="act_reporting_margin_category_time_series">
diff -r 7a60c89918d0 -r 3562b200d77e 
view/reporting_margin_category_graph_amount.xml
--- a/view/reporting_margin_category_graph_amount.xml   Fri Oct 08 19:16:45 
2021 +0200
+++ b/view/reporting_margin_category_graph_amount.xml   Mon Oct 11 18:41:34 
2021 +0200
@@ -1,12 +1,8 @@
 <?xml version="1.0"?>
 <!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
 this repository contains the full copyright notices and license terms. -->
-<graph>
-    <x>
+<data>
+    <xpath expr="//x/field[@name='id']" position="replace">
         <field name="category"/>
-    </x>
-    <y>
-        <field name="cost"/>
-        <field name="revenue"/>
-    </y>
-</graph>
+    </xpath>
+</data>
diff -r 7a60c89918d0 -r 3562b200d77e 
view/reporting_margin_category_graph_margin.xml
--- a/view/reporting_margin_category_graph_margin.xml   Fri Oct 08 19:16:45 
2021 +0200
+++ b/view/reporting_margin_category_graph_margin.xml   Mon Oct 11 18:41:34 
2021 +0200
@@ -1,11 +1,8 @@
 <?xml version="1.0"?>
 <!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
 this repository contains the full copyright notices and license terms. -->
-<graph type="line">
-    <x>
+<data>
+    <xpath expr="//x/field[@name='id']" position="replace">
         <field name="category"/>
-    </x>
-    <y>
-        <field name="margin" empty="0"/>
-    </y>
-</graph>
+    </xpath>
+</data>
diff -r 7a60c89918d0 -r 3562b200d77e 
view/reporting_margin_category_graph_profit.xml
--- a/view/reporting_margin_category_graph_profit.xml   Fri Oct 08 19:16:45 
2021 +0200
+++ b/view/reporting_margin_category_graph_profit.xml   Mon Oct 11 18:41:34 
2021 +0200
@@ -1,11 +1,8 @@
 <?xml version="1.0"?>
 <!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
 this repository contains the full copyright notices and license terms. -->
-<graph>
-    <x>
+<data>
+    <xpath expr="//x/field[@name='id']" position="replace">
         <field name="category"/>
-    </x>
-    <y>
-        <field name="profit"/>
-    </y>
-</graph>
+    </xpath>
+</data>
diff -r 7a60c89918d0 -r 3562b200d77e view/reporting_margin_category_list.xml
--- a/view/reporting_margin_category_list.xml   Fri Oct 08 19:16:45 2021 +0200
+++ b/view/reporting_margin_category_list.xml   Mon Oct 11 18:41:34 2021 +0200
@@ -1,13 +1,14 @@
 <?xml version="1.0"?>
 <!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
 this repository contains the full copyright notices and license terms. -->
-<tree keyword_open="1">
-    <field name="category" expand="1"/>
-    <field name="cost"/>
-    <field name="revenue"/>
-    <field name="profit"/>
-    <field name="margin" factor="100">
-        <suffix string="%" name="margin"/>
-    </field>
-    <field name="margin_trend" expand="1"/>
-</tree>
+<data>
+    <xpath expr="//field[@name='cost']" position="before">
+        <field name="category" expand="1"/>
+    </xpath>
+    <xpath expr="//field[@name='cost']" position="replace">
+        <field name="cost"/>
+    </xpath>
+    <xpath expr="//field[@name='revenue']" position="replace">
+        <field name="revenue"/>
+    </xpath>
+</data>
diff -r 7a60c89918d0 -r 3562b200d77e 
view/reporting_margin_category_time_series_graph_amount.xml
--- a/view/reporting_margin_category_time_series_graph_amount.xml       Fri Oct 
08 19:16:45 2021 +0200
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-<?xml version="1.0"?>
-<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
-this repository contains the full copyright notices and license terms. -->
-<graph>
-    <x>
-        <field name="date"/>
-    </x>
-    <y>
-        <field name="cost"/>
-        <field name="revenue"/>
-    </y>
-</graph>
diff -r 7a60c89918d0 -r 3562b200d77e 
view/reporting_margin_category_time_series_graph_margin.xml
--- a/view/reporting_margin_category_time_series_graph_margin.xml       Fri Oct 
08 19:16:45 2021 +0200
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-<?xml version="1.0"?>
-<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
-this repository contains the full copyright notices and license terms. -->
-<graph type="line">
-    <x>
-        <field name="date"/>
-    </x>
-    <y>
-        <field name="margin" empty="0"/>
-    </y>
-</graph>
diff -r 7a60c89918d0 -r 3562b200d77e 
view/reporting_margin_category_time_series_graph_profit.xml
--- a/view/reporting_margin_category_time_series_graph_profit.xml       Fri Oct 
08 19:16:45 2021 +0200
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-<?xml version="1.0"?>
-<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
-this repository contains the full copyright notices and license terms. -->
-<graph>
-    <x>
-        <field name="date"/>
-    </x>
-    <y>
-        <field name="profit"/>
-    </y>
-</graph>
diff -r 7a60c89918d0 -r 3562b200d77e 
view/reporting_margin_category_time_series_list.xml
--- a/view/reporting_margin_category_time_series_list.xml       Fri Oct 08 
19:16:45 2021 +0200
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-<?xml version="1.0"?>
-<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
-this repository contains the full copyright notices and license terms. -->
-<tree>
-    <field name="date"/>
-    <field name="cost"/>
-    <field name="revenue"/>
-    <field name="profit"/>
-    <field name="margin" factor="100">
-        <suffix string="%" name="margin"/>
-    </field>
-</tree>
diff -r 7a60c89918d0 -r 3562b200d77e view/reporting_margin_main_graph_amount.xml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/view/reporting_margin_main_graph_amount.xml       Mon Oct 11 18:41:34 
2021 +0200
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
+this repository contains the full copyright notices and license terms. -->
+<graph>
+    <x>
+        <field name="id"/>
+    </x>
+    <y>
+        <field name="cost"/>
+        <field name="revenue"/>
+    </y>
+</graph>
diff -r 7a60c89918d0 -r 3562b200d77e view/reporting_margin_main_graph_margin.xml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/view/reporting_margin_main_graph_margin.xml       Mon Oct 11 18:41:34 
2021 +0200
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
+this repository contains the full copyright notices and license terms. -->
+<graph type="line">
+    <x>
+        <field name="id"/>
+    </x>
+    <y>
+        <field name="margin" empty="0"/>
+    </y>
+</graph>
diff -r 7a60c89918d0 -r 3562b200d77e view/reporting_margin_main_graph_profit.xml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/view/reporting_margin_main_graph_profit.xml       Mon Oct 11 18:41:34 
2021 +0200
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
+this repository contains the full copyright notices and license terms. -->
+<graph>
+    <x>
+        <field name="id"/>
+    </x>
+    <y>
+        <field name="profit"/>
+    </y>
+</graph>
diff -r 7a60c89918d0 -r 3562b200d77e view/reporting_margin_main_list.xml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/view/reporting_margin_main_list.xml       Mon Oct 11 18:41:34 2021 +0200
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
+this repository contains the full copyright notices and license terms. -->
+<tree keyword_open="1">
+    <field name="cost" sum="Cost"/>
+    <field name="revenue" sum="Revenue"/>
+    <field name="profit"/>
+    <field name="margin" factor="100">
+        <suffix string="%" name="margin"/>
+    </field>
+    <field name="margin_trend" expand="1"/>
+</tree>
diff -r 7a60c89918d0 -r 3562b200d77e 
view/reporting_margin_main_time_series_graph_amount.xml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/view/reporting_margin_main_time_series_graph_amount.xml   Mon Oct 11 
18:41:34 2021 +0200
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
+this repository contains the full copyright notices and license terms. -->
+<graph>
+    <x>
+        <field name="date"/>
+    </x>
+    <y>
+        <field name="cost"/>
+        <field name="revenue"/>
+    </y>
+</graph>
diff -r 7a60c89918d0 -r 3562b200d77e 
view/reporting_margin_main_time_series_graph_margin.xml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/view/reporting_margin_main_time_series_graph_margin.xml   Mon Oct 11 
18:41:34 2021 +0200
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
+this repository contains the full copyright notices and license terms. -->
+<graph type="line">
+    <x>
+        <field name="date"/>
+    </x>
+    <y>
+        <field name="margin" empty="0"/>
+    </y>
+</graph>
diff -r 7a60c89918d0 -r 3562b200d77e 
view/reporting_margin_main_time_series_graph_profit.xml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/view/reporting_margin_main_time_series_graph_profit.xml   Mon Oct 11 
18:41:34 2021 +0200
@@ -0,0 +1,11 @@
+<?xml version="1.0"?>
+<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
+this repository contains the full copyright notices and license terms. -->
+<graph>
+    <x>
+        <field name="date"/>
+    </x>
+    <y>
+        <field name="profit"/>
+    </y>
+</graph>
diff -r 7a60c89918d0 -r 3562b200d77e 
view/reporting_margin_main_time_series_list.xml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/view/reporting_margin_main_time_series_list.xml   Mon Oct 11 18:41:34 
2021 +0200
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
+this repository contains the full copyright notices and license terms. -->
+<tree>
+    <field name="date"/>
+    <field name="cost" sum="Cost"/>
+    <field name="revenue" sum="Revenue"/>
+    <field name="profit"/>
+    <field name="margin" factor="100">
+        <suffix string="%" name="margin"/>
+    </field>
+</tree>
diff -r 7a60c89918d0 -r 3562b200d77e 
view/reporting_margin_product_graph_amount.xml
--- a/view/reporting_margin_product_graph_amount.xml    Fri Oct 08 19:16:45 
2021 +0200
+++ b/view/reporting_margin_product_graph_amount.xml    Mon Oct 11 18:41:34 
2021 +0200
@@ -1,12 +1,8 @@
 <?xml version="1.0"?>
 <!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
 this repository contains the full copyright notices and license terms. -->
-<graph>
-    <x>
+<data>
+    <xpath expr="//x/field[@name='id']" position="replace">
         <field name="product"/>
-    </x>
-    <y>
-        <field name="cost"/>
-        <field name="revenue"/>
-    </y>
-</graph>
+    </xpath>
+</data>
diff -r 7a60c89918d0 -r 3562b200d77e 
view/reporting_margin_product_graph_margin.xml
--- a/view/reporting_margin_product_graph_margin.xml    Fri Oct 08 19:16:45 
2021 +0200
+++ b/view/reporting_margin_product_graph_margin.xml    Mon Oct 11 18:41:34 
2021 +0200
@@ -1,11 +1,8 @@
 <?xml version="1.0"?>
 <!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
 this repository contains the full copyright notices and license terms. -->
-<graph type="line">
-    <x>
+<data>
+    <xpath expr="//x/field[@name='id']" position="replace">
         <field name="product"/>
-    </x>
-    <y>
-        <field name="margin" empty="0"/>
-    </y>
-</graph>
+    </xpath>
+</data>
diff -r 7a60c89918d0 -r 3562b200d77e 
view/reporting_margin_product_graph_profit.xml
--- a/view/reporting_margin_product_graph_profit.xml    Fri Oct 08 19:16:45 
2021 +0200
+++ b/view/reporting_margin_product_graph_profit.xml    Mon Oct 11 18:41:34 
2021 +0200
@@ -1,11 +1,8 @@
 <?xml version="1.0"?>
 <!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
 this repository contains the full copyright notices and license terms. -->
-<graph>
-    <x>
+<data>
+    <xpath expr="//x/field[@name='id']" position="replace">
         <field name="product"/>
-    </x>
-    <y>
-        <field name="profit"/>
-    </y>
-</graph>
+    </xpath>
+</data>
diff -r 7a60c89918d0 -r 3562b200d77e view/reporting_margin_product_list.xml
--- a/view/reporting_margin_product_list.xml    Fri Oct 08 19:16:45 2021 +0200
+++ b/view/reporting_margin_product_list.xml    Mon Oct 11 18:41:34 2021 +0200
@@ -1,14 +1,9 @@
 <?xml version="1.0"?>
 <!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
 this repository contains the full copyright notices and license terms. -->
-<tree keyword_open="1">
-    <field name="product" expand="1"/>
-    <field name="quantity" symbol="unit"/>
-    <field name="cost"/>
-    <field name="revenue"/>
-    <field name="profit"/>
-    <field name="margin" factor="100">
-        <suffix string="%" name="margin"/>
-    </field>
-    <field name="margin_trend" expand="1"/>
-</tree>
+<data>
+    <xpath expr="//field[@name='cost']" position="before">
+        <field name="product" expand="1"/>
+        <field name="quantity" symbol="unit"/>
+    </xpath>
+</data>
diff -r 7a60c89918d0 -r 3562b200d77e 
view/reporting_margin_product_time_series_graph_amount.xml
--- a/view/reporting_margin_product_time_series_graph_amount.xml        Fri Oct 
08 19:16:45 2021 +0200
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-<?xml version="1.0"?>
-<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
-this repository contains the full copyright notices and license terms. -->
-<graph>
-    <x>
-        <field name="date"/>
-    </x>
-    <y>
-        <field name="cost"/>
-        <field name="revenue"/>
-    </y>
-</graph>
diff -r 7a60c89918d0 -r 3562b200d77e 
view/reporting_margin_product_time_series_graph_margin.xml
--- a/view/reporting_margin_product_time_series_graph_margin.xml        Fri Oct 
08 19:16:45 2021 +0200
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-<?xml version="1.0"?>
-<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
-this repository contains the full copyright notices and license terms. -->
-<graph type="line">
-    <x>
-        <field name="date"/>
-    </x>
-    <y>
-        <field name="margin" empty="0"/>
-    </y>
-</graph>
diff -r 7a60c89918d0 -r 3562b200d77e 
view/reporting_margin_product_time_series_graph_profit.xml
--- a/view/reporting_margin_product_time_series_graph_profit.xml        Fri Oct 
08 19:16:45 2021 +0200
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
-<?xml version="1.0"?>
-<!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
-this repository contains the full copyright notices and license terms. -->
-<graph>
-    <x>
-        <field name="date"/>
-    </x>
-    <y>
-        <field name="profit"/>
-    </y>
-</graph>
diff -r 7a60c89918d0 -r 3562b200d77e 
view/reporting_margin_product_time_series_list.xml
--- a/view/reporting_margin_product_time_series_list.xml        Fri Oct 08 
19:16:45 2021 +0200
+++ b/view/reporting_margin_product_time_series_list.xml        Mon Oct 11 
18:41:34 2021 +0200
@@ -1,13 +1,8 @@
 <?xml version="1.0"?>
 <!-- This file is part of Tryton.  The COPYRIGHT file at the top level of
 this repository contains the full copyright notices and license terms. -->
-<tree>
-    <field name="date"/>
-    <field name="quantity" symbol="unit"/>
-    <field name="cost"/>
-    <field name="revenue"/>
-    <field name="profit"/>
-    <field name="margin" factor="100">
-        <suffix string="%" name="margin"/>
-    </field>
-</tree>
+<data>
+    <xpath expr="//field[@name='cost']" position="before">
+        <field name="quantity" symbol="unit"/>
+    </xpath>
+</data>

Reply via email to