If you have Odoo source code in somewhere outside environment path and want PyCharm to recognize it, you can add Odoo source code to the project structure of PyCharm.
- Open File - Settings.
- In the sidebar, go to Project - Project Structure.
- Click Add Content Root button.
- Then browse and select the Odoo source code directory.
- After the Odoo source code directory added to project structure, click OK to save and close the setting window.
- Then PyCharm will index your Odoo source code and resolve the reference to Odoo.
Before add Odoo to project structure:
After add Odoo to project structure:
Hope this answer your question.