<?xml version="1.0"?>
<kanban js_class="account_return_kanban" can_open="true" edit="0" on_create="account_reports.action_create_account_return">
                    <field name="state"/>
                    <field name="is_tax_return"/>
                    <field name="check_ids"/>
                    <field name="is_completed"/>
                    <field name="type_external_id"/>
                    <field name="report_opened_once"/>
                    <field name="is_report_set"/>
                    <field name="has_move_entries"/>
                    <field name="is_main_company_active"/>
                    <field name="show_companies"/>
                    <field name="show_amount_to_pay"/>
                    <field name="date_submission"/>
                    <field name="days_to_deadline"/>

                    <t t-name="card" class="p-0 border-start-0">
                        <div class="border-start border-3" t-att-class="{'border-dark': !record.is_completed.raw_value, 'border-success': record.is_completed.raw_value}"/>
                        <div class="container w-100 p-2">
                            <div class="row h-full position-relative">
                                <div class="col-12 col-lg-3">
                                    <div class="row">
                                        <div class="o_field_widget">
                                            <field class="oe_state_value pe-2 fs-5" name="name"/>
                                            <field invisible="unresolved_check_count &lt;= 0" class="oe_state_value pe-1 text-danger" name="unresolved_check_count"/>
                                            <span invisible="unresolved_check_count &lt;= 0" class="oe_stat_text ps-0 text-danger">Pending</span>
                                            <field invisible="unresolved_check_count != 0 or resolved_check_count &lt;= 0" class="oe_state_value pe-1 text-success" name="resolved_check_count"/>
                                            <span invisible="unresolved_check_count != 0 or resolved_check_count &lt;= 0" class="oe_stat_text ps-0 text-success">Passed</span>
                                        </div>
                                    </div>
                                    <div class="row o_field_widget" t-att-class="{'text-black': (record.days_to_deadline.raw_value &gt;= 0) or record.date_submission.raw_value or record.is_completed.raw_value, 'text-danger': (record.days_to_deadline.raw_value &lt; 0) and !record.date_submission.raw_value and !record.is_completed.raw_value}">
                                        <t t-if="!record.date_submission.raw_value">
                                            <span class="oe_stat_text pe-1">Deadline: </span><field class="oe_stat_value ps-0" name="date_deadline"/>
                                        </t>
                                        <t t-else="">
                                            <span class="oe_stat_text pe-1 text-black-50">Submitted on: </span><field class="oe_stat_value ps-0 text-black-50" name="date_submission"/>
                                        </t>
                                    </div>

                                    <div class="row" invisible="not show_companies">
                                        <field name="company_ids" widget="many2many_tags"/>
                                    </div>
                                </div>

                                <div id="account_tax_return_amount" class="col-12 col-lg-2 px-lg-0 d-flex align-items-center">
                                    <field name="amount_to_pay_currency_id" invisible="1"/>
                                    <h2 id="return_amount_to_pay" class="o_account_return_amount" invisible="not show_amount_to_pay or not is_main_company_active"><field name="amount_to_pay"/></h2>
                                </div>

                                <!-- States bar -->
                                <div class="col-12 col-lg-3 o_account_return_state">
                                    <t t-set="reviewedLabel">Review</t>
                                    <t t-set="submittedLabel">Submit</t>
                                    <t t-set="paidLabel">Pay</t>
                                    <t id="account_tax_return_states" t-set="states" t-value="[{value: 'reviewed', display:reviewedLabel}, {value: 'submitted', display:submittedLabel}, {value: 'paid', display:paidLabel}]"/>
                                    <t t-if="record.type_external_id.raw_value == 'account_reports.annual_corporate_tax_return_type'" t-set="states" t-value="[{value: 'submitted', display:submittedLabel}]"/>
                                    <t t-set="index" t-value="states.findIndex((state) =&gt; state.value === record.state.raw_value)"/>
                                    <t t-foreach="states" t-as="state" t-key="state.value">
                                        <div class="state-container" t-att-class="{'active': index &gt;= state_index || record.is_completed.raw_value}">
                                            <div class="state-bubble"/>
                                            <span class="state-label" t-esc="state.display"/>
                                        </div>
                                    </t>
                                </div>

                                <!-- Buttons -->
                                <div class="col-12 col-lg-4 o_account_return_buttons">
                                    <t t-if="record.state.raw_value == 'reviewed' and !record.report_opened_once.raw_value and record.is_report_set.raw_value and record.is_main_company_active.raw_value">
                                        <button class="btn btn-primary" type="object" name="action_open_report"><field name="report_name"/></button>
                                        <button invisible="is_completed" class="btn btn-secondary" type="object" name="action_submit">Submit</button>
                                    </t>
                                    <t t-else="">
                                        <button invisible="not is_report_set" class="btn btn-secondary" type="object" name="action_open_report"><field name="report_name"/></button>
                                        <button invisible="state != 'reviewed' or is_completed or not is_main_company_active" class="btn btn-primary" type="object" name="action_submit">Submit</button>
                                    </t>

                                    <t t-if="0">
                                    </t>
                                    <t id="default_buttons" t-else="">
                                        <button invisible="state != 'new' or is_completed or not is_main_company_active" class="btn btn-primary" type="object" name="action_review">Review</button>
                                        <button invisible="state != 'submitted' or is_completed or not is_main_company_active" class="btn btn-primary" type="object" name="action_pay">Pay</button>
                                    </t>

                                    <div class="dropdown show dropdown-sm" invisible="not is_main_company_active">
                                        <button class="btn border-0" type="button" data-bs-toggle="dropdown">
                                            <i class="fa fa-ellipsis-v" title="Dropdown Menu"/>
                                        </button>

                                        <div class="dropdown-menu" aria-labelledby="dropdownMenuButton" role="menu">
                                            <a invisible="state != 'new' or is_completed or (type_external_id == 'account_reports.annual_corporate_tax_return_type')" class="dropdown-item" type="object" name="action_mark_completed" string="Mark as Completed"/>
                                            <a invisible="not check_ids" class="dropdown-item" type="object" name="action_review_all_checks" string="View Checks"/>
                                            <a invisible="not has_move_entries or state not in ('submitted', 'paid')" class="dropdown-item" type="object" name="action_view_entry" string="View Entry"/>

                                            <a invisible="not (manually_created and state == 'new')" class="dropdown-item" type="object" name="action_delete" string="Delete"/>

                                            <!-- Reset should be last-->
                                            <a invisible="state == 'new' and not is_completed or not is_tax_return" class="dropdown-item" type="object" name="action_reset_tax_return_common" string="Reset"/>  
                                            <a invisible="state == 'new' and not is_completed or type_external_id != 'account_reports.annual_corporate_tax_return_type'" class="dropdown-item" type="object" name="action_reset_annual_closing" string="Reset"/>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </t>
                </kanban>
            