[MIG] - account_journal_lock_date migration to 12.0

This commit is contained in:
sbejaoui
2019-05-24 17:09:51 +02:00
committed by Zar21
parent c5da082649
commit 4bb9f2f493
9 changed files with 546 additions and 36 deletions

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2017 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
@@ -11,6 +10,19 @@ class AccountMove(models.Model):
_inherit = 'account.move'
@api.model
def create(self, values):
move = super().create(values)
move._check_lock_date()
return move
@api.multi
def write(self, values):
self._check_lock_date()
res = super().write(values)
self._check_lock_date()
return res
@api.multi
def _check_lock_date(self):
res = super(AccountMove, self)._check_lock_date()