From a05557880492d7ab8aa7b9e1bb6161d3baab73d3 Mon Sep 17 00:00:00 2001
From: Holger Brunn <mail@hunki-enterprises.com>
Date: Mon, 8 Apr 2024 10:02:07 +0200
Subject: [PATCH] [MIG] mis_template_financial_report: Migration to 16.0

---
 mis_template_financial_report/README.rst           | 12 ++++++------
 mis_template_financial_report/__manifest__.py      |  2 +-
 .../data/mis_report_kpi.xml                        | 14 ++++----------
 .../static/description/index.html                  |  8 ++++----
 .../odoo/addons/mis_template_financial_report      |  1 +
 setup/mis_template_financial_report/setup.py       |  6 ++++++
 6 files changed, 22 insertions(+), 21 deletions(-)
 create mode 120000 setup/mis_template_financial_report/odoo/addons/mis_template_financial_report
 create mode 100644 setup/mis_template_financial_report/setup.py

diff --git a/mis_template_financial_report/README.rst b/mis_template_financial_report/README.rst
index 94510688..9f2ae058 100644
--- a/mis_template_financial_report/README.rst
+++ b/mis_template_financial_report/README.rst
@@ -7,7 +7,7 @@ Profit & Loss / Balance sheet MIS templates
    !! This file is generated by oca-gen-addon-readme !!
    !! changes will be overwritten.                   !!
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-   !! source digest: sha256:5173beaf8096bf43b532eb27d814a8cce032965d4f433c55e82bb7b2c6ba11dc
+   !! source digest: sha256:ced5b0160af86207e009f52aac7844010df11f150873af1601845c0f0958ec23
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 
 .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
@@ -17,13 +17,13 @@ Profit & Loss / Balance sheet MIS templates
     :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
     :alt: License: AGPL-3
 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--financial--reporting-lightgray.png?logo=github
-    :target: https://github.com/OCA/account-financial-reporting/tree/15.0/mis_template_financial_report
+    :target: https://github.com/OCA/account-financial-reporting/tree/16.0/mis_template_financial_report
     :alt: OCA/account-financial-reporting
 .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
-    :target: https://translation.odoo-community.org/projects/account-financial-reporting-15-0/account-financial-reporting-15-0-mis_template_financial_report
+    :target: https://translation.odoo-community.org/projects/account-financial-reporting-16-0/account-financial-reporting-16-0-mis_template_financial_report
     :alt: Translate me on Weblate
 .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
-    :target: https://runboat.odoo-community.org/builds?repo=OCA/account-financial-reporting&target_branch=15.0
+    :target: https://runboat.odoo-community.org/builds?repo=OCA/account-financial-reporting&target_branch=16.0
     :alt: Try me on Runboat
 
 |badge1| |badge2| |badge3| |badge4| |badge5|
@@ -60,7 +60,7 @@ Bug Tracker
 Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-financial-reporting/issues>`_.
 In case of trouble, please check there if your issue has already been reported.
 If you spotted it first, help us to smash it by providing a detailed and welcomed
-`feedback <https://github.com/OCA/account-financial-reporting/issues/new?body=module:%20mis_template_financial_report%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
+`feedback <https://github.com/OCA/account-financial-reporting/issues/new?body=module:%20mis_template_financial_report%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
 
 Do not contact contributors directly about support or help with technical issues.
 
@@ -99,6 +99,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
 
 |maintainer-hbrunn| 
 
-This module is part of the `OCA/account-financial-reporting <https://github.com/OCA/account-financial-reporting/tree/15.0/mis_template_financial_report>`_ project on GitHub.
+This module is part of the `OCA/account-financial-reporting <https://github.com/OCA/account-financial-reporting/tree/16.0/mis_template_financial_report>`_ project on GitHub.
 
 You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/mis_template_financial_report/__manifest__.py b/mis_template_financial_report/__manifest__.py
index f9051a53..e8c05412 100644
--- a/mis_template_financial_report/__manifest__.py
+++ b/mis_template_financial_report/__manifest__.py
@@ -3,7 +3,7 @@
 
 {
     "name": "Profit & Loss / Balance sheet MIS templates",
-    "version": "15.0.1.0.1",
+    "version": "16.0.1.0.0",
     "license": "AGPL-3",
     "author": "Hunki Enterprises BV,Odoo Community Association (OCA)",
     "website": "https://github.com/OCA/account-financial-reporting",
diff --git a/mis_template_financial_report/data/mis_report_kpi.xml b/mis_template_financial_report/data/mis_report_kpi.xml
index d565732a..73fe1363 100644
--- a/mis_template_financial_report/data/mis_report_kpi.xml
+++ b/mis_template_financial_report/data/mis_report_kpi.xml
@@ -2,9 +2,7 @@
     <record id="kpi_loss" model="mis.report.kpi">
         <field name="name">loss</field>
         <field name="description">Loss</field>
-        <field
-            name="expression"
-        >balp[('user_type_id', 'in', (ref('account.data_account_type_depreciation').id, ref('account.data_account_type_direct_costs').id, ref('account.data_account_type_expenses').id))][]</field>
+        <field name="expression">balp[('account_type', 'like', 'expense%')][]</field>
         <field name="auto_expand_accounts">true</field>
         <field name="auto_expand_accounts_style_id" ref="style_details" />
         <field name="style_id" ref="style_header" />
@@ -17,9 +15,7 @@
     <record id="kpi_profit" model="mis.report.kpi">
         <field name="name">profit</field>
         <field name="description">Profit</field>
-        <field
-            name="expression"
-        >-balp[('user_type_id', 'in', (ref('account.data_account_type_other_income').id, ref('account.data_account_type_revenue').id,))][]</field>
+        <field name="expression">-balp[('account_type', 'like', 'income%')][]</field>
         <field name="auto_expand_accounts">true</field>
         <field name="auto_expand_accounts_style_id" ref="style_details" />
         <field name="style_id" ref="style_header" />
@@ -74,7 +70,7 @@
         <field name="description">Liabilities</field>
         <field
             name="expression"
-        >-bale[('user_type_id', 'in', (ref('account.data_account_type_current_liabilities').id, ref('account.data_account_type_equity').id, ref('account.data_account_type_non_current_liabilities').id, ref('account.data_account_type_payable').id))][]</field>
+        >-bale['|', ('account_type', 'like', 'liability%'), ('account_type', 'like', 'equity%')][]</field>
         <field name="auto_expand_accounts">true</field>
         <field name="auto_expand_accounts_style_id" ref="style_details_double_indent" />
         <field name="style_id" ref="style_header_indent" />
@@ -88,9 +84,7 @@
         <field name="id">4</field>
         <field name="name">assets</field>
         <field name="description">Assets</field>
-        <field
-            name="expression"
-        >bale[('user_type_id', 'in', (ref('account.data_account_type_credit_card').id, ref('account.data_account_type_prepayments').id, ref('account.data_account_type_current_assets').id, ref('account.data_account_type_fixed_assets').id, ref('account.data_account_type_liquidity').id, ref('account.data_account_type_non_current_assets').id, ref('account.data_account_type_receivable').id))][]</field>
+        <field name="expression">bale[('account_type', 'like', 'asset%')][]</field>
         <field name="auto_expand_accounts">true</field>
         <field name="auto_expand_accounts_style_id" ref="style_details" />
         <field name="style_id" ref="style_header" />
diff --git a/mis_template_financial_report/static/description/index.html b/mis_template_financial_report/static/description/index.html
index 62fe3f1c..ae7895ea 100644
--- a/mis_template_financial_report/static/description/index.html
+++ b/mis_template_financial_report/static/description/index.html
@@ -367,9 +367,9 @@ ul.auto-toc {
 !! This file is generated by oca-gen-addon-readme !!
 !! changes will be overwritten.                   !!
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-!! source digest: sha256:5173beaf8096bf43b532eb27d814a8cce032965d4f433c55e82bb7b2c6ba11dc
+!! source digest: sha256:ced5b0160af86207e009f52aac7844010df11f150873af1601845c0f0958ec23
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/account-financial-reporting/tree/15.0/mis_template_financial_report"><img alt="OCA/account-financial-reporting" src="https://img.shields.io/badge/github-OCA%2Faccount--financial--reporting-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-financial-reporting-15-0/account-financial-reporting-15-0-mis_template_financial_report"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/account-financial-reporting&amp;target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
+<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/account-financial-reporting/tree/16.0/mis_template_financial_report"><img alt="OCA/account-financial-reporting" src="https://img.shields.io/badge/github-OCA%2Faccount--financial--reporting-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-financial-reporting-16-0/account-financial-reporting-16-0-mis_template_financial_report"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/account-financial-reporting&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
 <p>This addon provides MIS builder templates to generate generic Profit &amp; Loss and Balance Sheet reports.</p>
 <p><strong>Table of contents</strong></p>
 <div class="contents local topic" id="contents">
@@ -408,7 +408,7 @@ This checkbox is only available for reports that support the horizontal mode.</p
 <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/account-financial-reporting/issues">GitHub Issues</a>.
 In case of trouble, please check there if your issue has already been reported.
 If you spotted it first, help us to smash it by providing a detailed and welcomed
-<a class="reference external" href="https://github.com/OCA/account-financial-reporting/issues/new?body=module:%20mis_template_financial_report%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
+<a class="reference external" href="https://github.com/OCA/account-financial-reporting/issues/new?body=module:%20mis_template_financial_report%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
 <p>Do not contact contributors directly about support or help with technical issues.</p>
 </div>
 <div class="section" id="credits">
@@ -435,7 +435,7 @@ mission is to support the collaborative development of Odoo features and
 promote its widespread use.</p>
 <p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
 <p><a class="reference external image-reference" href="https://github.com/hbrunn"><img alt="hbrunn" src="https://github.com/hbrunn.png?size=40px" /></a></p>
-<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-financial-reporting/tree/15.0/mis_template_financial_report">OCA/account-financial-reporting</a> project on GitHub.</p>
+<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-financial-reporting/tree/16.0/mis_template_financial_report">OCA/account-financial-reporting</a> project on GitHub.</p>
 <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
 </div>
 </div>
diff --git a/setup/mis_template_financial_report/odoo/addons/mis_template_financial_report b/setup/mis_template_financial_report/odoo/addons/mis_template_financial_report
new file mode 120000
index 00000000..a2142da6
--- /dev/null
+++ b/setup/mis_template_financial_report/odoo/addons/mis_template_financial_report
@@ -0,0 +1 @@
+../../../../mis_template_financial_report
\ No newline at end of file
diff --git a/setup/mis_template_financial_report/setup.py b/setup/mis_template_financial_report/setup.py
new file mode 100644
index 00000000..28c57bb6
--- /dev/null
+++ b/setup/mis_template_financial_report/setup.py
@@ -0,0 +1,6 @@
+import setuptools
+
+setuptools.setup(
+    setup_requires=['setuptools-odoo'],
+    odoo_addon=True,
+)