This repository contains example Odoo addons.
base_plugin: Minimal plugin demonstrating the basic structure of an Odoo module.social_marketing: Example plugin for managing social media accounts and posts with scheduling, workflow validation, automatic cron publishing, and basic tracking.account_anomaly: Simple addon for flagging unusual accounting moves.project_prince2: Manage projects following the PRINCE2 methodology.l10n_be_fiscal_full: Starter module for Belgian fiscal declarations.l10n_lu_fiscal_full: Starter module for Luxembourg fiscal declarations.- Make sure the scheduled action defined in
social_marketing/data/scheduled_actions.xmlis enabled so scheduled posts are processed automatically. You can enable it from Settings → Technical → Automation → Scheduled Actions and look for the action with XML IDsocial_marketing.ir_cron_social_post.
For detailed installation and usage instructions, see the user manual.
- Copy the addon directories (e.g.
base_plugin,social_marketing,account_anomaly,project_prince2) into your Odooaddons_path. - Update the Apps list inside Odoo.
- Install the desired addon from the Apps menu.
These addons require Odoo 16 for compatibility. See social_marketing/__manifest__.py and account_anomaly/__manifest__.py for additional module metadata.
The social_marketing addon includes a simple but safer workflow:
- draft posts can be scheduled only when a scheduled date is set;
- scheduled posts are automatically published by the cron when their date is reached;
- cancelled posts cannot be published;
- published posts cannot be cancelled or scheduled again;
- access rights are limited to internal users through
base.group_user.
For production use, connect action_publish() to a dedicated social network connector/service before marking external posts as published.
-
Install the test requirements:
pip install -r requirements.txt
-
Execute the tests using
pytest:pytest
The conftest.py file provides mocked versions of odoo.models,
odoo.fields and related modules. This fake Odoo environment allows the addons
to be imported and tested without requiring a real Odoo server. Tests execute
entirely within this simulated setup.
It also defines simple stub models like ResPartnerBank used during testing.
Developers can enhance the stub Odoo environment by editing
conftest.py. New field classes or API decorators can be added
to emulate additional framework features that your addons rely on. Extend the
_Field base class to create new field types or introduce new decorators under
odoo.api as needed.
Example: adding a floating‑point field and a simple decorator::
class Float(_Field):
pass
fields_mod.Float = Float
def compute(func):
func._compute = True
return func
api_mod.compute = compute
After modifying the stub, run pytest locally to ensure the addons and tests
still behave correctly with the new behavior.
This project is licensed under the MIT License.