Adds fusion.period.picker.wizard - a guided entry point that lets users pick a report type and a common period preset (this/last month, quarter, YTD, last year, or custom range). The wizard uses the existing date_periods service helpers (month_bounds, quarter_bounds, fiscal_year_bounds) to pre-fill date_from / date_to via @api.onchange. action_open_report returns a client action that launches the OWL reports viewer with default_report_type / default_date_from / default_date_to / default_comparison in the context. Tests: 3 new (test_period_picker.py). Net 111 -> 114. Made-with: Cursor
33 lines
1.4 KiB
XML
33 lines
1.4 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<record id="view_fusion_period_picker_wizard_form" model="ir.ui.view">
|
|
<field name="name">fusion.period.picker.wizard.form</field>
|
|
<field name="model">fusion.period.picker.wizard</field>
|
|
<field name="arch" type="xml">
|
|
<form string="Pick Reporting Period">
|
|
<group>
|
|
<field name="report_type"/>
|
|
<field name="period_preset"/>
|
|
<field name="date_from" invisible="period_preset != 'custom'"
|
|
required="period_preset == 'custom'"/>
|
|
<field name="date_to" invisible="period_preset != 'custom'"
|
|
required="period_preset == 'custom'"/>
|
|
<field name="comparison"/>
|
|
</group>
|
|
<footer>
|
|
<button name="action_open_report" type="object" string="Open Report"
|
|
class="btn-primary"/>
|
|
<button special="cancel" string="Cancel"/>
|
|
</footer>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="action_fusion_period_picker_wizard" model="ir.actions.act_window">
|
|
<field name="name">Open Financial Report</field>
|
|
<field name="res_model">fusion.period.picker.wizard</field>
|
|
<field name="view_mode">form</field>
|
|
<field name="target">new</field>
|
|
</record>
|
|
</odoo>
|