Skip to content
Closed

pull #13

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
3cf42f6
Delete records_management/data/tag_model.xml
John75SunCity Jul 4, 2025
552eef0
feat: Add inventory management templates and validation script; updat…
John75SunCity Jul 4, 2025
fe4015b
Merge branch 'main' of https://github.com/John75SunCity/ssh-git-githu…
John75SunCity Jul 4, 2025
e35ae52
refactor: Clean up devcontainer.json by removing unused configuration…
John75SunCity Jul 4, 2025
a5d3886
feat: Remove sample tag model XML file to streamline records management
John75SunCity Jul 4, 2025
6d97b22
refactor: Remove unused RecordsDocumentType class to clean up code
John75SunCity Jul 4, 2025
37f9d0b
Implement feature X to enhance user experience and fix bug Y in module Z
John75SunCity Jul 4, 2025
0c2d84f
feat: Add product templates and variants for document storage and shr…
John75SunCity Jul 4, 2025
df51779
refactor: Remove tag_access.csv and update access control in ir.model…
John75SunCity Jul 4, 2025
72aa94e
feat: Add access control for shredding service and customer inventory…
John75SunCity Jul 4, 2025
5bc0485
refactor: Remove obsolete permission scripts
John75SunCity Jul 4, 2025
311f1e0
feat: Add modern map widget component with Owl framework and XML temp…
John75SunCity Jul 4, 2025
0c876f6
fix: Update product fields for Odoo version compatibility by replacin…
John75SunCity Jul 4, 2025
1ebaaff
feat: Enhance Records Management module for Odoo 18 compatibility wit…
John75SunCity Jul 4, 2025
77d1fc8
feat: Revamp Records Management menus and views for improved organiza…
Jul 4, 2025
9778eb6
feat: Update customer inventory and pickup request views, and add com…
Jul 4, 2025
a8a7809
fix: Update product type fields for compatibility with Odoo standards
Jul 4, 2025
64f54b6
fix: Update product type values for Odoo 18.0 compatibility to resolv…
Jul 4, 2025
f03457d
fix: Update product type fields from 'storable' to 'product' for cons…
Jul 5, 2025
fdda6e5
feat: Enhance records_management module with improved linting and cod…
Jul 5, 2025
733f89c
feat: Implement comprehensive VS Code configuration and linting impro…
Jul 5, 2025
634338e
fix: Update product type fields from 'type' to 'detailed_type' for co…
Jul 5, 2025
05b69a6
refactor: Improve logging format and clean up imports across multiple…
Jul 5, 2025
1d5ff96
fix: Update product type fields for consistency in product templates
Jul 5, 2025
92b7bfd
feat: Add line counting and module analysis script for records_manage…
Jul 5, 2025
aae5e2c
fix: Update nextcall calculation to use datetime.timedelta for consis…
Jul 5, 2025
22ac295
fix: Update product type fields from 'storable' to 'goods' for consis…
Jul 5, 2025
38c541e
refactor: Remove post-installation hook and dependencies check, updat…
Jul 5, 2025
f4e5c2b
fix: Update product type fields from 'goods' to 'storable' and 'servi…
Jul 5, 2025
0ebe699
fix: Update product type fields to 'consu' for consistency in product…
Jul 5, 2025
bf68547
fix: Update product templates and cleanup script for Odoo 18.0 compat…
Jul 5, 2025
a94f7b6
fix: Update nextcall field to use datetime directly for scheduled act…
Jul 5, 2025
7575be2
fix: Remove unnecessary numbercall field from scheduled actions
Jul 5, 2025
e596e55
fix: Update logger name for scheduled actions to improve logging clarity
Jul 5, 2025
a6584ad
fix: Refactor monthly storage fees computation to remove unused impor…
Jul 5, 2025
1ac2d36
fix: Update view modes from 'tree' to 'list' for various records mana…
Jul 5, 2025
5c5c474
fix: Change view mode from 'tree' to 'list' for various records manag…
Jul 5, 2025
da20474
fix: Update records location views to remove unused fields and improv…
Jul 5, 2025
4567438
fix: Update document_ids field context to use 'id' for correct reference
Jul 5, 2025
214d315
fix: Update button visibility conditions in various views to improve …
Jul 5, 2025
32bd922
fix: Update filter for retention date in records document views
Jul 5, 2025
a444a88
fix: Remove unused document type views to streamline records management
Jul 5, 2025
e3ae6db
feat: Add validation script for Odoo XML view files and cleanup instr…
Jul 5, 2025
c7b30c6
fix: Rename kanban-box template to card for consistency in records an…
Jul 5, 2025
c8e1ecf
fix: Add 'fleet' dependency to the manifest and correct signature pag…
Jul 5, 2025
c66a4d1
feat: Enhance Shredding Service model with new fields and update view…
Jul 5, 2025
3e36c04
fix: Correct parent reference in Serial Numbers menu item for consist…
Jul 5, 2025
c067291
fix: Remove duplicate entry for records_management_menus.xml in manifest
Jul 5, 2025
d23c2d8
feat: Add security group definitions and update menu item group refer…
Jul 6, 2025
603cfa6
fix: Move 'Serial Numbers' menu item to records_management_menus.xml …
Jul 6, 2025
8dc3219
fix: Add comment indicating menu relocation to records_management_men…
Jul 6, 2025
1226b41
fix: Remove unnecessary newline before closing data tag in records_ma…
Jul 6, 2025
3882c39
feat: Add test script for records_management module installation and …
Jul 6, 2025
50eb323
Fix: Recreate records_management_menus.xml to resolve XML parsing errors
Jul 6, 2025
0f5c3a4
fix: Remove obsolete records_management_menus_test.xml file
Jul 6, 2025
deefed7
feat: Add records_management_menus_test.xml for menu structure testing
Jul 6, 2025
7e96e0d
Fix: Move menu loading after view definitions
Jul 6, 2025
71bee88
Fix: Ensure all view files load before menus
Jul 6, 2025
7728f70
Fix: Correct customer inventory views to use proper model
Jul 6, 2025
0429ae6
Fix: Remove problematic graph view and report from customer inventory
Jul 6, 2025
146f8c9
Fix: Remove customer inventory menu items from records management
Jul 6, 2025
6cb0f7e
Fix: Add missing report file to records management manifest
Jul 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 5 additions & 28 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
"ms-vscode.remote-server",
"ms-vscode-remote.remote-wsl",
"GitHub.codespaces"
// To add more extensions, simply add their IDs here:
// "ms-vscode.vscode-xml", // XML support
// "ms-toolsai.jupyter", // Jupyter notebooks
// "redhat.vscode-yaml", // YAML support
// "odoo.odoo-snippets" // Odoo-specific snippets (if available)
// Add more Odoo-specific or Python QA/testing extensions as needed
],
"settings": {
Expand Down Expand Up @@ -66,34 +71,6 @@
}
},
"postCreateCommand": "bash -c 'cd /workspace && if [ -f package.json ]; then npm ci; fi && echo \"DevContainer setup complete!\"'",
"remoteEnv": {
"PYTHONPATH": "/workspace:/workspace/records_management",
"ODOO_RC": "/workspace/odoo.conf",
"PGHOST": "localhost",
"PGPORT": "5432"
// Consider using .env files or secrets management for sensitive values
}
// Add comments as needed to explain custom configuration
}
"mounts": [
"source=${localWorkspaceFolder},target=/workspace,type=bind"
],
"forwardPorts": [8069, 8071, 8072],
"portsAttributes": {
"8069": {
"label": "Odoo HTTP",
"onAutoForward": "notify"
},
"8071": {
"label": "Odoo HTTPS",
"onAutoForward": "ignore"
},
"8072": {
"label": "Odoo Longpolling",
"onAutoForward": "ignore"
}
},
"postCreateCommand": "bash -c 'cd /workspace && npm install && echo \"DevContainer setup complete!\"'",
"remoteEnv": {
"PYTHONPATH": "/workspace:/workspace/records_management",
"ODOO_RC": "/workspace/odoo.conf",
Expand Down
84 changes: 84 additions & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
[MASTER]
# Specify a configuration file.
rcfile=

# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
init-hook=

# Add files or directories to the blacklist. They should be base names, not paths.
ignore=.devcontainer,addons,venv,node_modules,dist

# Add files or directories matching the regex patterns to the blacklist.
ignore-patterns=

# Pickle collected data for later comparisons.
persistent=yes

# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
load-plugins=

# Use multiple processes to speed up Pylint.
jobs=1

# Allow loading of arbitrary C extensions. Extensions are imported into the
# active Python interpreter and may run arbitrary code.
unsafe-load-any-extension=no

# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code
extension-pkg-whitelist=

[MESSAGES CONTROL]
# Disable specific warnings for Odoo development
disable=
missing-docstring,
too-few-public-methods,
too-many-arguments,
unused-argument,
line-too-long,
invalid-name,
import-error,
no-member

[REPORTS]
# Set the output format. Available formats are text, parseable, colorized, msvs
# (visual studio) and html. You can also give a reporter class, eg
# mypackage.mymodule.MyReporterClass.
output-format=text

# Put messages in a separate file for each module / package specified on the
# command line instead of printing them on stdout. Reports (if any) will be
# written to a file name "pylint_global.[txt|html]".
files-output=no

# Tells whether to display a full report or only the messages
reports=yes

# Python expression which should return a note less than 10 (10 is the highest
# note). You have access to the variables errors warning, statement which
# respectively contain the number of errors / warnings messages and the total
# number of statements analyzed. This is used by the global evaluation report
# (RP0004).
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)

[FORMAT]
# Maximum number of characters on a single line.
max-line-length=88

# Regexp for a line that is allowed to be longer than the limit.
ignore-long-lines=^\s*(# )?<?https?://\S+>?$

# Allow the body of an if to be on the same line as the test if there is no else.
single-line-if-stmt=no

# Maximum number of lines in a module
max-module-lines=1000

# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 tab).
indent-string=' '

# Number of spaces of indent required inside a hanging or continued line.
indent-after-paren=4
38 changes: 34 additions & 4 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,39 @@
{
// "python.analysis.extraPaths": [
// "/workspaces/ssh-git-github.com-odoo-odoo.git-8.0"
// ],
// Focus linting only on our custom module
"python.analysis.extraPaths": [
"/workspaces/ssh-git-github.com-odoo-odoo.git-8.0/records_management"
],
"python.analysis.exclude": [
".devcontainer/**",
"addons/**",
"venv/**",
"node_modules/**",
"dist/**"
],
"python.analysis.diagnosticSeverityOverrides": {
"reportMissingImports": "none"
},
"git.ignoreLimitWarning": true
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.linting.pylintArgs": [
"--disable=C0103,C0111,R0903,W0613,R0913,C0301"
],
"python.linting.flake8Enabled": true,
"python.linting.flake8Args": [
"--max-line-length=88",
"--exclude=.devcontainer,addons,venv,node_modules,dist"
],
"git.ignoreLimitWarning": true,
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
".devcontainer": true,
"addons": true,
"venv": true,
"node_modules": true
},
"github.copilot.nextEditSuggestions.enabled": true
}
105 changes: 105 additions & 0 deletions MENU_OPTIMIZATION_SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# Records Management Menu Structure - Odoo 18.0 Optimization Summary

## ✅ COMPLETED OPTIMIZATIONS

### 🎯 **Menu Structure Reorganization**
Successfully reorganized the Records Management module menu structure to align with Odoo 18.0 best practices and the standard menu patterns found in core Odoo applications.

### 📊 **Key Changes Made**

#### 1. **Hierarchical Organization**
- **Before**: Flat menu structure with confusing organization
- **After**: Logical 4-tier hierarchy: Operations → Inventory → Reporting → Configuration

#### 2. **Security Implementation**
- **Added proper group restrictions** to all menu items
- **Role-based access**: Users vs Managers
- **Progressive access**: Configuration restricted to managers only

#### 3. **Sequence Optimization**
- **Before**: Random sequences (90, 10, 20, etc.)
- **After**: Logical progression (10, 20, 30, 40, 50...)
- **Root menu**: Sequence 50 (optimal position among other apps)

#### 4. **Duplicate Removal**
Cleaned up **5 duplicate menu definitions** across multiple files:
- `stock_lot_views.xml` - Removed duplicate root menu
- `customer_inventory_views.xml` - Removed orphaned menu
- `records_retention_policy_views.xml` - Removed incorrect parent reference
- `records_document_type_views.xml` - Removed duplicate configuration menu
- `pickup_request.xml` - Removed stock module parent reference

#### 5. **Action Improvements**
- **Enhanced customer inventory action** with proper window views
- **Verified all menu actions exist** and are properly configured
- **Added helpful descriptions** for empty states

### 🏗️ **New Menu Structure**

```
📁 Records Management (Sequence: 50)
├── 🔧 Operations (10)
│ ├── Storage Boxes (10)
│ ├── Documents (20)
│ ├── Pickup Requests (30)
│ ├── Shredding Services (40)
│ └── Serial Numbers (50)
├── 📊 Inventory (20)
│ ├── Customer Inventory (10)
│ └── Retention Policies (20) [Managers Only]
├── 📈 Reporting (30)
│ ├── Storage Reports (10)
│ └── Inventory Reports (20)
└── ⚙️ Configuration (100) [Managers Only]
├── 📋 Master Data (10)
│ ├── Storage Locations (10)
│ ├── Document Types (20)
│ └── Classification Tags (30)
├── 🛍️ Products & Services (20)
│ ├── Service Products (10)
│ └── Product Variants (20)
└── 🔧 Settings (90)
```

### 🎉 **Benefits Achieved**

#### ✅ **User Experience**
- **Intuitive navigation** with logical grouping
- **Role-appropriate access** based on job responsibilities
- **Reduced clutter** through duplicate removal
- **Clear section separation** with descriptive names

#### ✅ **Technical Excellence**
- **Full Odoo 18.0 compliance** following official patterns
- **Proper XML structure** with no syntax errors
- **Security group integration** with existing permissions
- **Standard action references** to core Odoo modules

#### ✅ **Business Logic**
- **Operations first** - daily work activities are most accessible
- **Management features** - inventory and policies centrally located
- **Reporting tools** - analytics easily discoverable
- **Configuration isolated** - admin functions protected

#### ✅ **Odoo.sh Ready**
- **No deprecated patterns** or non-standard structures
- **Follows core module conventions** from Accounting, Inventory, CRM
- **Clean XML validation** passes all checks
- **Proper dependency management** with existing modules

### 📋 **Validation Results**
- ✅ **XML Syntax**: All files pass validation
- ✅ **Action References**: All menu actions properly defined
- ✅ **Security Groups**: All referenced groups exist
- ✅ **Parent References**: No orphaned or circular dependencies
- ✅ **Sequence Logic**: Proper numerical progression
- ✅ **Module Integration**: Compatible with core Odoo modules

### 🚀 **Next Steps**
The menu structure is now production-ready for Odoo 18.0 and Odoo.sh deployment. The organization follows industry best practices and provides an excellent foundation for:
- **User training** - logical flow matches business processes
- **Future expansion** - room for additional features in each section
- **Multi-company deployment** - proper security isolation
- **Integration** - standard patterns for third-party modules

The Records Management module now provides a professional, enterprise-grade user interface that scales with organizational needs while maintaining simplicity for day-to-day operations.
77 changes: 77 additions & 0 deletions ODOO_18_COMPATIBILITY_FIX_FINAL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Odoo 18.0 Compatibility Fix - Records Management Module

## Issue Summary
The Records Management module was experiencing database constraint violations when installing on Odoo 18.0/Odoo.sh, specifically:
- `ValueError` for invalid `product.template.type` field values
- `IntegrityError` for duplicate key violations on product variants

## Root Causes Identified

### 1. Invalid Product Type Field Values
**Problem**: The module was using deprecated field names and values from older Odoo versions:
- Field `detailed_type` instead of `type`
- Values like `storable` and `goods` which are invalid in Odoo 18.0

**Solution**: Updated products.xml to use correct Odoo 18.0 field names and values:
- Changed `detailed_type` to `type`
- Used valid values: `consu` (consumable) and `service`

### 2. Duplicate Product Variant Creation
**Problem**: The module was explicitly defining both `product.template` and `product.product` records, but Odoo 18.0 automatically creates product variants when templates are created, causing constraint violations.

**Solution**: Removed all explicit `product.product` records from products.xml, keeping only `product.template` records.

## Files Modified

### 1. /records_management/data/products.xml
- **Changed**: Field names from `detailed_type` to `type`
- **Changed**: Field values to valid Odoo 18.0 values (`consu`, `service`)
- **Removed**: All explicit `product.product` variant records
- **Added**: Unique external IDs with module prefix
- **Added**: `forcecreate="False"` attributes to prevent forced creation

### 2. Backup Files Created
- `/records_management/data/products_full.xml` - Full product definitions for future use
- `/records_management/data/products_minimal.xml` - Empty file for testing
- `/cleanup_products.py` - Database cleanup script

## Current State

The module now loads with a minimal products.xml file (no product records) to avoid database conflicts. This allows the module to install successfully while we ensure the database is clean.

## Next Steps for Complete Resolution

### Option 1: Gradual Installation (Recommended)
1. Install module with current minimal products.xml
2. Verify module loads without errors
3. Clean database of any existing duplicate products
4. Replace products.xml with products_full.xml
5. Upgrade module to load product data

### Option 2: Database Cleanup (If needed)
If duplicate records persist from previous failed installs:
1. Use the cleanup_products.py script in an Odoo shell
2. Manually remove conflicting product records via database
3. Restore products.xml and upgrade module

## Technical Details

### Valid Product Types in Odoo 18.0
- `consu` - Consumable product (tracked as stock but no inventory)
- `product` - Storable product (full inventory tracking)
- `service` - Service (no stock tracking)

### Database Constraints
The `product_product_combination_unique` constraint ensures that each product template can only have one variant with the same attribute combination. The conflict occurred because:
1. Manual product.product records were created with specific IDs
2. Odoo auto-generation tried to create variants with the same template+combination
3. Database rejected the duplicate

## Verification Steps
1. Check Odoo.sh logs for successful module installation
2. Verify no database constraint errors
3. Test module functionality in Odoo interface
4. Gradually restore product data as needed

## Contact
For questions about these changes, refer to the git commit history or create an issue in the repository.
Loading