feat: ADP Export Files menu with filestore storage, remove Sync All button
- Add fusion_claims.adp.export.record model with filestore-backed Binary field for tracking exported ADP claims files organized by Year > Month > Posting Period - Add tree/form/search views with default group-by hierarchy, latest first - Add "Export Files" menuitem under ADP menu section - Add bulk ZIP download server action for multi-select export - Replace Documents app storage with new model in export wizard - Remove Documents-related methods (_save_to_documents, folder creation) - Add migration button in Settings to move existing Documents files - Fix Export ADP button visibility: only show on ADP portion invoices - Remove redundant Sync All button from invoice form - Add ACL entries for billing users (read/create) and managers (full CRUD) - Bump version to 19.0.7.3.0 Made-with: Cursor
This commit is contained in:
@@ -59,10 +59,11 @@
|
||||
<field name="inherit_id" ref="account.view_move_form"/>
|
||||
<field name="priority">52</field>
|
||||
<field name="arch" type="xml">
|
||||
<!-- Add Export and Sync buttons to header -->
|
||||
<!-- Add Export and Verify buttons to header -->
|
||||
<xpath expr="//button[@name='button_draft']" position="after">
|
||||
<field name="x_fc_is_adp_invoice" invisible="1"/>
|
||||
<field name="x_fc_needs_device_verification" invisible="1"/>
|
||||
<field name="x_fc_adp_invoice_portion" invisible="1"/>
|
||||
<!-- Verify Device Approval button - only on client invoices that need verification -->
|
||||
<button name="action_open_device_approval_wizard"
|
||||
string="Verify Device Approval"
|
||||
@@ -71,19 +72,12 @@
|
||||
icon="fa-check-square-o"
|
||||
invisible="not x_fc_needs_device_verification"
|
||||
help="Complete device verification to enable ADP invoice creation"/>
|
||||
<button name="action_sync_to_sale_order"
|
||||
string="Sync All"
|
||||
type="object"
|
||||
class="btn-secondary"
|
||||
icon="fa-refresh"
|
||||
invisible="move_type not in ['out_invoice', 'out_refund'] or not x_fc_is_adp_invoice"
|
||||
help="Sync ADP fields from this Invoice to the Sale Order and all linked invoices"/>
|
||||
<button name="action_export_adp_claim"
|
||||
string="Export ADP"
|
||||
type="object"
|
||||
class="btn-secondary"
|
||||
icon="fa-file-text-o"
|
||||
invisible="move_type not in ['out_invoice', 'out_refund'] or state != 'posted' or not x_fc_is_adp_invoice"/>
|
||||
invisible="move_type not in ['out_invoice', 'out_refund'] or state != 'posted' or not x_fc_is_adp_invoice or x_fc_adp_invoice_portion != 'adp'"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -1739,6 +1739,8 @@ else:
|
||||
action="action_adp_invoices" sequence="2"/>
|
||||
<menuitem id="menu_adp_client_invoices" name="ADP Client Invoices" parent="menu_fc_adp"
|
||||
action="action_adp_client_invoices" sequence="3"/>
|
||||
<menuitem id="menu_adp_export_files" name="Export Files" parent="menu_fc_adp"
|
||||
action="action_adp_export_records" sequence="4"/>
|
||||
|
||||
<menuitem id="menu_adp_quotations"
|
||||
name="Quotation Stage"
|
||||
|
||||
142
fusion_claims/views/adp_export_record_views.xml
Normal file
142
fusion_claims/views/adp_export_record_views.xml
Normal file
@@ -0,0 +1,142 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright 2024-2025 Nexa Systems Inc.
|
||||
License OPL-1 (Odoo Proprietary License v1.0)
|
||||
Part of the Fusion Claim Assistant product family.
|
||||
-->
|
||||
<odoo>
|
||||
<!-- ===================================================================== -->
|
||||
<!-- ADP EXPORT RECORD: Tree View -->
|
||||
<!-- ===================================================================== -->
|
||||
<record id="view_adp_export_record_list" model="ir.ui.view">
|
||||
<field name="name">fusion_claims.adp.export.record.list</field>
|
||||
<field name="model">fusion_claims.adp.export.record</field>
|
||||
<field name="arch" type="xml">
|
||||
<list string="ADP Export Files" default_order="export_date desc">
|
||||
<field name="name"/>
|
||||
<field name="export_date"/>
|
||||
<field name="posting_period_label" string="Posting Period"/>
|
||||
<field name="vendor_code"/>
|
||||
<field name="line_count" string="Lines"/>
|
||||
<field name="invoice_count" string="Invoices"/>
|
||||
<field name="user_id" string="Exported By" widget="many2one_avatar_user"/>
|
||||
<field name="year" column_invisible="True"/>
|
||||
<field name="month" column_invisible="True"/>
|
||||
<field name="month_number" column_invisible="True"/>
|
||||
</list>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- ===================================================================== -->
|
||||
<!-- ADP EXPORT RECORD: Form View -->
|
||||
<!-- ===================================================================== -->
|
||||
<record id="view_adp_export_record_form" model="ir.ui.view">
|
||||
<field name="name">fusion_claims.adp.export.record.form</field>
|
||||
<field name="model">fusion_claims.adp.export.record</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="ADP Export File">
|
||||
<header>
|
||||
<button name="action_download" string="Download File"
|
||||
type="object" class="btn-primary" icon="fa-download"/>
|
||||
</header>
|
||||
<sheet>
|
||||
<div class="oe_title">
|
||||
<h1><field name="name" readonly="1"/></h1>
|
||||
</div>
|
||||
<group>
|
||||
<group string="Export Details">
|
||||
<field name="export_date" readonly="1"/>
|
||||
<field name="posting_period_date" readonly="1"/>
|
||||
<field name="posting_period_label" readonly="1"/>
|
||||
<field name="vendor_code" readonly="1"/>
|
||||
<field name="line_count" readonly="1"/>
|
||||
</group>
|
||||
<group string="File">
|
||||
<field name="file_data" filename="filename" readonly="1"/>
|
||||
<field name="filename" invisible="1"/>
|
||||
<field name="user_id" readonly="1"/>
|
||||
<field name="company_id" readonly="1" groups="base.group_multi_company"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook>
|
||||
<page string="Exported Invoices" name="invoices">
|
||||
<field name="invoice_ids" readonly="1" nolabel="1">
|
||||
<list string="Invoices" create="0" delete="0">
|
||||
<field name="name" string="Invoice"/>
|
||||
<field name="partner_id" string="Customer"/>
|
||||
<field name="invoice_date"/>
|
||||
<field name="amount_total" string="Total"/>
|
||||
<field name="state" widget="badge"
|
||||
decoration-success="state == 'posted'"
|
||||
decoration-info="state == 'draft'"/>
|
||||
</list>
|
||||
</field>
|
||||
</page>
|
||||
<page string="Notes" name="notes" invisible="not notes">
|
||||
<field name="notes" readonly="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- ===================================================================== -->
|
||||
<!-- ADP EXPORT RECORD: Search View -->
|
||||
<!-- ===================================================================== -->
|
||||
<record id="view_adp_export_record_search" model="ir.ui.view">
|
||||
<field name="name">fusion_claims.adp.export.record.search</field>
|
||||
<field name="model">fusion_claims.adp.export.record</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="ADP Export Files">
|
||||
<field name="name"/>
|
||||
<field name="vendor_code"/>
|
||||
<field name="user_id"/>
|
||||
<separator/>
|
||||
<group expand="1" string="Group By">
|
||||
<filter string="Year" name="group_year"
|
||||
context="{'group_by': 'year'}"/>
|
||||
<filter string="Month" name="group_month"
|
||||
context="{'group_by': 'month'}"/>
|
||||
<filter string="Posting Period" name="group_posting"
|
||||
context="{'group_by': 'posting_period_date'}"/>
|
||||
<filter string="Exported By" name="group_user"
|
||||
context="{'group_by': 'user_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- ===================================================================== -->
|
||||
<!-- ADP EXPORT RECORD: Action -->
|
||||
<!-- ===================================================================== -->
|
||||
<record id="action_adp_export_records" model="ir.actions.act_window">
|
||||
<field name="name">Export Files</field>
|
||||
<field name="res_model">fusion_claims.adp.export.record</field>
|
||||
<field name="view_mode">list,form</field>
|
||||
<field name="search_view_id" ref="view_adp_export_record_search"/>
|
||||
<field name="context">{'search_default_group_year': 1, 'search_default_group_month': 1, 'search_default_group_posting': 1}</field>
|
||||
<field name="help" type="html">
|
||||
<p class="o_view_nocontent_smiling_face">
|
||||
No export files yet
|
||||
</p>
|
||||
<p>
|
||||
ADP export files will appear here after you export invoices using the
|
||||
<strong>Export ADP</strong> button on ADP portion invoices.
|
||||
</p>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- ===================================================================== -->
|
||||
<!-- ADP EXPORT RECORD: Server Action for Bulk ZIP Download -->
|
||||
<!-- ===================================================================== -->
|
||||
<record id="action_adp_export_download_zip" model="ir.actions.server">
|
||||
<field name="name">Download as ZIP</field>
|
||||
<field name="model_id" ref="model_fusion_claims_adp_export_record"/>
|
||||
<field name="binding_model_id" ref="model_fusion_claims_adp_export_record"/>
|
||||
<field name="binding_view_types">list</field>
|
||||
<field name="state">code</field>
|
||||
<field name="code">action = records.action_download_zip()</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
@@ -330,6 +330,30 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ============================================================= -->
|
||||
<!-- DATA MIGRATION -->
|
||||
<!-- ============================================================= -->
|
||||
<h2>Data Migration</h2>
|
||||
<div class="row mt-4 o_settings_container">
|
||||
<div class="col-12 col-lg-6 o_setting_box">
|
||||
<div class="o_setting_right_pane">
|
||||
<span class="o_form_label">Migrate Export Files from Documents</span>
|
||||
<div class="text-muted">
|
||||
Move existing ADP export files from the Documents app into the
|
||||
new ADP Export Files menu. Only needs to be run once after upgrading.
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<button name="action_migrate_adp_export_files"
|
||||
string="Migrate Export Files"
|
||||
type="object"
|
||||
class="btn-secondary"
|
||||
icon="fa-exchange"
|
||||
confirm="This will migrate all ADP export files from Documents to the new Export Files menu. Continue?"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ============================================================= -->
|
||||
<!-- ODSP CONFIGURATION -->
|
||||
<!-- ============================================================= -->
|
||||
|
||||
Reference in New Issue
Block a user