Compare commits

..

20 Commits

Author SHA1 Message Date
f3766c2898 feat: add x_fc_authorizer_number, x_fc_account_number, x_marked_for fields; auto-link authorizer from XML
- fusion_claims: added x_fc_authorizer_number to res.partner for ADP authorizer registration numbers
- fusion_claims: XML parser auto-links authorizer contact to sale order by ADP number
- fusion_claims: removed size=9 constraint from x_fc_odsp_member_id
- fusion_claims: authorizer number shown on OT/PT contact form
- fusion_so_to_po: added x_marked_for (Many2one) field definition on purchase.order
- fusion_so_to_po: added x_fc_account_number on res.partner for vendor account numbers
2026-03-11 17:22:02 +00:00
431052920e feat: separate fusion field service and LTC into standalone modules, update core modules
- fusion_claims: separated field service logic, updated controllers/views
- fusion_tasks: updated task views and map integration
- fusion_authorizer_portal: added page 11 signing, schedule booking, migrations
- fusion_shipping: new standalone shipping module (Canada Post, FedEx, DHL, Purolator)
- fusion_ltc_management: new standalone LTC management module
2026-03-11 16:19:52 +00:00
1f79cdcaaf fix: improve AI chat table rendering with CSS styling and narrow-panel formatting
- Add SCSS for AI chat tables: borders, padding, zebra striping, hover, dark mode
- Style headings, code, bold text, and lists in chat messages
- Update system prompt: enforce 3-column max tables for narrow chat panel
- Use key-value (2-column) tables for summaries, split wide data into sections
- Provide explicit correct/wrong format examples in prompt
2026-03-10 02:54:04 +00:00
8761d0e7c7 feat: add Demographics & Analytics tool to Fusion Claims Intelligence
- Add Tool 6 for demographic analysis using direct SQL queries
- Age group breakdowns: clients, applications, avg apps/client, avg funding
- Device popularity by age bracket (under 45, 45-60, 61-75, 75+)
- City demographics with average age and funding per city
- Benefit type analysis (ODSP, OWP, ACSD, Regular)
- Top devices with average client age
- Overall funding summary (totals, averages, age range)
- Update AI topic and system prompt with Tool 6 routing examples
2026-03-10 02:45:51 +00:00
0053576cc2 fix: enable rich text markdown formatting for AI agent responses
- Install markdown2 dependency for Odoo AI module
- Update system prompt with explicit markdown formatting instructions
- Add example templates for client status and billing period responses
- Use tables, bold, headings, and code formatting for clean output
2026-03-10 02:39:02 +00:00
7bd7b8f7c4 fix: enhance Fusion Claims Intelligence AI with client status and billing period tools
- Fix _read_group override crash (dict_values not subscriptable) in sale_order.py
- Migrate _fc_tool_claims_stats from deprecated read_group() to _read_group() API
- Enrich client details tool with funding history, invoice status, prev-funded devices
- Add Client Status Lookup tool (search by name, returns orders/invoices/next steps)
- Add ADP Billing Period tool (invoiced amounts, paid/unpaid, submission deadlines)
- Update AI agent system prompt with all 5 tools and usage examples
2026-03-10 02:30:42 +00:00
3342b57469 feat: reorder search views - Customer first, add delivery/tags/status fields for ADP, ODSP, MOD 2026-03-10 01:46:15 +00:00
1bfa50aa5f feat: View Details uses ADP landscape report for ADP orders, add route decorators 2026-03-09 22:55:53 +00:00
85367747a6 fix: remove _get_display_grouped_section() call causing 500 error on portal 2026-03-09 22:49:55 +00:00
d7657bb356 feat: add borders, ADP Device Code, ADP/Client Portion columns and subtotals to portal view 2026-03-09 22:46:16 +00:00
9dac39853f fix: revert POD signature to original layout - only quotation reports need organized signature 2026-03-09 22:32:27 +00:00
c1a3b02ac5 fix: improve ADP report signature section with legal terms, date/time, printed name; switch portal to landscape report 2026-03-09 22:03:46 +00:00
1f750a6db4 fix: improve ADP report signature section with legal terms, date/time, printed name; switch portal to landscape report 2026-03-09 22:03:28 +00:00
ffcc83d7bd fix: improve ADP report signature section with legal terms, date/time, printed name; switch portal to landscape report 2026-03-09 22:03:12 +00:00
6c3c565440 fix: improve ADP report signature section with legal terms, date/time, printed name; switch portal to landscape report 2026-03-09 22:02:53 +00:00
1c191a54e1 fix: ADP portal sign/pay modal text - show client portion, not full total 2026-03-09 21:34:55 +00:00
512aedce69 fix: ADP portal - sidebar amount, claim details, signature report 2026-03-09 21:25:37 +00:00
f362fbd915 fix: ADP portal - sidebar amount, claim details, signature report 2026-03-09 21:25:05 +00:00
Nexa Agent
35399170b3 fix: ADP portal payment uses client portion instead of full order total
When customers pay for ADP quotations through the portal, the system
was charging the full order amount (ADP + client portions combined).
Now correctly charges only the client portion (25% for REG clients).

Changes:
- Override _get_prepayment_required_amount() to return client portion
- Override _has_to_be_paid() to skip payment for 100% ADP-funded orders
- Add portal controller to cap payment amount at client portion
- Add portal template showing ADP funding breakdown to customer
2026-03-09 21:11:19 +00:00
gsinghpal
3b3c57205a feat: add fusion_tasks module for field service management
Standalone module extracted from fusion_claims providing technician
scheduling, route simulation with Google Maps, GPS tracking, and
cross-instance task sync between odoo-westin and odoo-mobility.

Includes fix for route simulation: added Directions API error logging
to diagnose silent failures from conflicting Google Maps API keys.

Made-with: Cursor
2026-03-09 16:56:53 -04:00
4533 changed files with 6928 additions and 196046 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@@ -1,135 +0,0 @@
---
description: Use the Fusion API module for all API calls (OpenAI, Anthropic, Google Maps, Twilio, OAuth) in any Fusion module
globs: fusion_*/models/**/*.py, fusion_*/services/**/*.py
alwaysApply: false
---
# Fusion API Integration Guide
When any Fusion module needs to call an external API (OpenAI, Anthropic, Google Maps, Twilio, Google/Microsoft OAuth), it MUST use the centralized `fusion.api.service` instead of managing its own keys.
The service lives at `fusion_api/models/api_service.py` and is an AbstractModel accessible via `self.env['fusion.api.service']`.
## Available Methods
### 1. `call_openai()` -- AI text generation via OpenAI
```python
result = self.env['fusion.api.service'].call_openai(
consumer='fusion_clock_ai', # your module's technical name
feature='timesheet_summary', # descriptive feature name for tracking
messages=[
{'role': 'system', 'content': 'You are a helpful assistant.'},
{'role': 'user', 'content': 'Summarize this timesheet...'},
],
model='gpt-4o-mini', # optional, defaults to gpt-4o-mini
max_tokens=1024, # optional, defaults to 1024
user=self.env.user, # optional, defaults to current user
)
# Returns: str (the text response)
```
### 2. `call_anthropic()` -- AI text generation via Claude
```python
result = self.env['fusion.api.service'].call_anthropic(
consumer='fusion_notes',
feature='voice_transcription',
messages=[
{'role': 'user', 'content': 'Transcribe this text...'},
],
system='You are a medical transcription assistant.', # optional system prompt
model='claude-sonnet-4-20250514', # optional, defaults to claude-sonnet-4-20250514
max_tokens=1024, # optional
)
# Returns: str (the text response)
```
### 3. `get_api_key()` -- raw API key for non-AI services
```python
api_key = self.env['fusion.api.service'].get_api_key(
provider_type='google_maps', # one of: google_maps, twilio, custom
consumer='fusion_shipping', # your module's technical name
feature='geocoding', # optional feature name
)
# Returns: str (the raw API key to use in your own HTTP calls)
```
### 4. `get_oauth_credentials()` -- OAuth tokens for Google/Microsoft
```python
creds = self.env['fusion.api.service'].get_oauth_credentials(
provider_type='google_oauth', # google_oauth or microsoft_oauth
consumer='fusion_schedule',
feature='calendar_sync',
)
# Returns: dict with keys:
# client_id, client_secret, access_token, refresh_token, token_expiry, redirect_uri
```
## Provider Types
| Type | Use For |
|------|---------|
| `openai` | GPT-4o, GPT-4o-mini, o1, etc. |
| `anthropic` | Claude Sonnet, Haiku, Opus |
| `google_maps` | Geocoding, Places, Distance Matrix |
| `google_oauth` | Google Calendar, Drive OAuth |
| `microsoft_oauth` | Microsoft Calendar, Graph OAuth |
| `twilio` | SMS, Voice |
| `custom` | Any other API provider |
## What Happens Automatically
- The calling module is auto-registered as a consumer in Fusion API
- Every call is logged with: tokens, cost, response time, user, feature, model
- Budget caps (monthly/daily) are enforced before each call
- Rate limits (RPM/RPD) are enforced before each call
- Per-user limits are checked if configured
- On limit exceeded, a `UserError` is raised with a clear message
## Phased Migration Pattern
Do NOT add `fusion_api` as a hard dependency. Use a try/fallback pattern so the module works with or without Fusion API installed:
```python
def _call_ai(self, messages, feature='general'):
"""Call OpenAI through Fusion API, falling back to own key."""
try:
return self.env['fusion.api.service'].call_openai(
consumer='fusion_clock_ai',
feature=feature,
messages=messages,
)
except Exception:
api_key = self.env['ir.config_parameter'].sudo().get_param(
'fusion_clock_ai.openai_api_key'
)
if not api_key:
raise
from openai import OpenAI
client = OpenAI(api_key=api_key)
response = client.chat.completions.create(
model='gpt-4o-mini', messages=messages,
)
return response.choices[0].message.content
```
## Rules
- NEVER hardcode API keys in Python code
- NEVER store API keys in `ir.config_parameter` for new modules -- use Fusion API
- ALWAYS pass the module's technical name (e.g. `fusion_clock_ai`) as the `consumer` parameter
- ALWAYS pass a descriptive `feature` string for usage tracking granularity
- NEVER catch and silently swallow errors from `fusion.api.service` -- let UserError propagate
- DO NOT add `fusion_api` to `depends` in `__manifest__.py` -- use the fallback pattern above
- The `consumer` string should match the module's technical name exactly (folder name)
## Odoo 19 Conventions
- This project targets Odoo 19 (Community/Enterprise)
- No hardcoded colors in views or SCSS -- let Odoo handle dark/light theming
- Use `res.groups.privilege` for security groups (not `category_id`)
- Do not use deprecated `ir.cron` fields (`numbercall`, `doall`)
- Settings views: use `name=` attribute on `<app>` tags, not `data-key=`

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
**/__pycache__/
*.pyc

View File

@@ -1,40 +0,0 @@
# Odoo Modules — Claude Code Instructions
## Project
27 custom Odoo 19 modules for Fusion Central (Westin Healthcare + NEXA Systems).
## Critical Rules — Odoo 19
1. **NEVER code from memory** — Always read a reference file from Docker first:
```bash
docker exec odoo-dev-app cat /usr/lib/python3/dist-packages/odoo/addons/<module>/static/src/<path>
```
2. **Frontend JS**: Use `Interaction` class from `@web/public/interaction`, registered via `registry.category("public.interactions")`. NOT IIFE/DOMContentLoaded.
3. **Backend OWL**: Use standalone `rpc()` from `@web/core/network/rpc`. NOT `useService("rpc")`. `static props = []` not `{}`.
4. **HTTP routes**: `type="jsonrpc"` — NOT `type="json"` (deprecated).
5. **res.config.settings**: Only boolean/integer/float/char/selection/many2one/datetime. NO Date fields.
6. **res.groups**: NO `users` field, NO `category_id` field.
7. **Search views**: NO `group expand="0"` syntax.
## Naming
- New fields: `x_fc_*` prefix
- Legacy fields: `x_studio_*`
- Canadian English for all user-facing text
- Currency: `$` sign with Monetary fields + currency_id
## Cursor-Managed Modules
- **fusion_clock** is currently being modified in Cursor — always read files fresh before editing, don't assume you know the current state
## Workflow
- Local dev: `docker exec odoo-dev-app odoo -d fusion-dev -u <module> --stop-after-init`
- Local URL: http://localhost:8069
- Test before deploying. Edit existing files — don't create unnecessary new ones.
## Supabase Knowledge Base
Before starting unfamiliar work, check Supabase for context:
```bash
PGPASSWORD='a09e12e0995dc29446631fa458f3d4b3' psql -h 100.74.28.73 -p 5433 -U postgres -d postgres
```
- `fusionapps.decisions` — past architecture decisions
- `fusionapps.issues` — known issues and fixes
- `fusionapps.code_snippets` — reference code
- `fusionapps.quick_commands` — deployment and admin commands

Some files were not shown because too many files have changed in this diff Show More