[MIG] account_journal_lock_date: Migration to 11.0

This commit is contained in:
MMI
2019-07-01 16:37:25 +02:00
parent 4927ab0902
commit d2f9f987f0
19 changed files with 22 additions and 40 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).
@@ -6,16 +5,14 @@
'name': 'Account Journal Lock Date',
'summary': """
Lock each journal independently""",
'version': '10.0.1.0.0',
'version': '11.0.1.0.0',
'license': 'AGPL-3',
'author': 'ACSONE SA/NV,Odoo Community Association (OCA)',
'website': 'https://acsone.eu/',
'website': 'https://github.com/OCA/account-financial-tools',
'depends': [
'account_permanent_lock_move',
],
'data': [
'views/account_journal.xml',
],
'demo': [
],
}

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).

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).

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).

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).
@@ -29,8 +28,11 @@ class TestJournalLockDate(common.TransactionCase):
self.journal = self.browse_ref("account.bank_journal")
def test_journal_lock_date(self):
# remove the user from all groups
self.env.user.write({'groups_id': [(5, False, False)]})
# add the user to group account user
self.env.user.write({
'groups_id': [(3, self.ref('account.group_account_manager'))],
'groups_id': [(4, self.ref('account.group_account_user'), False)],
})
self.assertFalse(self.env.user.has_group(
'account.group_account_manager'))

View File

@@ -3,8 +3,6 @@
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>
<data>
<record model="ir.ui.view" id="account_journal_form_view">
<field name="name">account.journal.form (in account_journal_lock_date)</field>
<field name="model">account.journal</field>
@@ -27,7 +25,4 @@
</field>
</field>
</record>
</data>
</odoo>

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from . import models
from . import wizard

View File

@@ -1,12 +1,11 @@
# -*- coding: utf-8 -*-
# © 2016 Camptocamp SA (Matthieu Dietrich)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Permanent Lock Move",
"version": "10.0.1.0.0",
"version": "11.0.1.0.0",
"depends": ["account"],
"author": "Camptocamp,Odoo Community Association (OCA)",
"website": "http://www.camptocamp.com/",
"website": 'https://github.com/OCA/account-financial-tools',
"category": "Finance",
"data": [
"views/res_config_view.xml",

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from . import account_move
from . import company

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# © 2016 Camptocamp SA (Matthieu Dietrich)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import _, api, models
@@ -11,7 +10,8 @@ class AccountMove(models.Model):
@api.multi
def _check_lock_date(self):
for move in self:
if move.date <= move.company_id.permanent_lock_date:
if move.company_id.permanent_lock_date \
and move.date <= move.company_id.permanent_lock_date:
raise UserError(_(
"You cannot add/modify entries prior to and inclusive "
"of the permanent lock date."))

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# © 2016 Camptocamp SA (Matthieu Dietrich)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models

View File

@@ -1,11 +1,10 @@
# -*- coding: utf-8 -*-
# © 2016 Camptocamp SA (Matthieu Dietrich)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class AccountConfigSettings(models.TransientModel):
_inherit = 'account.config.settings'
_inherit = 'res.config.settings'
permanent_lock_date = fields.Date(
string="Permanent Lock Date",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# © 2016 Camptocamp SA (Matthieu Dietrich)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import test_permanent_lock

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# © 2016 Camptocamp SA (Matthieu Dietrich)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import datetime

View File

@@ -1,18 +1,18 @@
<odoo>
<record id="view_account_config_settings_permanent_lock" model="ir.ui.view">
<field name="name">account settings permanent lock</field>
<field name="model">account.config.settings</field>
<field name="inherit_id" ref="account.view_account_config_settings"/>
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="account.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='fiscalyear_lock_date']/parent::div" position="after">
<div>
<label for="permanent_lock_date"/>
<field name="permanent_lock_date" readonly="1"/>
</div>
<div id="fiscalyear" position="attributes">
<attribute name="invisible">0</attribute>
</div>
<div id="fiscalyear" position="inside">
<label for="permanent_lock_date"/>
<field name="permanent_lock_date" readonly="1"/>
<div>
<button type="object" name="change_permanent_lock_date" string="Permanently Lock Entries" class="btn-primary"/>
</div>
</xpath>
</div>
</field>
</record>
</odoo>

View File

@@ -1,3 +1,2 @@
# -*- coding: utf-8 -*-
from . import permanent_lock_date_wizard

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# © 2016 Camptocamp SA (Matthieu Dietrich)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import _, api, fields, models

View File

@@ -1,5 +1,5 @@
<odoo>
<record id="permanent_lock_date_wizard_form" model="ir.ui.view">
<record id="permanent_lock_date_wizard_view_form" model="ir.ui.view">
<field name="name">permanent.lock.date.wizard.form</field>
<field name="model">permanent.lock.date.wizard</field>
<field name="type">form</field>