Skip to content

Conversation

@John75SunCity
Copy link
Owner

No description provided.

@John75SunCity John75SunCity requested a review from Copilot July 4, 2025 20:35

This comment was marked as outdated.

Copy link
Owner Author

@John75SunCity John75SunCity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed

@John75SunCity John75SunCity requested a review from Copilot July 4, 2025 20:36
Copy link
Contributor

Copilot AI left a 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.py for basic XML and Python syntax checks
  • Create portal view in my_portal_inventory.xml and standalone inventory template in inventory_template.xml
  • Replace tag model stub with sample tag_data.xml, add sale dependency, 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 uses inventory_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'
Copy link

Copilot AI Jul 4, 2025

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.

Copilot uses AI. Check for mistakes.
Comment on lines +9 to +17
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))
Copy link

Copilot AI Jul 4, 2025

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.

Suggested change
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')

Copilot uses AI. Check for mistakes.
Comment on lines +19 to +28
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}")
Copy link

Copilot AI Jul 4, 2025

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.

Suggested change
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}")

Copilot uses AI. Check for mistakes.
…g 'detailed_type' with 'type' and removing incompatible fields
…h post-installation checks, updated sequences, and modernized views
…prehensive menu structure for Records Management module
odoo added 3 commits July 6, 2025 00:45
- 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants