Skip to Content
Menu

Mass Move to Draft

by
Odoo
v 17.0 Third Party 1
Download for v 17.0 Deploy on Odoo.sh
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies Invoicing (account)
Discuss (mail)
Lines of code 36
Technical Name mass_move_to_draft
LicenseLGPL-3
You bought this module and need support? Click here!

Mass Account Move Actions

Batch Post / Unpost journal entries with ready-to-use Server Actions for accountants.

Odoo 17 CE & EE Lightweight License: OPL-1 Apps: Accounting Version: 17.0.1.0.0

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 call button_draft() or action_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(), uses button_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 reuse account.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

  1. Use staging/test DB first.
  2. Create 3–5 sample moves (draft, posted, reconciled, closed journal).
  3. Run Set to Draft on posted entries; note warnings/failures.
  4. Run Post Entries on draft entries; verify journal items/taxes.
  5. Check reconciliation effects after unposting.
  6. 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.pyaction_mass_move_to_draft
  • data/server_actions.xml (or views/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

Journal Entries - Actions menu
Server Actions definitions

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

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.
Please choose a rating from 1 to 5 for this module.