mirror of
https://github.com/OCA/bank-statement-import.git
synced 2025-01-20 12:37:43 +02:00
80 bank statement import enforce sequence (#67)
* enforce journal sequence for statement naming policy * [8.0] enforce journal sequence for statement naming policy * short headers + update view
This commit is contained in:
committed by
Stefan Rijnhart (Opener)
parent
f1900c6a33
commit
37bd21da20
@@ -38,6 +38,7 @@ Contributors
|
|||||||
* Alexis de Lattre <alexis@via.ecp.fr>
|
* Alexis de Lattre <alexis@via.ecp.fr>
|
||||||
* Laurent Mignon <laurent.mignon@acsone.eu>
|
* Laurent Mignon <laurent.mignon@acsone.eu>
|
||||||
* Ronald Portier <rportier@therp.nl>
|
* Ronald Portier <rportier@therp.nl>
|
||||||
|
* Luc De Meyer <luc.demeyer@noviat.com>
|
||||||
|
|
||||||
Maintainer
|
Maintainer
|
||||||
----------
|
----------
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
{
|
{
|
||||||
'name': 'Account Bank Statement Import',
|
'name': 'Account Bank Statement Import',
|
||||||
'category': 'Banking addons',
|
'category': 'Banking addons',
|
||||||
'version': '8.0.1.0.2',
|
'version': '8.0.1.1.0',
|
||||||
'license': 'AGPL-3',
|
'license': 'AGPL-3',
|
||||||
'author': 'OpenERP SA,'
|
'author': 'OpenERP SA,'
|
||||||
'Odoo Community Association (OCA)',
|
'Odoo Community Association (OCA)',
|
||||||
@@ -11,6 +11,7 @@
|
|||||||
'data': [
|
'data': [
|
||||||
'views/account_config_settings.xml',
|
'views/account_config_settings.xml',
|
||||||
'views/account_bank_statement_import_view.xml',
|
'views/account_bank_statement_import_view.xml',
|
||||||
|
'views/account_journal.xml',
|
||||||
],
|
],
|
||||||
'demo': [
|
'demo': [
|
||||||
'demo/fiscalyear_period.xml',
|
'demo/fiscalyear_period.xml',
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from . import res_partner_bank
|
from . import res_partner_bank
|
||||||
|
from . import account_bank_statement
|
||||||
from . import account_bank_statement_import
|
from . import account_bank_statement_import
|
||||||
from . import account_config_settings
|
from . import account_config_settings
|
||||||
|
from . import account_journal
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright 2009-2016 Noviat
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
from openerp import api, models
|
||||||
|
|
||||||
|
|
||||||
|
class AccountBankStatement(models.Model):
|
||||||
|
_inherit = 'account.bank.statement'
|
||||||
|
|
||||||
|
@api.model
|
||||||
|
def create(self, vals):
|
||||||
|
if vals.get('name'):
|
||||||
|
journal = self.env['account.journal'].browse(
|
||||||
|
vals.get('journal_id'))
|
||||||
|
if journal.enforce_sequence:
|
||||||
|
vals['name'] = '/'
|
||||||
|
return super(AccountBankStatement, self).create(vals)
|
||||||
14
account_bank_statement_import/models/account_journal.py
Normal file
14
account_bank_statement_import/models/account_journal.py
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
# Copyright 2009-2016 Noviat
|
||||||
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
from openerp import models, fields
|
||||||
|
|
||||||
|
|
||||||
|
class account_journal(models.Model):
|
||||||
|
_inherit = 'account.journal'
|
||||||
|
|
||||||
|
enforce_sequence = fields.Boolean(
|
||||||
|
string="Enforce Sequence",
|
||||||
|
help="If checked, the Journal Sequence will determine "
|
||||||
|
"the statement naming policy even if the name is already "
|
||||||
|
"set manually or by the statement import software.")
|
||||||
17
account_bank_statement_import/views/account_journal.xml
Normal file
17
account_bank_statement_import/views/account_journal.xml
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<openerp>
|
||||||
|
<data>
|
||||||
|
|
||||||
|
<record id="view_account_journal_form" model="ir.ui.view">
|
||||||
|
<field name="name">account.journal.enforce_sequence</field>
|
||||||
|
<field name="model">account.journal</field>
|
||||||
|
<field name="inherit_id" ref="account.view_account_journal_form"/>
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="sequence_id" position="after">
|
||||||
|
<field name="enforce_sequence" attrs="{'invisible': [('type', '!=', 'bank')]}"/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
</data>
|
||||||
|
</openerp>
|
||||||
Reference in New Issue
Block a user