[MIG] account_journal_lock_date: Migration to 11.0

This commit is contained in:
MMI
2019-07-01 16:37:25 +02:00
committed by houssine
parent 73fcefb481
commit 0b01274fab
13 changed files with 16 additions and 25 deletions

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>