changes
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
'name': 'Fusion Accounting — Canadian Reports',
|
||||
'version': '19.0.1.1.0',
|
||||
'version': '19.0.1.1.1',
|
||||
'category': 'Accounting/Localizations/Reporting',
|
||||
'summary': 'Canadian-specific report definitions and tax return templates for Fusion Accounting.',
|
||||
'description': """
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
"""Pre-migration: convert legacy act_window Canadian report actions.
|
||||
|
||||
Sibling of fusion_accounting_reports/migrations/19.0.1.1.2/pre-migration.py.
|
||||
See that file for the full rationale.
|
||||
"""
|
||||
|
||||
import logging
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
LEGACY_XIDS = (
|
||||
'action_fusion_report_ca_pnl',
|
||||
'action_fusion_report_ca_bs',
|
||||
)
|
||||
|
||||
|
||||
def migrate(cr, version):
|
||||
if not version:
|
||||
return
|
||||
deleted = 0
|
||||
for name in LEGACY_XIDS:
|
||||
cr.execute(
|
||||
"""
|
||||
SELECT id, model, res_id
|
||||
FROM ir_model_data
|
||||
WHERE module = 'fusion_accounting_l10n_ca' AND name = %s
|
||||
""",
|
||||
(name,),
|
||||
)
|
||||
row = cr.fetchone()
|
||||
if not row:
|
||||
continue
|
||||
ir_md_id, model, res_id = row
|
||||
if model != 'ir.actions.act_window':
|
||||
continue
|
||||
cr.execute("DELETE FROM ir_act_window WHERE id = %s", (res_id,))
|
||||
cr.execute("DELETE FROM ir_actions WHERE id = %s", (res_id,))
|
||||
cr.execute("DELETE FROM ir_model_data WHERE id = %s", (ir_md_id,))
|
||||
deleted += 1
|
||||
_logger.info("Dropped legacy act_window for fusion_accounting_l10n_ca.%s", name)
|
||||
|
||||
if deleted:
|
||||
_logger.info(
|
||||
"fusion_accounting_l10n_ca pre-migration: dropped %d legacy "
|
||||
"act_window records to make way for ir.actions.client variants.",
|
||||
deleted,
|
||||
)
|
||||
@@ -7,17 +7,15 @@
|
||||
come from the Canadian definitions seeded in this module.
|
||||
-->
|
||||
|
||||
<record id="action_fusion_report_ca_pnl" model="ir.actions.act_window">
|
||||
<record id="action_fusion_report_ca_pnl" model="ir.actions.client">
|
||||
<field name="name">Profit and Loss (Canada)</field>
|
||||
<field name="res_model">fusion.report</field>
|
||||
<field name="view_mode">fusion_reports</field>
|
||||
<field name="tag">fusion_reports</field>
|
||||
<field name="context">{'default_report_type': 'pnl', 'default_report_code': 'ca_profit_loss', 'default_comparison': 'previous_year'}</field>
|
||||
</record>
|
||||
|
||||
<record id="action_fusion_report_ca_bs" model="ir.actions.act_window">
|
||||
<record id="action_fusion_report_ca_bs" model="ir.actions.client">
|
||||
<field name="name">Balance Sheet (Canada)</field>
|
||||
<field name="res_model">fusion.report</field>
|
||||
<field name="view_mode">fusion_reports</field>
|
||||
<field name="tag">fusion_reports</field>
|
||||
<field name="context">{'default_report_type': 'balance_sheet', 'default_report_code': 'ca_balance_sheet', 'default_comparison': 'previous_period'}</field>
|
||||
</record>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user