This commit is contained in:
gsinghpal
2026-04-04 15:37:16 -04:00
parent c66bdf5089
commit 3cc93b8783
36 changed files with 3278 additions and 548 deletions

View File

@@ -59,6 +59,17 @@ for rule in model.search([('active', '=', True), ('approval_tier', '=', 'needs_a
<field name="active">True</field>
</record>
<!-- Daily auto-reconcile payroll cheques against open liability entries -->
<record id="cron_fusion_payroll_cheque_reconcile" model="ir.cron">
<field name="name">Fusion AI: Reconcile Payroll Cheques</field>
<field name="model_id" ref="model_fusion_accounting_agent"/>
<field name="state">code</field>
<field name="code">model._reconcile_payroll_cheques()</field>
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="active">True</field>
</record>
<!-- Weekly vendor tax profile rebuild -->
<record id="cron_fusion_vendor_profiles" model="ir.cron">
<field name="name">Fusion AI: Rebuild Vendor Tax Profiles</field>

View File

@@ -151,10 +151,10 @@
<record id="tool_get_partner_balance" model="fusion.accounting.tool">
<field name="name">get_partner_balance</field>
<field name="display_name_field">Get Partner Balance</field>
<field name="description">Get a single partner's AR balance and open items.</field>
<field name="description">[Tier 1: Read-only] Get a partner's AR and AP balance with open items. Shows: how much they owe us (receivable), how much we owe them (payable), and net balance. Use for "how much do we owe Pride Mobility?", "what's the balance for ADP?".</field>
<field name="domain">accounts_receivable</field>
<field name="tier">1</field>
<field name="parameters_schema">{"type": "object", "properties": {"partner_id": {"type": "integer"}}, "required": ["partner_id"]}</field>
<field name="parameters_schema">{"type": "object", "properties": {"partner_id": {"type": "integer", "description": "Partner ID (optional if partner_name provided)"}, "partner_name": {"type": "string", "description": "Partner name to search for (e.g. 'Pride Mobility')"}}}</field>
</record>
<record id="tool_send_followup" model="fusion.accounting.tool">
<field name="name">send_followup</field>
@@ -476,6 +476,16 @@
<field name="parameters_schema">{"type": "object", "properties": {"date_from": {"type": "string"}, "date_to": {"type": "string"}}}</field>
</record>
<record id="tool_register_adp_batch_payment" model="fusion.accounting.tool">
<field name="name">register_adp_batch_payment</field>
<field name="display_name_field">Register ADP Batch Payment</field>
<field name="description">[Tier 3: Requires user approval] Register payments for a batch of ADP invoices from a remittance advice. Takes a list of invoice numbers with payment amounts and a payment date. Registers each payment via Odoo's payment wizard, creating outstanding receipt entries (PBNK2) on account 1050. After this, use suggest_bank_line_matches on the bank deposit to match the outstanding receipts. Use this when the user uploads an ADP remittance advice screenshot and says "mark these paid".</field>
<field name="domain">adp</field>
<field name="tier">3</field>
<field name="parameters_schema">{"type": "object", "properties": {"invoices": {"type": "array", "items": {"type": "object", "properties": {"invoice_number": {"type": "string"}, "amount": {"type": "number"}}, "required": ["invoice_number", "amount"]}, "description": "List of invoices with number and payment amount"}, "payment_date": {"type": "string", "description": "Payment date from remittance (YYYY-MM-DD)"}, "journal_id": {"type": "integer", "description": "Bank journal ID (default 50 = Scotia Current)"}}, "required": ["invoices", "payment_date"]}</field>
<field name="required_groups">fusion_accounting.group_fusion_accounting_manager</field>
</record>
<!-- Domain 10: Reporting -->
<record id="tool_get_profit_loss" model="fusion.accounting.tool">
<field name="name">get_profit_loss</field>
@@ -535,6 +545,31 @@
<field name="required_groups">fusion_accounting.group_fusion_accounting_manager</field>
</record>
<record id="tool_get_invoicing_summary" model="fusion.accounting.tool">
<field name="name">get_invoicing_summary</field>
<field name="display_name_field">Get Invoicing Summary</field>
<field name="description">[Tier 1: Read-only] Get customer invoicing summary — monthly breakdown for a year, date range totals, or filtered by partner. Use this for questions like "how much did we invoice this year?", "show me invoicing by month", "how much did we bill ADP this quarter?".</field>
<field name="domain">reporting</field>
<field name="tier">1</field>
<field name="parameters_schema">{"type": "object", "properties": {"year": {"type": "integer", "description": "Year for monthly breakdown (default: current year)"}, "partner_name": {"type": "string", "description": "Filter by partner name (optional)"}, "date_from": {"type": "string", "description": "Start date for date range (YYYY-MM-DD)"}, "date_to": {"type": "string", "description": "End date for date range (YYYY-MM-DD)"}}}</field>
</record>
<record id="tool_get_billing_summary" model="fusion.accounting.tool">
<field name="name">get_billing_summary</field>
<field name="display_name_field">Get Billing Summary</field>
<field name="description">[Tier 1: Read-only] Get vendor billing (purchases) summary — monthly breakdown for a year or date range. Use for "how much are our bills this month?", "show me vendor bills by month".</field>
<field name="domain">reporting</field>
<field name="tier">1</field>
<field name="parameters_schema">{"type": "object", "properties": {"year": {"type": "integer"}, "partner_name": {"type": "string"}, "date_from": {"type": "string"}, "date_to": {"type": "string"}}}</field>
</record>
<record id="tool_get_collections_summary" model="fusion.accounting.tool">
<field name="name">get_collections_summary</field>
<field name="display_name_field">Get Collections Summary</field>
<field name="description">[Tier 1: Read-only] Get payment collections summary — how much was collected (customer payments received) in a period, broken down by partner. Use for "how much are we collecting this month?", "show me collections for March".</field>
<field name="domain">reporting</field>
<field name="tier">1</field>
<field name="parameters_schema">{"type": "object", "properties": {"date_from": {"type": "string"}, "date_to": {"type": "string"}}}</field>
</record>
<!-- Domain 11: Audit -->
<record id="tool_audit_posted_entry" model="fusion.accounting.tool">
<field name="name">audit_posted_entry</field>
@@ -763,6 +798,34 @@
<field name="parameters_schema">{"type": "object", "properties": {"journal_a_id": {"type": "integer", "description": "First bank journal ID"}, "journal_b_id": {"type": "integer", "description": "Second bank journal ID"}, "date_from": {"type": "string"}, "date_to": {"type": "string"}, "max_days_apart": {"type": "integer", "description": "Max days between matching lines (default 2)"}, "execute": {"type": "boolean", "description": "false=preview pairs only, true=actually reconcile"}}, "required": ["journal_a_id", "journal_b_id"]}</field>
</record>
<record id="tool_suggest_bank_line_matches" model="fusion.accounting.tool">
<field name="name">suggest_bank_line_matches</field>
<field name="display_name_field">Suggest Bank Line Matches</field>
<field name="description">[Tier 1: Read-only] Find candidate invoices/bills that could match a bank statement line. Extracts partner from the bank line reference, searches open receivables (for incoming payments) or payables (for outgoing payments), scores candidates by amount/partner/date proximity, and finds the best combination of entries that sum to the bank amount. Returns data for a reconciliation-mode fusion-table with editable amounts and search. The user reviews matches, adjusts amounts for partial payments, searches and adds more entries, then clicks Apply Match.</field>
<field name="domain">bank_reconciliation</field>
<field name="tier">1</field>
<field name="parameters_schema">{"type": "object", "properties": {"statement_line_id": {"type": "integer", "description": "Bank statement line ID to find matches for"}}, "required": ["statement_line_id"]}</field>
</record>
<record id="tool_find_unreconciled_cheques" model="fusion.accounting.tool">
<field name="name">find_unreconciled_cheques</field>
<field name="display_name_field">Find Unreconciled Cheques</field>
<field name="description">[Tier 1: Read-only] Find unreconciled cheque bank lines and classify them as payroll or non-payroll. Payroll cheques have a matching credit amount on 2201 Payroll Liabilities. Non-payroll cheques (vendor payments, rent, etc.) don't. Default journal: Scotia Current (50).</field>
<field name="domain">bank_reconciliation</field>
<field name="tier">1</field>
<field name="parameters_schema">{"type": "object", "properties": {"journal_id": {"type": "integer", "description": "Bank journal ID (default 50 = Scotia Current)"}, "limit": {"type": "integer", "description": "Max results (default 50)"}}}</field>
</record>
<record id="tool_reconcile_payroll_cheques" model="fusion.accounting.tool">
<field name="name">reconcile_payroll_cheques</field>
<field name="display_name_field">Reconcile Payroll Cheques</field>
<field name="description">[Tier 3: Requires user approval] Reconcile payroll cheque bank lines by applying the Payroll Cheque Clearing model. ONLY processes cheques whose amount matches an existing payroll liability entry on 2201. Non-payroll cheques (vendor/rent) are skipped automatically. Uses the pre-configured "Payroll Cheque Clearing" reconcile model (writeoff to Dr 2201).</field>
<field name="domain">bank_reconciliation</field>
<field name="tier">3</field>
<field name="parameters_schema">{"type": "object", "properties": {"journal_id": {"type": "integer", "description": "Bank journal ID (default 50)"}, "line_ids": {"type": "array", "items": {"type": "integer"}, "description": "Optional: specific bank line IDs to reconcile. If empty, reconciles all matching payroll cheques."}}}</field>
<field name="required_groups">fusion_accounting.group_fusion_accounting_manager</field>
</record>
<record id="tool_create_expense_entry" model="fusion.accounting.tool">
<field name="name">create_expense_entry</field>
<field name="display_name_field">Create Direct GL Expense</field>