Browse Source
[ADD] allow turning off automatic reconciliation during an import
pull/204/head
Holger Brunn
8 years ago
No known key found for this signature in database
GPG Key ID: 1C9760FECA3AE18
4 changed files with
25 additions and
2 deletions
-
account_bank_statement_import_auto_reconcile/README.rst
-
account_bank_statement_import_auto_reconcile/__openerp__.py
-
account_bank_statement_import_auto_reconcile/models/account_bank_statement_import.py
-
account_bank_statement_import_auto_reconcile/views/account_bank_statement_import.xml
|
|
@ -39,7 +39,6 @@ Known issues / Roadmap |
|
|
|
* AmountTransposedDigits (reconcile if only two digits are swapped. Dangerous and a special case of AmountDiffuse) |
|
|
|
* whatever else we can think of |
|
|
|
* add some helpers/examples for using the options field |
|
|
|
* allow to turn off automatic reconciliations during a specific import |
|
|
|
* allow to fiddle with the parameters of configured rules during a specific import |
|
|
|
|
|
|
|
Bug Tracker |
|
|
|
|
|
@ -14,6 +14,7 @@ |
|
|
|
'web_widget_one2many_tags', |
|
|
|
], |
|
|
|
"data": [ |
|
|
|
"views/account_bank_statement_import.xml", |
|
|
|
"views/account_journal.xml", |
|
|
|
"views/account_bank_statement_import_auto_reconcile_rule.xml", |
|
|
|
'security/ir.model.access.csv', |
|
|
|
|
|
@ -1,12 +1,14 @@ |
|
|
|
# -*- coding: utf-8 -*- |
|
|
|
# © 2017 Therp BV <http://therp.nl> |
|
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
|
|
|
from openerp import _, api, models |
|
|
|
from openerp import _, api, fields, models |
|
|
|
|
|
|
|
|
|
|
|
class AccountBankStatementImport(models.TransientModel): |
|
|
|
_inherit = 'account.bank.statement.import' |
|
|
|
|
|
|
|
auto_reconcile = fields.Boolean('Auto reconcile', default=True) |
|
|
|
|
|
|
|
@api.model |
|
|
|
def _create_bank_statement(self, stmt_vals): |
|
|
|
statement_id, notifications = super( |
|
|
@ -15,6 +17,12 @@ class AccountBankStatementImport(models.TransientModel): |
|
|
|
if not statement_id: |
|
|
|
return statement_id, notifications |
|
|
|
statement = self.env['account.bank.statement'].browse(statement_id) |
|
|
|
if ( |
|
|
|
not statement.journal_id |
|
|
|
.statement_import_auto_reconcile_rule_ids or |
|
|
|
not self.auto_reconcile |
|
|
|
): |
|
|
|
return statement_id, notifications |
|
|
|
reconcile_rules = statement.journal_id\ |
|
|
|
.statement_import_auto_reconcile_rule_ids.mapped( |
|
|
|
lambda x: self.env[x.rule_type].new({ |
|
|
|
|
|
@ -0,0 +1,15 @@ |
|
|
|
<?xml version="1.0" encoding="UTF-8"?> |
|
|
|
<openerp> |
|
|
|
<data> |
|
|
|
<record id="account_bank_statement_import_view" model="ir.ui.view"> |
|
|
|
<field name="model">account.bank.statement.import</field> |
|
|
|
<field name="inherit_id" ref="account_bank_statement_import.account_bank_statement_import_view" /> |
|
|
|
<field name="arch" type="xml"> |
|
|
|
<field name="journal_id" position="after"> |
|
|
|
<field name="auto_reconcile" attrs="{'invisible': [('hide_journal_field', '=', True)]}" class="oe_inline" /> |
|
|
|
<label for="auto_reconcile" /> |
|
|
|
</field> |
|
|
|
</field> |
|
|
|
</record> |
|
|
|
</data> |
|
|
|
</openerp> |