The error you're encountering in Odoo version 18 is caused by a conflict in templates. Specifically, the mail.AttachmentList template is defined twice, which results in Odoo being unable to load the portal.assets_chatter.bundle.xml. This is often caused by either:
- A misconfiguration or bug in the installed modules (in this case, the purchase module).
- Caching issues in the browser or the server.
Here’s how you can troubleshoot and resolve the issue:
1. Clear Cache and Assets
2. Check for Duplicate Template Definitions
- The error indicates that the template mail.AttachmentList is defined multiple times, likely due to the purchase module loading an additional definition of the same template.
- Action:
- Open your Odoo instance in Developer Mode.
- Search for the template mail.AttachmentList under Settings > Technical > Database Structure > Views.
- Check if there are duplicate records for the same template. If duplicates exist:
- Deactivate the duplicate template (if it belongs to a specific module, such as purchase).
- Ensure there is only one active mail.AttachmentList template.
3. Debugging the JavaScript Bundle
- The error specifically references the portal.assets_chatter.bundle.xml, which contains frontend resources for chatter functionality.
- Action:
- Verify the bundle loading:
- In Developer Mode, navigate to Settings > Technical > User Interface > Views.
- Search for portal.assets_chatter.bundle.
- Check the JavaScript/CSS code for duplicate references to mail.AttachmentList or similar templates.
4. Reinstall the Purchase Module
If no duplicates or misconfigurations are found, try uninstalling and reinstalling the purchase module:
./odoo-bin -c odoo.conf -u purchase
5. Modify the Template
If a conflicting template is from a specific module (e.g., purchase):
- Extend the View:
- Identify the conflicting template and modify it to resolve the issue:
<template id="mail.AttachmentList" inherit_id="module.template_id" priority="20">
<!-- Ensure unique definition -->
</template>
- Disable the Duplicate Template:
- If the duplicate template is unnecessary, you can deactivate it via the UI or by modifying the XML definition.
6. Check the Logs
Even though you mentioned no errors in Odoo logs, ensure verbose logging is enabled:
./odoo-bin -c odoo.conf --log-level=debug
Look for any clues related to portal.assets_chatter.bundle.xml or mail.AttachmentList.
7. Temporary Workaround
If you urgently need to use the Purchase module, you can temporarily remove the chatter functionality from the conflicting views:
- Navigate to Settings > Technical > User Interface > Views.
- Search for and edit the product page view or any page that includes chatter.
- Remove or comment out the chatter section temporarily:
<xpath expr="//div[@class='o_chatter']" position="replace"/>
8. Report the Issue
If the above solutions don’t resolve the problem, report the issue to Odoo via their official support channels or community forums:
- Provide details of the error, Odoo version, and steps to reproduce the problem.
- If this is a bug in the Odoo purchase module for version 18, they may provide a patch.
Summary
The error likely stems from a duplicate or conflicting definition of the mail.AttachmentList template in the purchase module or its dependencies. Clearing the cache, resolving duplicate templates, and regenerating assets should resolve the issue. For a more permanent solution, fixing the template conflict directly in the module or reporting the issue to Odoo support may be necessary.
Let me know if you need further guidance!