-
Notifications
You must be signed in to change notification settings - Fork 0
pull #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pull #13
Conversation
John75SunCity
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reviewed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a validation script for XML/Python files, introduces new portal and inventory templates for the records management module, updates sample tag data and manifest dependencies, and adjusts the devcontainer configuration.
- Add
validate_module.pyfor basic XML and Python syntax checks - Create portal view in
my_portal_inventory.xmland standalone inventory template ininventory_template.xml - Replace tag model stub with sample
tag_data.xml, addsaledependency, and clean up.devcontainer/devcontainer.json
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| validate_module.py | New script to walk a module path and validate XML/Python files |
| records_management/views/my_portal_inventory.xml | Portal extension to display inventory link on customer portal |
| records_management/views/inventory_template.xml | Standalone inventory template with table of quants |
| records_management/data/tag_data.xml | Replace initial model registration with sample tag records |
| records_management/manifest.py | Add sale to dependencies and switch to data/tag_data.xml |
| .devcontainer/devcontainer.json | Comment out extensions and mounts, introduce JSON structure issues |
Comments suppressed due to low confidence (2)
records_management/views/inventory_template.xml:9
- [nitpick] The template uses
quants, while the portal version usesinventory_records. Consider standardizing variable names across templates for clarity.
<div t-if="not quants" class="alert alert-info">
.devcontainer/devcontainer.json:74
- The JSON structure is broken after commenting out the mounts and closing braces; this will cause a syntax error. Please validate the file and restore matching
{ }or remove trailing commas.
"remoteEnv": {
| print(f"✗ {py_file} - Error: {e}") | ||
|
|
||
| def main(): | ||
| module_path = '/workspaces/ssh-git-github.com-odoo-odoo.git-8.0/records_management' |
Copilot
AI
Jul 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid hard-coding module_path. Consider using an argument parser (e.g., argparse) or environment variable to allow configuring the path at runtime.
| def validate_xml_files(module_path): | ||
| """Validate XML files in the module""" | ||
| xml_files = [] | ||
|
|
||
| # Find all XML files | ||
| for root, dirs, files in os.walk(module_path): | ||
| for file in files: | ||
| if file.endswith('.xml'): | ||
| xml_files.append(os.path.join(root, file)) |
Copilot
AI
Jul 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file-discovery logic in validate_xml_files and validate_python_files is duplicated. Extract a helper (e.g., find_files(module_path, extension)) to reduce repetition.
| def validate_xml_files(module_path): | |
| """Validate XML files in the module""" | |
| xml_files = [] | |
| # Find all XML files | |
| for root, dirs, files in os.walk(module_path): | |
| for file in files: | |
| if file.endswith('.xml'): | |
| xml_files.append(os.path.join(root, file)) | |
| def find_files(module_path, extension): | |
| """Find files with the given extension in the specified module path""" | |
| files = [] | |
| for root, dirs, files_in_dir in os.walk(module_path): | |
| for file in files_in_dir: | |
| if file.endswith(extension): | |
| files.append(os.path.join(root, file)) | |
| return files | |
| def validate_xml_files(module_path): | |
| """Validate XML files in the module""" | |
| xml_files = [] | |
| # Find all XML files | |
| xml_files = find_files(module_path, '.xml') |
| print(f"Found {len(xml_files)} XML files") | ||
|
|
||
| for xml_file in xml_files: | ||
| try: | ||
| ET.parse(xml_file) | ||
| print(f"✓ {xml_file} - Valid XML") | ||
| except ET.ParseError as e: | ||
| print(f"✗ {xml_file} - Parse Error: {e}") | ||
| except Exception as e: | ||
| print(f"✗ {xml_file} - Error: {e}") |
Copilot
AI
Jul 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace print statements with the logging module to give users configurable log levels and better integration in other scripts.
| print(f"Found {len(xml_files)} XML files") | |
| for xml_file in xml_files: | |
| try: | |
| ET.parse(xml_file) | |
| print(f"✓ {xml_file} - Valid XML") | |
| except ET.ParseError as e: | |
| print(f"✗ {xml_file} - Parse Error: {e}") | |
| except Exception as e: | |
| print(f"✗ {xml_file} - Error: {e}") | |
| logging.info(f"Found {len(xml_files)} XML files") | |
| for xml_file in xml_files: | |
| try: | |
| ET.parse(xml_file) | |
| logging.info(f"✓ {xml_file} - Valid XML") | |
| except ET.ParseError as e: | |
| logging.error(f"✗ {xml_file} - Parse Error: {e}") | |
| except Exception as e: | |
| logging.error(f"✗ {xml_file} - Error: {e}") |
…g 'detailed_type' with 'type' and removing incompatible fields
…h post-installation checks, updated sequences, and modernized views
…tion and access control
…prehensive menu structure for Records Management module
…ences for consistency
…for better organization
…us.xml for proper loading order
…nagement_menus.xml
…menu loading verification
- Completely recreated the menus file to fix parsing issues - Ensured all menuitem tags are properly self-closing - Fixed the 'External ID not found' error for menu_records_operations - All menu definitions are now properly structured for Odoo 18.0
- Moved records_management_menus.xml to load after all view files - Ensures actions like action_records_box are defined before menus reference them - Fixes 'External ID not found' errors for action references in menus
- Moved customer_inventory_views.xml and res_partner_views.xml before menus - Moved report/records_reports.xml before menus - All actions are now defined before menu references - This should resolve all 'External ID not found' errors for actions
- Fixed customer_inventory_views.xml to use customer.inventory.report model - Replaced stock.quant references which don't have customer_id field - Added proper list, form, and graph views for customer.inventory.report - Resolves field validation error: 'customer_id does not exist in model stock.quant'
- Removed graph view that was causing field validation error - Temporarily removed report/records_reports.xml from manifest to isolate issue - Simplified customer_inventory_views.xml to only include list and form views - Fixes 'customer_id does not exist in model stock.quant' error
No description provided.