mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[FIX] _check_lock_date in account_lock_to_date
if move.company_id.period_lock_to_date or move.company_id.fiscalyear_lock_to_date are not set nothing should be done.
This commit is contained in:
@@ -12,11 +12,11 @@ class AccountMove(models.Model):
|
||||
res = super()._check_lock_date()
|
||||
for move in self:
|
||||
lock_to_date = min(
|
||||
move.company_id.period_lock_to_date or '0000-00-00',
|
||||
move.company_id.fiscalyear_lock_to_date or '0000-00-00')
|
||||
move.company_id.period_lock_to_date,
|
||||
move.company_id.fiscalyear_lock_to_date) or False
|
||||
if self.user_has_groups('account.group_account_manager'):
|
||||
lock_to_date = move.company_id.fiscalyear_lock_to_date
|
||||
if lock_to_date and move.date >= (lock_to_date or '0000-00-00'):
|
||||
lock_to_date = move.company_id.fiscalyear_lock_to_date or False
|
||||
if lock_to_date and move.date >= lock_to_date:
|
||||
if self.user_has_groups('account.group_account_manager'):
|
||||
message = _("You cannot add/modify entries after and "
|
||||
"inclusive of the lock to date %s") % (
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="generator" content="Docutils 0.14: http://docutils.sourceforge.net/" />
|
||||
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
|
||||
<title>Account Lock To Date</title>
|
||||
<style type="text/css">
|
||||
|
||||
|
||||
Reference in New Issue
Block a user