Skip to content
Permalink
Browse files

constraint on auto_post

  • Loading branch information...
william-andre committed Apr 10, 2019
1 parent ce24d79 commit 8478d14aef32e64b4a251f6cabee1996eb07a1a4
Showing with 3 additions and 0 deletions.
  1. +3 −0 addons/account/models/account_move.py
@@ -333,6 +333,9 @@ def post(self):
# Create the analytic lines in batch is faster as it leads to less cache invalidation.
self.mapped('line_ids').create_analytic_lines()
for move in self:
if move.auto_post and move.date > fields.Date.today():
raise UserError(_("This move is configured to be auto-posted. If you are sure you want to post it, please untick the checkbox."))

if move.name == '/':
new_name = False
journal = move.journal_id

0 comments on commit 8478d14

Please sign in to comment.
You can’t perform that action at this time.