[IMP] account_journal_lock_date: black, isort, prettier
This commit is contained in:
parent
aec4ed94fe
commit
72086957e1
@ -2,20 +2,17 @@
|
|||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
{
|
{
|
||||||
'name': 'Account Journal Lock Date',
|
"name": "Account Journal Lock Date",
|
||||||
'summary': """
|
"summary": """
|
||||||
Lock each journal independently""",
|
Lock each journal independently""",
|
||||||
'version': '12.0.2.0.0',
|
"version": "12.0.2.0.0",
|
||||||
'license': 'AGPL-3',
|
"license": "AGPL-3",
|
||||||
'author': 'ACSONE SA/NV,Odoo Community Association (OCA)',
|
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
|
||||||
'website': 'https://github.com/OCA/account-financial-tools',
|
"website": "https://github.com/OCA/account-financial-tools",
|
||||||
'depends': [
|
"depends": ["account",],
|
||||||
'account',
|
"data": [
|
||||||
],
|
"views/account_journal.xml",
|
||||||
'data': [
|
"wizards/update_journal_lock_dates_views.xml",
|
||||||
'views/account_journal.xml',
|
|
||||||
'wizards/update_journal_lock_dates_views.xml',
|
|
||||||
],
|
|
||||||
'demo': [
|
|
||||||
],
|
],
|
||||||
|
"demo": [],
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
# Copyright 2017 ACSONE SA/NV
|
# Copyright 2017 ACSONE SA/NV
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
|
@ -6,18 +6,18 @@ from odoo import fields, models
|
|||||||
|
|
||||||
class AccountJournal(models.Model):
|
class AccountJournal(models.Model):
|
||||||
|
|
||||||
_inherit = 'account.journal'
|
_inherit = "account.journal"
|
||||||
|
|
||||||
fiscalyear_lock_date = fields.Date(
|
fiscalyear_lock_date = fields.Date(
|
||||||
string="Lock Date",
|
string="Lock Date",
|
||||||
help="No users, including Advisers, can edit accounts prior "
|
help="No users, including Advisers, can edit accounts prior "
|
||||||
"to and inclusive of this date for this journal. Use it "
|
"to and inclusive of this date for this journal. Use it "
|
||||||
"for fiscal year locking for this journal, for example."
|
"for fiscal year locking for this journal, for example.",
|
||||||
)
|
)
|
||||||
period_lock_date = fields.Date(
|
period_lock_date = fields.Date(
|
||||||
string="Lock Date for Non-Advisers",
|
string="Lock Date for Non-Advisers",
|
||||||
help="Only users with the 'Adviser' role can edit accounts "
|
help="Only users with the 'Adviser' role can edit accounts "
|
||||||
"prior to and inclusive of this date for this journal. "
|
"prior to and inclusive of this date for this journal. "
|
||||||
"Use it for period locking inside an open fiscal year "
|
"Use it for period locking inside an open fiscal year "
|
||||||
"for this journal, for example."
|
"for this journal, for example.",
|
||||||
)
|
)
|
||||||
|
@ -2,14 +2,15 @@
|
|||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
from datetime import date
|
from datetime import date
|
||||||
from odoo import api, models, _
|
|
||||||
|
from odoo import _, api, models
|
||||||
|
|
||||||
from ..exceptions import JournalLockDateError
|
from ..exceptions import JournalLockDateError
|
||||||
|
|
||||||
|
|
||||||
class AccountMove(models.Model):
|
class AccountMove(models.Model):
|
||||||
|
|
||||||
_inherit = 'account.move'
|
_inherit = "account.move"
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def create(self, values):
|
def create(self, values):
|
||||||
@ -29,7 +30,7 @@ class AccountMove(models.Model):
|
|||||||
if self.env.context.get("bypass_journal_lock_date"):
|
if self.env.context.get("bypass_journal_lock_date"):
|
||||||
return res
|
return res
|
||||||
for move in self:
|
for move in self:
|
||||||
if self.user_has_groups('account.group_account_manager'):
|
if self.user_has_groups("account.group_account_manager"):
|
||||||
lock_date = move.journal_id.fiscalyear_lock_date or date.min
|
lock_date = move.journal_id.fiscalyear_lock_date or date.min
|
||||||
else:
|
else:
|
||||||
lock_date = max(
|
lock_date = max(
|
||||||
@ -37,7 +38,7 @@ class AccountMove(models.Model):
|
|||||||
move.journal_id.fiscalyear_lock_date or date.min,
|
move.journal_id.fiscalyear_lock_date or date.min,
|
||||||
)
|
)
|
||||||
if move.date <= lock_date:
|
if move.date <= lock_date:
|
||||||
if self.user_has_groups('account.group_account_manager'):
|
if self.user_has_groups("account.group_account_manager"):
|
||||||
message = _(
|
message = _(
|
||||||
"You cannot add/modify entries for the journal '%s' "
|
"You cannot add/modify entries for the journal '%s' "
|
||||||
"prior to and inclusive of the lock date %s"
|
"prior to and inclusive of the lock date %s"
|
||||||
|
@ -11,67 +11,95 @@ from ..exceptions import JournalLockDateError
|
|||||||
|
|
||||||
|
|
||||||
class TestJournalLockDate(common.TransactionCase):
|
class TestJournalLockDate(common.TransactionCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestJournalLockDate, self).setUp()
|
super(TestJournalLockDate, self).setUp()
|
||||||
tools.convert_file(self.cr, 'account',
|
tools.convert_file(
|
||||||
get_module_resource('account', 'test',
|
self.cr,
|
||||||
'account_minimal_test.xml'),
|
"account",
|
||||||
{}, 'init', False, 'test')
|
get_module_resource("account", "test", "account_minimal_test.xml"),
|
||||||
|
{},
|
||||||
|
"init",
|
||||||
|
False,
|
||||||
|
"test",
|
||||||
|
)
|
||||||
self.account_move_obj = self.env["account.move"]
|
self.account_move_obj = self.env["account.move"]
|
||||||
self.account_move_line_obj = \
|
self.account_move_line_obj = self.env["account.move.line"]
|
||||||
self.env["account.move.line"]
|
self.company_id = self.ref("base.main_company")
|
||||||
self.company_id = self.ref('base.main_company')
|
|
||||||
self.partner = self.browse_ref("base.res_partner_12")
|
self.partner = self.browse_ref("base.res_partner_12")
|
||||||
self.account = self.browse_ref("account.a_recv")
|
self.account = self.browse_ref("account.a_recv")
|
||||||
self.account2 = self.browse_ref("account.a_expense")
|
self.account2 = self.browse_ref("account.a_expense")
|
||||||
self.journal = self.browse_ref("account.bank_journal")
|
self.journal = self.browse_ref("account.bank_journal")
|
||||||
|
|
||||||
def test_journal_lock_date(self):
|
def test_journal_lock_date(self):
|
||||||
self.env.user.write({
|
self.env.user.write(
|
||||||
'groups_id': [(3, self.ref('base.group_system'))],
|
{"groups_id": [(3, self.ref("base.group_system"))],}
|
||||||
})
|
)
|
||||||
self.env.user.write({
|
self.env.user.write(
|
||||||
'groups_id': [(3, self.ref('account.group_account_manager'))],
|
{"groups_id": [(3, self.ref("account.group_account_manager"))],}
|
||||||
})
|
)
|
||||||
self.assertFalse(self.env.user.has_group(
|
self.assertFalse(self.env.user.has_group("account.group_account_manager"))
|
||||||
'account.group_account_manager'))
|
|
||||||
|
|
||||||
# create a move and post it
|
# create a move and post it
|
||||||
move = self.account_move_obj.create({
|
move = self.account_move_obj.create(
|
||||||
'date': date.today(),
|
{
|
||||||
'journal_id': self.journal.id,
|
"date": date.today(),
|
||||||
'line_ids': [(0, 0, {
|
"journal_id": self.journal.id,
|
||||||
'account_id': self.account.id,
|
"line_ids": [
|
||||||
'credit': 1000.0,
|
(
|
||||||
'name': 'Credit line',
|
0,
|
||||||
}), (0, 0, {
|
0,
|
||||||
'account_id': self.account2.id,
|
{
|
||||||
'debit': 1000.0,
|
"account_id": self.account.id,
|
||||||
'name': 'Debit line',
|
"credit": 1000.0,
|
||||||
})]
|
"name": "Credit line",
|
||||||
})
|
},
|
||||||
|
),
|
||||||
|
(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
{
|
||||||
|
"account_id": self.account2.id,
|
||||||
|
"debit": 1000.0,
|
||||||
|
"name": "Debit line",
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
}
|
||||||
|
)
|
||||||
move.post()
|
move.post()
|
||||||
# lock journal, set 'Lock Date for Non-Advisers'
|
# lock journal, set 'Lock Date for Non-Advisers'
|
||||||
self.journal.period_lock_date = (date.today() + timedelta(days=2))
|
self.journal.period_lock_date = date.today() + timedelta(days=2)
|
||||||
# Test that the move cannot be created, written, or cancelled
|
# Test that the move cannot be created, written, or cancelled
|
||||||
with self.assertRaises(JournalLockDateError):
|
with self.assertRaises(JournalLockDateError):
|
||||||
self.account_move_obj.create({
|
self.account_move_obj.create(
|
||||||
'date': date.today(),
|
{
|
||||||
'journal_id': self.journal.id,
|
"date": date.today(),
|
||||||
'line_ids': [(0, 0, {
|
"journal_id": self.journal.id,
|
||||||
'account_id': self.account.id,
|
"line_ids": [
|
||||||
'credit': 1000.0,
|
(
|
||||||
'name': 'Credit line',
|
0,
|
||||||
}), (0, 0, {
|
0,
|
||||||
'account_id': self.account2.id,
|
{
|
||||||
'debit': 1000.0,
|
"account_id": self.account.id,
|
||||||
'name': 'Debit line',
|
"credit": 1000.0,
|
||||||
})]
|
"name": "Credit line",
|
||||||
})
|
},
|
||||||
|
),
|
||||||
|
(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
{
|
||||||
|
"account_id": self.account2.id,
|
||||||
|
"debit": 1000.0,
|
||||||
|
"name": "Debit line",
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
with self.assertRaises(JournalLockDateError):
|
with self.assertRaises(JournalLockDateError):
|
||||||
move.write({'name': 'TEST'})
|
move.write({"name": "TEST"})
|
||||||
|
|
||||||
# allow cancel posted move
|
# allow cancel posted move
|
||||||
self.journal.update_posted = True
|
self.journal.update_posted = True
|
||||||
@ -79,42 +107,67 @@ class TestJournalLockDate(common.TransactionCase):
|
|||||||
move.button_cancel()
|
move.button_cancel()
|
||||||
|
|
||||||
# create a move after the 'Lock Date for Non-Advisers' and post it
|
# create a move after the 'Lock Date for Non-Advisers' and post it
|
||||||
move3 = self.account_move_obj.create({
|
move3 = self.account_move_obj.create(
|
||||||
'date': self.journal.period_lock_date + timedelta(days=3),
|
{
|
||||||
'journal_id': self.journal.id,
|
"date": self.journal.period_lock_date + timedelta(days=3),
|
||||||
'line_ids': [(0, 0, {
|
"journal_id": self.journal.id,
|
||||||
'account_id': self.account.id,
|
"line_ids": [
|
||||||
'credit': 1000.0,
|
(
|
||||||
'name': 'Credit line',
|
0,
|
||||||
}), (0, 0, {
|
0,
|
||||||
'account_id': self.account2.id,
|
{
|
||||||
'debit': 1000.0,
|
"account_id": self.account.id,
|
||||||
'name': 'Debit line',
|
"credit": 1000.0,
|
||||||
})]
|
"name": "Credit line",
|
||||||
})
|
},
|
||||||
|
),
|
||||||
|
(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
{
|
||||||
|
"account_id": self.account2.id,
|
||||||
|
"debit": 1000.0,
|
||||||
|
"name": "Debit line",
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
}
|
||||||
|
)
|
||||||
move3.post()
|
move3.post()
|
||||||
|
|
||||||
def test_journal_lock_date_adviser(self):
|
def test_journal_lock_date_adviser(self):
|
||||||
""" The journal lock date is ignored for Advisers """
|
""" The journal lock date is ignored for Advisers """
|
||||||
self.env.user.write({
|
self.env.user.write(
|
||||||
'groups_id': [(4, self.ref('account.group_account_manager'))],
|
{"groups_id": [(4, self.ref("account.group_account_manager"))],}
|
||||||
})
|
)
|
||||||
self.assertTrue(self.env.user.has_group(
|
self.assertTrue(self.env.user.has_group("account.group_account_manager"))
|
||||||
'account.group_account_manager'))
|
|
||||||
# create a move and post it
|
# create a move and post it
|
||||||
move = self.account_move_obj.create({
|
move = self.account_move_obj.create(
|
||||||
'date': date.today(),
|
{
|
||||||
'journal_id': self.journal.id,
|
"date": date.today(),
|
||||||
'line_ids': [(0, 0, {
|
"journal_id": self.journal.id,
|
||||||
'account_id': self.account.id,
|
"line_ids": [
|
||||||
'credit': 1000.0,
|
(
|
||||||
'name': 'Credit line',
|
0,
|
||||||
}), (0, 0, {
|
0,
|
||||||
'account_id': self.account2.id,
|
{
|
||||||
'debit': 1000.0,
|
"account_id": self.account.id,
|
||||||
'name': 'Debit line',
|
"credit": 1000.0,
|
||||||
})]
|
"name": "Credit line",
|
||||||
})
|
},
|
||||||
|
),
|
||||||
|
(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
{
|
||||||
|
"account_id": self.account2.id,
|
||||||
|
"debit": 1000.0,
|
||||||
|
"name": "Debit line",
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
}
|
||||||
|
)
|
||||||
move.post()
|
move.post()
|
||||||
# lock journal. Set 'Lock Date'
|
# lock journal. Set 'Lock Date'
|
||||||
self.journal.fiscalyear_lock_date = date.today() + timedelta(days=2)
|
self.journal.fiscalyear_lock_date = date.today() + timedelta(days=2)
|
||||||
@ -122,21 +175,34 @@ class TestJournalLockDate(common.TransactionCase):
|
|||||||
self.journal.period_lock_date = date.today() + timedelta(days=4)
|
self.journal.period_lock_date = date.today() + timedelta(days=4)
|
||||||
# Advisers cannot create, write, or cancel moves before 'Lock Date'
|
# Advisers cannot create, write, or cancel moves before 'Lock Date'
|
||||||
with self.assertRaises(JournalLockDateError):
|
with self.assertRaises(JournalLockDateError):
|
||||||
self.account_move_obj.create({
|
self.account_move_obj.create(
|
||||||
'date': date.today(),
|
{
|
||||||
'journal_id': self.journal.id,
|
"date": date.today(),
|
||||||
'line_ids': [(0, 0, {
|
"journal_id": self.journal.id,
|
||||||
'account_id': self.account.id,
|
"line_ids": [
|
||||||
'credit': 1000.0,
|
(
|
||||||
'name': 'Credit line',
|
0,
|
||||||
}), (0, 0, {
|
0,
|
||||||
'account_id': self.account2.id,
|
{
|
||||||
'debit': 1000.0,
|
"account_id": self.account.id,
|
||||||
'name': 'Debit line',
|
"credit": 1000.0,
|
||||||
})]
|
"name": "Credit line",
|
||||||
})
|
},
|
||||||
|
),
|
||||||
|
(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
{
|
||||||
|
"account_id": self.account2.id,
|
||||||
|
"debit": 1000.0,
|
||||||
|
"name": "Debit line",
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
}
|
||||||
|
)
|
||||||
with self.assertRaises(JournalLockDateError):
|
with self.assertRaises(JournalLockDateError):
|
||||||
move.write({'name': 'TEST'})
|
move.write({"name": "TEST"})
|
||||||
# allow cancel posted move
|
# allow cancel posted move
|
||||||
self.journal.update_posted = True
|
self.journal.update_posted = True
|
||||||
with self.assertRaises(JournalLockDateError):
|
with self.assertRaises(JournalLockDateError):
|
||||||
@ -144,17 +210,30 @@ class TestJournalLockDate(common.TransactionCase):
|
|||||||
# Advisers can create movements on a date after the 'Lock Date'
|
# Advisers can create movements on a date after the 'Lock Date'
|
||||||
# even if that date is before and inclusive of
|
# even if that date is before and inclusive of
|
||||||
# the 'Lock Date for Non-Advisers' (self.journal.period_lock_date)
|
# the 'Lock Date for Non-Advisers' (self.journal.period_lock_date)
|
||||||
move3 = self.account_move_obj.create({
|
move3 = self.account_move_obj.create(
|
||||||
'date': self.journal.period_lock_date,
|
{
|
||||||
'journal_id': self.journal.id,
|
"date": self.journal.period_lock_date,
|
||||||
'line_ids': [(0, 0, {
|
"journal_id": self.journal.id,
|
||||||
'account_id': self.account.id,
|
"line_ids": [
|
||||||
'credit': 1000.0,
|
(
|
||||||
'name': 'Credit line',
|
0,
|
||||||
}), (0, 0, {
|
0,
|
||||||
'account_id': self.account2.id,
|
{
|
||||||
'debit': 1000.0,
|
"account_id": self.account.id,
|
||||||
'name': 'Debit line',
|
"credit": 1000.0,
|
||||||
})]
|
"name": "Credit line",
|
||||||
})
|
},
|
||||||
|
),
|
||||||
|
(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
{
|
||||||
|
"account_id": self.account2.id,
|
||||||
|
"debit": 1000.0,
|
||||||
|
"name": "Debit line",
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
}
|
||||||
|
)
|
||||||
move3.post()
|
move3.post()
|
||||||
|
@ -1,35 +1,33 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<!-- Copyright 2017 ACSONE SA/NV
|
<!-- Copyright 2017 ACSONE SA/NV
|
||||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
|
||||||
|
|
||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
|
<record model="ir.ui.view" id="account_journal_form_view">
|
||||||
<record model="ir.ui.view" id="account_journal_form_view">
|
<field
|
||||||
<field name="name">account.journal.form (in account_journal_lock_date)</field>
|
name="name"
|
||||||
<field name="model">account.journal</field>
|
>account.journal.form (in account_journal_lock_date)</field>
|
||||||
<field name="inherit_id" ref="account.view_account_journal_form"/>
|
<field name="model">account.journal</field>
|
||||||
<field name="arch" type="xml">
|
<field name="inherit_id" ref="account.view_account_journal_form" />
|
||||||
<field name="account_control_ids" position="after">
|
<field name="arch" type="xml">
|
||||||
<field name="fiscalyear_lock_date"/>
|
<field name="account_control_ids" position="after">
|
||||||
<field name="period_lock_date"/>
|
<field name="fiscalyear_lock_date" />
|
||||||
|
<field name="period_lock_date" />
|
||||||
|
</field>
|
||||||
</field>
|
</field>
|
||||||
</field>
|
</record>
|
||||||
</record>
|
<record model="ir.ui.view" id="account_journal_tree_view">
|
||||||
|
<field
|
||||||
|
name="name"
|
||||||
<record model="ir.ui.view" id="account_journal_tree_view">
|
>account.journal.tree (in account_journal_lock_date)</field>
|
||||||
<field name="name">account.journal.tree (in account_journal_lock_date)</field>
|
<field name="model">account.journal</field>
|
||||||
<field name="model">account.journal</field>
|
<field name="inherit_id" ref="account.view_account_journal_tree" />
|
||||||
<field name="inherit_id" ref="account.view_account_journal_tree"/>
|
<field name="arch" type="xml">
|
||||||
<field name="arch" type="xml">
|
<field name="type" position="after">
|
||||||
<field name="type" position="after">
|
<field name="fiscalyear_lock_date" />
|
||||||
<field name="fiscalyear_lock_date"/>
|
<field name="period_lock_date" />
|
||||||
<field name="period_lock_date"/>
|
</field>
|
||||||
</field>
|
</field>
|
||||||
</field>
|
</record>
|
||||||
</record>
|
</data>
|
||||||
|
|
||||||
|
|
||||||
</data>
|
|
||||||
</odoo>
|
</odoo>
|
||||||
|
@ -1,30 +1,29 @@
|
|||||||
# Copyright 2020 Tecnativa - Ernesto Tejeda
|
# Copyright 2020 Tecnativa - Ernesto Tejeda
|
||||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
from odoo import _, fields, models, SUPERUSER_ID
|
from odoo import SUPERUSER_ID, _, fields, models
|
||||||
from odoo.exceptions import UserError
|
from odoo.exceptions import UserError
|
||||||
|
|
||||||
|
|
||||||
class UpdateJournalLockDatesWizard(models.TransientModel):
|
class UpdateJournalLockDatesWizard(models.TransientModel):
|
||||||
_name = 'update.journal.lock.dates.wizard'
|
_name = "update.journal.lock.dates.wizard"
|
||||||
_description = 'Mass Update Journal Lock Dates Wizard'
|
_description = "Mass Update Journal Lock Dates Wizard"
|
||||||
|
|
||||||
period_lock_date = fields.Date(string="Lock Date for Non-Advisers")
|
period_lock_date = fields.Date(string="Lock Date for Non-Advisers")
|
||||||
fiscalyear_lock_date = fields.Date(string="Lock Date")
|
fiscalyear_lock_date = fields.Date(string="Lock Date")
|
||||||
|
|
||||||
def _check_execute_allowed(self):
|
def _check_execute_allowed(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
has_adviser_group = self.env.user.has_group(
|
has_adviser_group = self.env.user.has_group("account.group_account_manager")
|
||||||
'account.group_account_manager')
|
|
||||||
if not (has_adviser_group or self.env.uid == SUPERUSER_ID):
|
if not (has_adviser_group or self.env.uid == SUPERUSER_ID):
|
||||||
raise UserError(_("You are not allowed to execute this action."))
|
raise UserError(_("You are not allowed to execute this action."))
|
||||||
|
|
||||||
def action_update_lock_dates(self):
|
def action_update_lock_dates(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
self._check_execute_allowed()
|
self._check_execute_allowed()
|
||||||
self.env['account.journal'].browse(
|
self.env["account.journal"].browse(self.env.context.get("active_ids")).write(
|
||||||
self.env.context.get('active_ids')
|
{
|
||||||
).write({
|
"period_lock_date": self.period_lock_date,
|
||||||
'period_lock_date': self.period_lock_date,
|
"fiscalyear_lock_date": self.fiscalyear_lock_date,
|
||||||
'fiscalyear_lock_date': self.fiscalyear_lock_date,
|
}
|
||||||
})
|
)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<!-- Copyright 2020 Tecnativa - Ernesto Tejeda
|
<!-- Copyright 2020 Tecnativa - Ernesto Tejeda
|
||||||
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
||||||
<odoo>
|
<odoo>
|
||||||
@ -9,31 +9,33 @@
|
|||||||
<form>
|
<form>
|
||||||
<group>
|
<group>
|
||||||
<group>
|
<group>
|
||||||
<field name="fiscalyear_lock_date"/>
|
<field name="fiscalyear_lock_date" />
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
<field name="period_lock_date"/>
|
<field name="period_lock_date" />
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<footer>
|
<footer>
|
||||||
<button name="action_update_lock_dates"
|
<button
|
||||||
string="Update"
|
name="action_update_lock_dates"
|
||||||
type="object"
|
string="Update"
|
||||||
class="btn-primary"/>
|
type="object"
|
||||||
<button string="Cancel"
|
class="btn-primary"
|
||||||
class="btn-secondary"
|
/>
|
||||||
special="cancel" />
|
<button string="Cancel" class="btn-secondary" special="cancel" />
|
||||||
</footer>
|
</footer>
|
||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
<act_window id="update_journal_lock_dates_wizard_action"
|
<act_window
|
||||||
name="Update journals lock dates"
|
id="update_journal_lock_dates_wizard_action"
|
||||||
src_model="account.journal"
|
name="Update journals lock dates"
|
||||||
res_model="update.journal.lock.dates.wizard"
|
src_model="account.journal"
|
||||||
view_type="form"
|
res_model="update.journal.lock.dates.wizard"
|
||||||
view_mode="form"
|
view_type="form"
|
||||||
key2="client_action_multi"
|
view_mode="form"
|
||||||
target="new"
|
key2="client_action_multi"
|
||||||
multi="True"/>
|
target="new"
|
||||||
|
multi="True"
|
||||||
|
/>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user