Availability |
Odoo Online
Odoo.sh
On Premise
|
Odoo Apps Dependencies |
•
Invoicing (account)
• Discuss (mail) |
Lines of code | 36 |
Technical Name |
mass_move_to_draft |
License | LGPL-3 |
Mass Account Move Actions
Batch Post / Unpost journal entries with ready-to-use Server Actions for accountants.
Key Highlights
Two Server Actions
Set to Draft & Post Entries appear in the Actions menu on Journal Entries.
Batch-safe Logic
Checks state per record before calling button_draft()
or action_post()
.
Python Helper Method
action_mass_move_to_draft()
for easy reuse in code/automations.
Permission-aware
Limit usage to trusted accounting groups (e.g., Account Managers).
Time Saver
Avoid opening entries one by one when auditing or correcting batches.
Clean Integration
Shipped XML in data/
, no extra models; depends only on account
.
Why it matters (Business impact)
- Save time: bulk switch states for many entries in one go.
- Lower risk: consistent behavior with per-record checks.
- Audit-friendly: enable temporary unposting for corrections then repost cleanly.
How it works
Extends account.move
with a helper and adds two Server Actions:
action_mass_move_to_draft(self)
:def action_mass_move_to_draft(self): for move in self: if move.state == 'posted': move.button_draft()
- Server Actions (Python code type) iterate over
records
and callbutton_draft()
oraction_post()
based on state. - XML is loaded via
data/server_actions.xml
in__manifest__.py
so actions show in UI.
Technical Information
- Model:
account.move
(inherit) - Methods:
action_mass_move_to_draft()
, usesbutton_draft
/action_post
- UI: Actions menu → Server Actions: “Set to Draft”, “Post Entries”
- Dependencies:
account
- Compatibility: Odoo 17 (CE/EE), Odoo.sh
- License: OPL-1
- Author: alaa samy — alaasamy.com
- Version: 17.0.1.0.0
Warnings & Notes
- Sensitive accounting action: affects official books — restrict access to trusted accountants.
- Reconciliation: unposting reconciled entries can fail or be unsafe; clear reconciliations first.
- Journals & lock dates: some journals/policies prevent unposting; review journal settings and lock dates.
- Related data: impacts analytic lines, taxes, bank statements; assess before running on real data.
- Odoo version: behavior of
button_draft()
/action_post()
may differ; verify on your version.
Security & Access
- Create a dedicated group (e.g.,
account.group_mass_post_unpost
) or reuseaccount.group_account_manager
. - Limit Server Actions visibility via
groups_id
in XML. - Optional: add a confirmation wizard and/or chatter logs for extra safety.
QA / Testing Steps
- Use staging/test DB first.
- Create 3–5 sample moves (draft, posted, reconciled, closed journal).
- Run Set to Draft on posted entries; note warnings/failures.
- Run Post Entries on draft entries; verify journal items/taxes.
- Check reconciliation effects after unposting.
- Review logs/chatter if enabled.
Practical Usage
From Accounting → Journal Entries: select multiple posted moves → Action → Set to Draft (if allowed). Similarly, select draft moves → Action → Post Entries to post in bulk.
Future Enhancements
- Confirmation wizard (reason, date/journal filters).
- Detailed audit log (who/when/which records).
- Smart exceptions & CSV report for failures.
- UI filters (company, journal, date range) before execution.
Files & Module Structure
models/account_move.py
→action_mass_move_to_draft
data/server_actions.xml
(orviews/server_actions.xml
) → Server Actions definitions__manifest__.py
→ include XML under'data'
'depends': ['account'], 'data': ['data/server_actions.xml'],
Operational Tips
- Backup before running on production.
- Test on a small selection first.
- Add chatter note or summary report post-run for traceability.
Changelog
- v17.0.1.0.0 — Initial release: batch post/unpost via Server Actions.
Screenshots


App Store Listing (English)
Copy the text below (no emojis). If you use it in __manifest__.py
, keep UTF-8 and avoid emojis.
وصف التطبيق (عربي)
انسخ النص أدناه. لو هتستخدمه داخل __manifest__.py
يفضَّل بدون إيموجيز ومع حفظ الملف UTF-8.
Support
Need help or have questions? Get in touch.
Visit
Please log in to comment on this module