Commit Graph

796 Commits

Author SHA1 Message Date
Dries Peeters
eb0cd0005e feat: enhance inventory management features
- Update stock movement model with improved functionality
- Enhance inventory routes and API endpoints
- Improve inventory templates for movements, reports, and stock items
- Add better history tracking and valuation reporting
2026-01-03 20:27:54 +01:00
Dries Peeters
7c169fb401 refactor: improve application initialization and migration handling
- Update app factory pattern with better error handling
- Enhance migration environment configuration
- Improve database initialization and recovery logic
- Add better support for bootstrap and migration modes
2026-01-03 20:27:51 +01:00
Dries Peeters
7dc430405d docs: add database recovery documentation and reset scripts
- Add comprehensive DATABASE_RECOVERY.md with automatic cleanup details
- Add cross-platform database reset scripts (bat, py, sh)
- Document automatic corruption detection and recovery
- Include manual recovery procedures and safety warnings
2026-01-03 20:27:48 +01:00
Dries Peeters
e8bf79b325 build: precompile translations at Docker build time
- Add pybabel compile step in Dockerfile for faster startup
- Prevents runtime translation compilation overhead
- Gracefully handles missing Babel during build
2026-01-03 20:27:44 +01:00
Dries Peeters
9a6ede654f Merge pull request #386 from DRYTRIX/rc/v4.9.0
feat: add Peppol e-invoicing and stock lot valuation
v4.9.0
2026-01-03 07:02:27 +01:00
Dries Peeters
753b98d272 feat: add Peppol e-invoicing and stock lot valuation
Add Peppol BIS Billing 3.0 (UBL) invoice sending via a configurable access point, including admin-configurable settings, per-invoice send history, and documentation/README updates.

Also introduce stock lots/allocations (valuation layers) with supporting inventory route/report/UI updates and hardened startup migration handling.
2026-01-03 07:00:30 +01:00
Dries Peeters
c5666f5eae Merge pull request #384 from DRYTRIX/rc/v4.8.12
fix: make migration 081 tolerant of existing settings columns
v4.8.12
2026-01-02 19:08:30 +01:00
Dries Peeters
1ea87c81e5 fix: make migration 081 tolerant of existing settings columns
Some legacy/partially-upgraded databases already have one or more integration OAuth columns in settings (e.g. google_calendar_client_id). Only add missing columns and set defaults for columns that exist so upgrades don't fail with DuplicateColumn.

Bump version to 4.8.12.
2026-01-02 19:05:46 +01:00
Dries Peeters
51a1af4e66 Merge pull request #383 from DRYTRIX/rc/v4.8.11
Rc/v4.8.11
v4.8.11
2026-01-02 17:22:35 +01:00
Dries Peeters
bd59488132 fix: make template-related migrations idempotent
Avoid DuplicateTable/duplicate index errors on partially-migrated databases by skipping creation of existing template tables (quote_templates, project_templates, time_entry_templates) and only creating missing indexes/columns.

Also bump version to 4.8.11.
2026-01-02 17:19:19 +01:00
Dries Peeters
dcc4f87769 fix: make migration 075 idempotent for existing link_templates
Skip creating link_templates when it already exists and only create missing indexes, so partially-migrated customer databases can continue upgrading.
2026-01-02 17:12:18 +01:00
Dries Peeters
037b45a3c4 Merge pull request #382 from DRYTRIX/rc/v4.8.10
Rc/v4.8.10
v4.8.10
2026-01-02 16:05:11 +01:00
Dries Peeters
dd4a5e2f21 Update cd-release.yml 2026-01-02 16:02:04 +01:00
Dries Peeters
7f209751ab fix: harden Alembic upgrades on legacy databases
Prevent Postgres upgrades from failing when alembic_version.version_num is too small for long revision IDs, and add an alias migration to bridge older installs that recorded '067_add_integration_credentials'.
2026-01-02 15:53:51 +01:00
Dries Peeters
71a71d0536 Merge pull request #381 from DRYTRIX/rc/v4.8.9
Rc/v4.8.9
v4.8.9
2026-01-02 07:55:23 +01:00
Dries Peeters
e177c25818 Bump version: 4.8.9 2026-01-02 07:53:28 +01:00
Dries Peeters
3218ab012a feat: expand client portal and approval workflows
Add new client portal pages (dashboard, approvals, notifications, documents, reports) and extend API/routes/services to support client approvals, invoices/quotes views, and related notifications.

Update email templates and docs; add/adjust tests for new models/routes.
2026-01-02 07:52:32 +01:00
Dries Peeters
86f7946120 fix: resolve SQLAlchemy reserved word conflict in ClientNotification model
- Rename 'metadata' column to 'extra_data' in ClientNotification model
  to avoid SQLAlchemy Declarative API reserved word conflict
- Update ClientNotificationService to use 'extra_data' instead of 'metadata'
- Maintain API compatibility by returning 'metadata' key in to_dict() method
- Update migration to create 'extra_data' column instead of 'metadata'
- Improve migration idempotency and SQLite compatibility with proper checks
- Enhance backup directory handling with configurable BACKUP_FOLDER support
- Update admin routes to use centralized backup directory function

This fixes the application startup error:
  sqlalchemy.exc.InvalidRequestError: Attribute name 'metadata' is reserved
  when using the Declarative API.

The migration is now idempotent and handles both PostgreSQL and SQLite
databases safely.
2026-01-02 07:50:04 +01:00
Dries Peeters
b081e6d2dc Fix backup storage path in Docker
Default admin backups to a writable, configurable folder (BACKUP_FOLDER/BACKUP_DIR, defaulting to /data/uploads/backups) to avoid permission denied errors in non-root containers.

Also update local-test compose and docs to reflect the backup location.
2026-01-02 07:39:04 +01:00
Dries Peeters
d6788570fe Merge pull request #379 from DRYTRIX/rc/v4.8.8
Rc/v4.8.8
v4.8.8
2026-01-01 13:32:22 +01:00
Dries Peeters
f054f52c17 Version Bump 2026-01-01 13:31:46 +01:00
Dries Peeters
b9b7612633 Fix migration 091: Handle existing integration_external_event_links table
The migration was failing with DuplicateTable error when the table
already existed in the database. This can happen when:
- The table was created manually
- A previous migration attempt partially succeeded
- Database state is out of sync with Alembic version tracking

Changes:
- Add _has_table() helper to check table existence
- Add _has_index() helper to check index existence
- Make upgrade() idempotent by checking before creating
- Make downgrade() safe by checking before dropping
- Follow same pattern as other migrations (018, 037)

This allows the migration to run successfully even when the table
already exists, creating only missing indexes if needed.
2026-01-01 13:30:23 +01:00
Dries Peeters
f0fa2af563 Merge pull request #377 from DRYTRIX/rc/v4.8.7
Rc/v4.8.7
v4.8.7
2026-01-01 09:19:44 +01:00
Dries Peeters
f562768e01 Version Bump v4.8.7 2026-01-01 09:19:04 +01:00
Dries Peeters
427074398c Improve migration robustness and add missing schema columns
- Refactor migrations with idempotency checks and better error handling
  * Add SQLAlchemy inspector checks for table/column existence
  * Improve error messages and handling for schema operations
  * Make migrations safe to run multiple times
  * Update 27 migration files with enhanced error handling patterns

- Add missing schema columns via new migrations
  * Migration 095: Add ui_show_issues column to users table
  * Migration 096: Add portal_issues_enabled column to clients table

- Enhance Settings model error handling
  * Improve detection of schema errors (table/column missing)
  * Better handling of SQLAlchemy exceptions during migrations
  * More comprehensive error checking for OperationalErrors

- Fix database auto-switching logic in app initialization
  * Respect explicit DATABASE_URL setting to prevent unwanted switches
  * Only auto-switch to PostgreSQL when not explicitly configured

- Update docker entrypoint script with migration improvements
2026-01-01 09:15:31 +01:00
Dries Peeters
1be138f42a Merge pull request #376 from DRYTRIX/rc/v4.8.6
Rc/v4.8.6
v4.8.6
2025-12-31 11:52:55 +01:00
Dries Peeters
0dedb5e782 Update setup.py 2025-12-31 11:52:13 +01:00
Dries Peeters
3e75d59349 Fixed Entrypoint 2025-12-31 11:51:57 +01:00
Dries Peeters
42ad764c74 Merge pull request #374 from DRYTRIX/rc/v4.8.5
Rc/v4.8.5
v4.8.5
2025-12-31 07:06:56 +01:00
Dries Peeters
b709e1f08d Update setup.py 2025-12-31 07:04:06 +01:00
Dries Peeters
7f60d8db1e Update entrypoint_fixed.sh 2025-12-31 07:03:53 +01:00
Dries Peeters
4d3db70038 Merge pull request #372 from DRYTRIX/rc/v4.8.4
Rc/v4.8.4
v4.8.4
2025-12-30 20:44:27 +01:00
Dries Peeters
123fc067da version bump 4.8.4 2025-12-30 20:42:20 +01:00
Dries Peeters
a42a84ecdc Fix layout inconsistencies and remove footer from all pages
- Replace bg-white dark:bg-gray-800 with bg-card-light dark:bg-card-dark across all templates for consistent theming
- Fix layout rendering issues on multiple pages:
  * Calendar - Calendar View
  * Time Tracking - Projects, Weekly Goals, Time Entry Templates
  * Tools & Data - Import/Export, Saved Filters
  * Admin - Security Access (API Tokens), System Maintenance (Backups)
  * User pages (Profile, Settings)
  * Invoice, Quote, and Expense pages
  * All component widgets and help pages
- Remove footer section from base.html to clean up page layout
- Remove unused footer script for setting current year
- Ensure consistent card styling across entire application for proper dark mode support

Affects 33 template files total.
2025-12-30 20:41:58 +01:00
Dries Peeters
22bd7da213 Merge pull request #370 from DRYTRIX/rc/v4.8.3
Rc/v4.8.3
v4.8.3
2025-12-30 09:53:09 +01:00
Dries Peeters
d4ee8fe4a3 version bump to 4.8.3 2025-12-30 09:52:31 +01:00
Dries Peeters
9507a9492c feat: Add comprehensive donation system with smart prompts and improved accessibility
- Add dedicated donation page (/donate) explaining why donations matter
- Implement DonationInteraction model to track user engagement and interactions
- Add smart banner logic with contextual messaging based on user milestones
- Improve donation accessibility with links in sidebar, footer, dashboard, and all major pages
- Add UTM tracking to all Buy Me a Coffee links for analytics
- Fix CSRF token issues in donation tracking JavaScript
- Enhance dashboard widget with user stats and dual action buttons
- Add donation information section to About page
- Update support banner with 'Learn More' and 'Donate' options
- Create database migration for donation_interactions table

The donation system now provides:
- Smart prompts that show after user milestones (7+ days, 50+ entries, 100+ hours)
- Banner dismissal tracking with 30-day cooldown
- Multiple access points throughout the application
- Better visibility of donation impact and importance
- Comprehensive tracking for analytics and optimization
2025-12-30 09:52:12 +01:00
Dries Peeters
d6351eb1c2 Merge pull request #369 from DRYTRIX/rc/v4.8.2
Rc/v4.8.2
v4.8.2
2025-12-29 20:38:09 +01:00
Dries Peeters
e21a350ec6 version bump 2025-12-29 20:36:18 +01:00
Dries Peeters
66ca9589bb Fix project template tasks creation and editing
- Fix tasks not being created when projects are created from templates
  * Remove invalid status parameter from task creation (TaskService doesn't accept it)
  * Fix estimated_hours conversion from string to float/None
  * Add proper error handling for task creation failures
  * Refresh template from database before reading tasks

- Fix missing tasks section in template edit form
  * Add tasks section to edit template form with full CRUD functionality
  * Display existing tasks when editing templates
  * Allow adding, editing, and removing tasks in templates

- Fix tasks not being saved when creating/editing templates
  * Fix JavaScript form handling to properly collect tasks from form
  * Create tasks input field on page load and update on submit
  * Add capture phase event listener to ensure tasks are set before form submission
  * Ensure tasks are always saved as a list (never None)

- Fix [object Object] error in toast notifications
  * Add safeguards to ensure flash messages are always strings
  * Add object-to-string conversion in toast notification system

- Improve error handling and validation
  * Add validation to ensure tasks is always a list
  * Improve JSON parsing with better error handling
  * Add safeguards for flash message handling
2025-12-29 20:33:56 +01:00
Dries Peeters
e8bf502153 Fix: Handle None values in stock item form fields
Convert None database values to empty strings in template to prevent 'None' text from appearing in form fields. This fixes an issue where users had to manually delete 'None' from URL and other optional fields before saving.

Updated fields: image_url, description, category, barcode, and notes to use 'or' filter for proper None handling.
2025-12-29 19:50:33 +01:00
Dries Peeters
b22c7662f4 Merge pull request #367 from DRYTRIX/rc/v4.8.1
Rc/v4.8.1
v4.8.1
2025-12-29 17:03:14 +01:00
Dries Peeters
090344aa5d Fix JSON serialization error when editing stock items
Convert Supplier objects to dictionaries before passing to template to
prevent 'Object of type Supplier is not JSON serializable' error.

The template uses tojson filter to serialize suppliers for JavaScript,
but SQLAlchemy model objects are not directly JSON serializable. By
converting suppliers to dictionaries using to_dict() method before
rendering, the serialization now works correctly.

Fixes issue where editing stock items resulted in 500 server error.
Affects both new_stock_item and edit_stock_item routes.
2025-12-29 17:01:31 +01:00
Dries Peeters
5e61ed382a Validate and simplify integration setup pages
- Remove confusing trello_token field from Trello setup (replaced with api_secret)
- Add required field indicators (*) and HTML validation for all OAuth credentials
- Add backend validation for required fields (Client ID, API Key, API Secret)
- Improve GitLab instance URL validation with proper defaults and URL format checking
- Enhance help text for Microsoft integrations (Outlook, Teams) tenant_id field
- Clarify when fields are required vs optional with better placeholder text
- Ensure setup pages only show necessary fields for each integration type

All integration setup pages now have:
- Clear required field indicators
- Proper validation (frontend and backend)
- Simplified, intuitive forms
- Better help text and instructions
- No unnecessary or confusing fields
2025-12-29 16:53:54 +01:00
Dries Peeters
53c58ec43e feat: comprehensive integration setup and configuration system
Enhanced all integrations with complete setup procedures, authentication flows,
and comprehensive configuration management.

Base Connector Enhancements:
- Extended get_config_schema() with sections, sync settings, and validation
- Added validate_config() with type checking and constraints
- Added helper methods: get_sync_settings(), get_field_mappings(), get_status_mappings()

Integration Configuration Schemas:
- All integrations now have complete config schemas with organized sections
- Support for sync direction (Import/Export/Bidirectional)
- Sync scheduling options (Manual/Hourly/Daily/Weekly)
- Data mapping configuration (status mappings, field mappings)
- Field types: string, number, boolean, select, array, json, url, text, password
- Comprehensive help text and descriptions for all fields

Enhanced Integrations:
- Jira: JQL queries, status mapping, project auto-creation
- GitHub: Repository selection, issue state filtering, webhook security
- GitLab: Project selection, issue filtering, webhook configuration
- Slack: Channel selection, notification triggers
- Asana: Workspace/project selection, completion status sync
- Trello: Board selection, list-to-status mapping
- Microsoft Teams: Channel configuration, notification settings
- QuickBooks: Customer/item/account mappings, sandbox mode
- Xero: Contact/item/account mappings
- Google Calendar: Event formatting, date range controls
- Outlook Calendar: Event formatting, date range controls
- CalDAV: Server discovery, SSL verification, lookback/lookahead

UI Enhancements:
- Section-based configuration display
- Support for all field types (select, array, number, json, boolean)
- Improved help text and descriptions
- Better visual organization and validation

Route Enhancements:
- Config schema passed to template
- Form processing for all field types
- Proper default value handling
- Validation error messages

This provides a complete, user-friendly integration setup experience with
one-button OAuth connections, configurable sync settings, and data translation
capabilities.
2025-12-29 16:35:06 +01:00
Dries Peeters
764f65639d Version Bump 2025-12-29 16:09:01 +01:00
Dries Peeters
bd16c664ac feat: Enhance integrations management with config UI and improved status display
- Add integration-specific configuration support via get_config_schema()
  - Dynamic form generation for config fields (string, boolean, text, JSON, url)
  - Save integration config to database (jira_url, jql, realm_id, etc.)
  - Support for all field types with validation and help text

- Improve connection status visualization
  - Enhanced status badges (Connected/Not Connected, Sync OK/Error)
  - Display last sync timestamp and error messages
  - Grid layout for better information hierarchy
  - Clear visual feedback for connection health

- Enhance sync operations
  - Update last_sync_at, last_sync_status, and last_error fields
  - Log sync events with metadata to IntegrationEvent table
  - Better error handling and user feedback

- Clean up integrations list page
  - Remove duplicate 'Your Active Integrations' table section
  - Keep only card-based view with all necessary information
  - Simplified, cleaner interface

- Fix f-string syntax errors in QuickBooks connector
  - Extract string replacements outside f-string expressions
  - Fix lines 382 and 444 that prevented connector registration

- Update navigation and admin dashboard
  - Move integrations link from admin menu to Tools & Data menu
  - Update admin dashboard shortcut to new integrations route

All integrations now have full configuration UI support, better status
feedback, and improved user experience.
2025-12-29 16:03:46 +01:00
Dries Peeters
0c310736c1 Remove legacy UI enable/disable settings system
Remove both system-wide and per-user UI feature enable/disable settings
in favor of the centralized ModuleRegistry system for module management.

Changes:
- Remove ui_allow_* columns from Settings model and database (migration 093)
- Remove ui_show_* preference assignments from user settings route
- Remove UI Customization section from user settings template
- Remove UI Features section from admin settings template
- Update admin modules template to use ModuleRegistry instead of settings flags
- Remove settings_flag and user_flag attributes from ModuleDefinition
- Update ModuleRegistry.is_enabled() to only check dependencies and default_enabled
- Update dashboard template to use is_module_enabled() helper
- Update admin route docstring to reflect module management changes

Module visibility is now controlled exclusively via the admin module
management interface (/admin/modules), eliminating the need for separate
system-wide and per-user UI preference systems.
2025-12-29 15:51:59 +01:00
Dries Peeters
fbdd204fe8 Merge pull request #366 from DRYTRIX/rc/v4.8.0
Rc/v4.8.0
v4.8.0
2025-12-29 14:16:40 +01:00
Dries Peeters
083dd9f1f2 feat: Implement comprehensive module system with visibility controls
- Add centralized module registry system (ModuleRegistry) for managing
  module metadata, dependencies, and visibility across the application
- Create module helper utilities with decorators (@module_enabled) and
  helper functions for route protection and template access
- Add database migration (092) to add missing module visibility flags
  to settings and users tables for granular control
- Extend Settings and User models with additional module visibility
  flags for CRM, Finance, Tools, and Advanced features
- Implement admin module management UI for system-wide module
  enable/disable controls
- Add module checks to routes (calendar, contacts, deals, expenses,
  invoices, leads, custom_reports) to enforce visibility rules
- Update scheduled report service and report templates to respect
  module visibility settings
- Bump version to 4.8.0 in setup.py
- Add comprehensive documentation for module integration planning
  and implementation analysis
2025-12-29 14:13:32 +01:00