mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
Fix tests + behavior
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Author: Joel Grand-Guillaume
|
||||
# Copyright 2011-2012 Camptocamp SA
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from . import partner
|
||||
from . import statement
|
||||
@@ -1,87 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Author: Joel Grand-Guillaume
|
||||
# Copyright 2011-2012 Camptocamp SA
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
{
|
||||
'name': "Bank statement base completion",
|
||||
'version': '1.0.3',
|
||||
'author': "Camptocamp,Odoo Community Association (OCA)",
|
||||
'maintainer': 'Camptocamp',
|
||||
'category': 'Finance',
|
||||
'complexity': 'normal',
|
||||
'depends': ['account_statement_ext',
|
||||
'account_report_company'],
|
||||
'description': """
|
||||
The goal of this module is to improve the basic bank statement, help dealing
|
||||
with huge volume of reconciliation by providing basic rules to identify the
|
||||
partner of a bank statement line.
|
||||
Each bank statement profile can have its own rules to be applied according to
|
||||
a sequence order.
|
||||
|
||||
Some basic rules are provided in this module:
|
||||
|
||||
1) Match from statement line label (based on partner field 'Bank Statement
|
||||
Label')
|
||||
2) Match from statement line label (based on partner name)
|
||||
3) Match from statement line reference (based on Invoice number)
|
||||
|
||||
You can easily override this module and add your own rules in your own one.
|
||||
The basic rules only fill in the partner, but you can use them to fill in
|
||||
any value of the line (in the future, we will add a rule to automatically
|
||||
match and reconcile the line).
|
||||
|
||||
It adds as well a label on the bank statement line (on which the pre-define
|
||||
rules can match) and a char field on the partner called 'Bank Statement
|
||||
Label'. Using the pre-define rules, you will be able to match various
|
||||
labels for a partner.
|
||||
|
||||
The reference of the line is always used by the reconciliation process. We're
|
||||
supposed to copy there (or write manually) the matching string. This can be:
|
||||
the order Number or an invoice number, or anything that will be found in the
|
||||
invoice accounting entry part to make the match.
|
||||
|
||||
You can use it with our account_advanced_reconcile module to automatize the
|
||||
reconciliation process.
|
||||
|
||||
|
||||
TODO: The rules that look for invoices to find out the partner should take
|
||||
back the payable / receivable account from there directly instead of
|
||||
retrieving it from partner properties!
|
||||
""",
|
||||
'website': 'http://www.camptocamp.com',
|
||||
'data': [
|
||||
'statement_view.xml',
|
||||
'partner_view.xml',
|
||||
'data.xml',
|
||||
'security/ir.model.access.csv',
|
||||
],
|
||||
'demo': [],
|
||||
'test': [
|
||||
'test/partner.yml',
|
||||
'test/invoice.yml',
|
||||
'test/supplier_invoice.yml',
|
||||
'test/refund.yml',
|
||||
'test/completion_test.yml'
|
||||
],
|
||||
'installable': False,
|
||||
'images': [],
|
||||
'auto_install': False,
|
||||
'license': 'AGPL-3',
|
||||
}
|
||||
@@ -1,216 +0,0 @@
|
||||
# Abkhazian translation for banking-addons
|
||||
# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014
|
||||
# This file is distributed under the same license as the banking-addons package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: banking-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2014-01-21 11:57+0000\n"
|
||||
"PO-Revision-Date: 2014-04-02 23:04+0000\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: Abkhazian <ab@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2014-05-22 06:49+0000\n"
|
||||
"X-Generator: Launchpad (build 17017)\n"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: view:account.statement.completion.rule:0
|
||||
msgid "Related Profiles"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: help:account.bank.statement.line,label:0
|
||||
msgid ""
|
||||
"Generic field to store a label given from the bank/office on which we can "
|
||||
"base the default/standard providen rule."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:169
|
||||
#, python-format
|
||||
msgid ""
|
||||
"Line named \"%s\" (Ref:%s) was matched by more than one partner while "
|
||||
"looking on %s invoices"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.bank.statement,completion_logs:0
|
||||
msgid "Completion Log"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.bank.statement.line,label:0
|
||||
msgid "Label"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: model:ir.model,name:account_statement_base_completion.model_account_bank_statement
|
||||
msgid "Bank Statement"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.statement.completion.rule,function_to_call:0
|
||||
msgid "Method"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:326
|
||||
#, python-format
|
||||
msgid ""
|
||||
"Line named \"%s\" (Ref:%s) was matched by more than one partner while "
|
||||
"looking on partner by name"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:504
|
||||
#, python-format
|
||||
msgid "Statement ID %s auto-completed for %s lines completed"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:500
|
||||
#, python-format
|
||||
msgid ""
|
||||
"%s Bank Statement ID %s has %s lines completed by %s \n"
|
||||
"%s\n"
|
||||
"%s\n"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: model:ir.model,name:account_statement_base_completion.model_account_bank_statement_line
|
||||
msgid "Bank Statement Line"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.bank.statement.line,additionnal_bank_fields:0
|
||||
msgid "Additionnal infos from bank"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: view:account.statement.profile:0
|
||||
msgid "Auto-Completion Rules"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: view:account.bank.statement:0
|
||||
msgid "Importation related infos"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:159
|
||||
#: code:addons/account_statement_base_completion/statement.py:179
|
||||
#, python-format
|
||||
msgid "Invalid invoice type for completion: %"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.statement.completion.rule,name:0
|
||||
msgid "Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: model:ir.model,name:account_statement_base_completion.model_account_statement_profile
|
||||
msgid "Statement Profile"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: view:account.bank.statement:0
|
||||
msgid "Auto Completion"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: view:account.statement.completion.rule:0
|
||||
#: model:ir.actions.act_window,name:account_statement_base_completion.action_st_completion_rule_tree
|
||||
#: model:ir.ui.menu,name:account_statement_base_completion.menu_action_st_completion_rule_tree_menu
|
||||
msgid "Statement Completion Rule"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: model:ir.model,name:account_statement_base_completion.model_account_statement_completion_rule
|
||||
msgid "account.statement.completion.rule"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: help:account.bank.statement.line,additionnal_bank_fields:0
|
||||
msgid ""
|
||||
"Used by completion and import system. Adds every field that is present in "
|
||||
"your bank/office statement file"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.statement.completion.rule,profile_ids:0
|
||||
#: field:account.statement.profile,rule_ids:0
|
||||
msgid "Related statement profiles"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:158
|
||||
#: code:addons/account_statement_base_completion/statement.py:178
|
||||
#, python-format
|
||||
msgid "System error"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.bank.statement.line,already_completed:0
|
||||
msgid "Auto-Completed"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:448
|
||||
#: code:addons/account_statement_base_completion/statement.py:466
|
||||
#, python-format
|
||||
msgid "ORM bypass error"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.statement.completion.rule,sequence:0
|
||||
msgid "Sequence"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:280
|
||||
#, python-format
|
||||
msgid ""
|
||||
"Line named \"%s\" (Ref:%s) was matched by more than one partner while "
|
||||
"looking on partner label: %s"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: help:account.statement.completion.rule,sequence:0
|
||||
msgid "Lower means parsed first."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:res.partner,bank_statement_label:0
|
||||
msgid "Bank Statement Label"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: help:account.bank.statement.line,already_completed:0
|
||||
msgid ""
|
||||
"When this checkbox is ticked, the auto-completion process/button will ignore "
|
||||
"this line."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: help:res.partner,bank_statement_label:0
|
||||
msgid ""
|
||||
"Enter the various label found on your bank statement separated by a ; If "
|
||||
" one of this label is include in the bank statement line, the "
|
||||
"partner will be automatically filled (as long as you use "
|
||||
"this method/rules in your statement profile)."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: model:ir.model,name:account_statement_base_completion.model_res_partner
|
||||
msgid "Partner"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: view:account.bank.statement:0
|
||||
msgid "Completion Logs"
|
||||
msgstr ""
|
||||
@@ -1,199 +0,0 @@
|
||||
# Translation of OpenERP Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * account_statement_base_completion
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 7.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-01-21 11:57+0000\n"
|
||||
"PO-Revision-Date: 2014-01-21 11:57+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: view:account.statement.completion.rule:0
|
||||
msgid "Related Profiles"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: help:account.bank.statement.line,label:0
|
||||
msgid "Generic field to store a label given from the bank/office on which we can base the default/standard providen rule."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:169
|
||||
#, python-format
|
||||
msgid "Line named \"%s\" (Ref:%s) was matched by more than one partner while looking on %s invoices"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.bank.statement,completion_logs:0
|
||||
msgid "Completion Log"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.bank.statement.line,label:0
|
||||
msgid "Label"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: model:ir.model,name:account_statement_base_completion.model_account_bank_statement
|
||||
msgid "Bank Statement"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.statement.completion.rule,function_to_call:0
|
||||
msgid "Method"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:326
|
||||
#, python-format
|
||||
msgid "Line named \"%s\" (Ref:%s) was matched by more than one partner while looking on partner by name"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:504
|
||||
#, python-format
|
||||
msgid "Statement ID %s auto-completed for %s lines completed"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:500
|
||||
#, python-format
|
||||
msgid "%s Bank Statement ID %s has %s lines completed by %s \n"
|
||||
"%s\n"
|
||||
"%s\n"
|
||||
""
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: model:ir.model,name:account_statement_base_completion.model_account_bank_statement_line
|
||||
msgid "Bank Statement Line"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.bank.statement.line,additionnal_bank_fields:0
|
||||
msgid "Additionnal infos from bank"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: view:account.statement.profile:0
|
||||
msgid "Auto-Completion Rules"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: view:account.bank.statement:0
|
||||
msgid "Importation related infos"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:159
|
||||
#: code:addons/account_statement_base_completion/statement.py:179
|
||||
#, python-format
|
||||
msgid "Invalid invoice type for completion: %"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.statement.completion.rule,name:0
|
||||
msgid "Name"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: model:ir.model,name:account_statement_base_completion.model_account_statement_profile
|
||||
msgid "Statement Profile"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: view:account.bank.statement:0
|
||||
msgid "Auto Completion"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: view:account.statement.completion.rule:0
|
||||
#: model:ir.actions.act_window,name:account_statement_base_completion.action_st_completion_rule_tree
|
||||
#: model:ir.ui.menu,name:account_statement_base_completion.menu_action_st_completion_rule_tree_menu
|
||||
msgid "Statement Completion Rule"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: model:ir.model,name:account_statement_base_completion.model_account_statement_completion_rule
|
||||
msgid "account.statement.completion.rule"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: help:account.bank.statement.line,additionnal_bank_fields:0
|
||||
msgid "Used by completion and import system. Adds every field that is present in your bank/office statement file"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.statement.completion.rule,profile_ids:0
|
||||
#: field:account.statement.profile,rule_ids:0
|
||||
msgid "Related statement profiles"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:158
|
||||
#: code:addons/account_statement_base_completion/statement.py:178
|
||||
#, python-format
|
||||
msgid "System error"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.bank.statement.line,already_completed:0
|
||||
msgid "Auto-Completed"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:448
|
||||
#: code:addons/account_statement_base_completion/statement.py:466
|
||||
#, python-format
|
||||
msgid "ORM bypass error"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.statement.completion.rule,sequence:0
|
||||
msgid "Sequence"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:280
|
||||
#, python-format
|
||||
msgid "Line named \"%s\" (Ref:%s) was matched by more than one partner while looking on partner label: %s"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: help:account.statement.completion.rule,sequence:0
|
||||
msgid "Lower means parsed first."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:res.partner,bank_statement_label:0
|
||||
msgid "Bank Statement Label"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: help:account.bank.statement.line,already_completed:0
|
||||
msgid "When this checkbox is ticked, the auto-completion process/button will ignore this line."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: help:res.partner,bank_statement_label:0
|
||||
msgid "Enter the various label found on your bank statement separated by a ; If one of this label is include in the bank statement line, the partner will be automatically filled (as long as you use this method/rules in your statement profile)."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: model:ir.model,name:account_statement_base_completion.model_res_partner
|
||||
msgid "Partner"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: view:account.bank.statement:0
|
||||
msgid "Completion Logs"
|
||||
msgstr ""
|
||||
|
||||
@@ -1,235 +0,0 @@
|
||||
# Spanish translation for banking-addons
|
||||
# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014
|
||||
# This file is distributed under the same license as the banking-addons package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: banking-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2014-01-21 11:57+0000\n"
|
||||
"PO-Revision-Date: 2014-06-05 22:02+0000\n"
|
||||
"Last-Translator: Pedro Manuel Baeza <pedro.baeza@gmail.com>\n"
|
||||
"Language-Team: Spanish <es@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2014-06-06 06:36+0000\n"
|
||||
"X-Generator: Launchpad (build 17031)\n"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: view:account.statement.completion.rule:0
|
||||
msgid "Related Profiles"
|
||||
msgstr "Perfiles relacionados"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: help:account.bank.statement.line,label:0
|
||||
msgid ""
|
||||
"Generic field to store a label given from the bank/office on which we can "
|
||||
"base the default/standard providen rule."
|
||||
msgstr ""
|
||||
"Campo genérico para almacenar una etiqueta dad por el banco/entidad en la "
|
||||
"que podemos basar la regla provista por defecto."
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:169
|
||||
#, python-format
|
||||
msgid ""
|
||||
"Line named \"%s\" (Ref:%s) was matched by more than one partner while "
|
||||
"looking on %s invoices"
|
||||
msgstr ""
|
||||
"La línea llamada \"%s\" (Ref: %s) fue casada con más de una empresa al "
|
||||
"buscar en las facturas %s"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.bank.statement,completion_logs:0
|
||||
msgid "Completion Log"
|
||||
msgstr "Registro de completado"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.bank.statement.line,label:0
|
||||
msgid "Label"
|
||||
msgstr "Etiqueta"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: model:ir.model,name:account_statement_base_completion.model_account_bank_statement
|
||||
msgid "Bank Statement"
|
||||
msgstr "Extracto bancario"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.statement.completion.rule,function_to_call:0
|
||||
msgid "Method"
|
||||
msgstr "Método"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:326
|
||||
#, python-format
|
||||
msgid ""
|
||||
"Line named \"%s\" (Ref:%s) was matched by more than one partner while "
|
||||
"looking on partner by name"
|
||||
msgstr ""
|
||||
"La línea llamada \"%s\" (Ref: %s) fue casada con más de una empresa al "
|
||||
"buscar por nombre de empresa"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:504
|
||||
#, python-format
|
||||
msgid "Statement ID %s auto-completed for %s lines completed"
|
||||
msgstr "Se han auto-completado para el extracto con ID %s %s líneas"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:500
|
||||
#, python-format
|
||||
msgid ""
|
||||
"%s Bank Statement ID %s has %s lines completed by %s \n"
|
||||
"%s\n"
|
||||
"%s\n"
|
||||
msgstr ""
|
||||
"%s El extracto bancario con ID %s tiene %s líneas completadas por %s \n"
|
||||
"%s\n"
|
||||
"%s\n"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: model:ir.model,name:account_statement_base_completion.model_account_bank_statement_line
|
||||
msgid "Bank Statement Line"
|
||||
msgstr "Línea del extracto bancario"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.bank.statement.line,additionnal_bank_fields:0
|
||||
msgid "Additionnal infos from bank"
|
||||
msgstr "Información adicional del banco"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: view:account.statement.profile:0
|
||||
msgid "Auto-Completion Rules"
|
||||
msgstr "Reglas de auto-completado"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: view:account.bank.statement:0
|
||||
msgid "Importation related infos"
|
||||
msgstr "Información relacionada con la importación"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:159
|
||||
#: code:addons/account_statement_base_completion/statement.py:179
|
||||
#, python-format
|
||||
msgid "Invalid invoice type for completion: %"
|
||||
msgstr "Tipo de factura no válida para completado: %s"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.statement.completion.rule,name:0
|
||||
msgid "Name"
|
||||
msgstr "Nombre"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: model:ir.model,name:account_statement_base_completion.model_account_statement_profile
|
||||
msgid "Statement Profile"
|
||||
msgstr "Perfil de extracto"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: view:account.bank.statement:0
|
||||
msgid "Auto Completion"
|
||||
msgstr "Auto completado"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: view:account.statement.completion.rule:0
|
||||
#: model:ir.actions.act_window,name:account_statement_base_completion.action_st_completion_rule_tree
|
||||
#: model:ir.ui.menu,name:account_statement_base_completion.menu_action_st_completion_rule_tree_menu
|
||||
msgid "Statement Completion Rule"
|
||||
msgstr "Regla de completado del extracto"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: model:ir.model,name:account_statement_base_completion.model_account_statement_completion_rule
|
||||
msgid "account.statement.completion.rule"
|
||||
msgstr "account.statement.completion.rule"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: help:account.bank.statement.line,additionnal_bank_fields:0
|
||||
msgid ""
|
||||
"Used by completion and import system. Adds every field that is present in "
|
||||
"your bank/office statement file"
|
||||
msgstr ""
|
||||
"Usado por el sistema de importación y completado. Añade cada campo que está "
|
||||
"presente en su archivo de extracto del banco/entidad"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.statement.completion.rule,profile_ids:0
|
||||
#: field:account.statement.profile,rule_ids:0
|
||||
msgid "Related statement profiles"
|
||||
msgstr "Perfiles de extractos relacionados"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:158
|
||||
#: code:addons/account_statement_base_completion/statement.py:178
|
||||
#, python-format
|
||||
msgid "System error"
|
||||
msgstr "Error de sistema"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.bank.statement.line,already_completed:0
|
||||
msgid "Auto-Completed"
|
||||
msgstr "Auto-completado"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:448
|
||||
#: code:addons/account_statement_base_completion/statement.py:466
|
||||
#, python-format
|
||||
msgid "ORM bypass error"
|
||||
msgstr "Error al saltar el ORM"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.statement.completion.rule,sequence:0
|
||||
msgid "Sequence"
|
||||
msgstr "Secuencia"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:280
|
||||
#, python-format
|
||||
msgid ""
|
||||
"Line named \"%s\" (Ref:%s) was matched by more than one partner while "
|
||||
"looking on partner label: %s"
|
||||
msgstr ""
|
||||
"La línea llamada \"%s\" (Ref: %s) fue casada con más de una empresa al "
|
||||
"buscar por la etiqueta de empresa: %s"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: help:account.statement.completion.rule,sequence:0
|
||||
msgid "Lower means parsed first."
|
||||
msgstr "Más bajo significa reconocido primero."
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:res.partner,bank_statement_label:0
|
||||
msgid "Bank Statement Label"
|
||||
msgstr "Etiqueta del extracto bancario"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: help:account.bank.statement.line,already_completed:0
|
||||
msgid ""
|
||||
"When this checkbox is ticked, the auto-completion process/button will ignore "
|
||||
"this line."
|
||||
msgstr ""
|
||||
"Cuando la casilla está marcada, el proceso de auto-completado/botón será "
|
||||
"ignorado para esta línea."
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: help:res.partner,bank_statement_label:0
|
||||
msgid ""
|
||||
"Enter the various label found on your bank statement separated by a ; If "
|
||||
" one of this label is include in the bank statement line, the "
|
||||
"partner will be automatically filled (as long as you use "
|
||||
"this method/rules in your statement profile)."
|
||||
msgstr ""
|
||||
"Introduzca los diversos tipos de etiqueta encontrados en el extracto "
|
||||
"bancario, separados por un ;. Si una de estas etiquetas está incluida en la "
|
||||
"línea del extracto bancario, la empresa será rellenada automáticamente "
|
||||
"(mientras use este método/reglas en el perfil de extracto)."
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: model:ir.model,name:account_statement_base_completion.model_res_partner
|
||||
msgid "Partner"
|
||||
msgstr "Empresa"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: view:account.bank.statement:0
|
||||
msgid "Completion Logs"
|
||||
msgstr "Registro de completado"
|
||||
@@ -1,223 +0,0 @@
|
||||
# French translation for banking-addons
|
||||
# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014
|
||||
# This file is distributed under the same license as the banking-addons package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: banking-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2014-01-21 11:57+0000\n"
|
||||
"PO-Revision-Date: 2014-06-19 13:54+0000\n"
|
||||
"Last-Translator: Joël Grand-Guillaume @ camptocamp "
|
||||
"<joel.grandguillaume@camptocamp.com>\n"
|
||||
"Language-Team: French <fr@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2014-06-20 06:09+0000\n"
|
||||
"X-Generator: Launchpad (build 17058)\n"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: view:account.statement.completion.rule:0
|
||||
msgid "Related Profiles"
|
||||
msgstr "Profils liés"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: help:account.bank.statement.line,label:0
|
||||
msgid ""
|
||||
"Generic field to store a label given from the bank/office on which we can "
|
||||
"base the default/standard providen rule."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:169
|
||||
#, python-format
|
||||
msgid ""
|
||||
"Line named \"%s\" (Ref:%s) was matched by more than one partner while "
|
||||
"looking on %s invoices"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.bank.statement,completion_logs:0
|
||||
msgid "Completion Log"
|
||||
msgstr "Journal des complétions"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.bank.statement.line,label:0
|
||||
msgid "Label"
|
||||
msgstr "Libellé"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: model:ir.model,name:account_statement_base_completion.model_account_bank_statement
|
||||
msgid "Bank Statement"
|
||||
msgstr "Relevé bancaire"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.statement.completion.rule,function_to_call:0
|
||||
msgid "Method"
|
||||
msgstr "Méthode"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:326
|
||||
#, python-format
|
||||
msgid ""
|
||||
"Line named \"%s\" (Ref:%s) was matched by more than one partner while "
|
||||
"looking on partner by name"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:504
|
||||
#, python-format
|
||||
msgid "Statement ID %s auto-completed for %s lines completed"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:500
|
||||
#, python-format
|
||||
msgid ""
|
||||
"%s Bank Statement ID %s has %s lines completed by %s \n"
|
||||
"%s\n"
|
||||
"%s\n"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: model:ir.model,name:account_statement_base_completion.model_account_bank_statement_line
|
||||
msgid "Bank Statement Line"
|
||||
msgstr "Ligne de relevé bancaire"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.bank.statement.line,additionnal_bank_fields:0
|
||||
msgid "Additionnal infos from bank"
|
||||
msgstr "Informations additionnelles de la banque"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: view:account.statement.profile:0
|
||||
msgid "Auto-Completion Rules"
|
||||
msgstr "Règles d'auto-complétion"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: view:account.bank.statement:0
|
||||
msgid "Importation related infos"
|
||||
msgstr "Importation des informations liées"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:159
|
||||
#: code:addons/account_statement_base_completion/statement.py:179
|
||||
#, python-format
|
||||
msgid "Invalid invoice type for completion: %"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.statement.completion.rule,name:0
|
||||
msgid "Name"
|
||||
msgstr "Nom"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: model:ir.model,name:account_statement_base_completion.model_account_statement_profile
|
||||
msgid "Statement Profile"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: view:account.bank.statement:0
|
||||
msgid "Auto Completion"
|
||||
msgstr "Auto-complétion"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: view:account.statement.completion.rule:0
|
||||
#: model:ir.actions.act_window,name:account_statement_base_completion.action_st_completion_rule_tree
|
||||
#: model:ir.ui.menu,name:account_statement_base_completion.menu_action_st_completion_rule_tree_menu
|
||||
msgid "Statement Completion Rule"
|
||||
msgstr "Règle d'auto-complétion du relevé"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: model:ir.model,name:account_statement_base_completion.model_account_statement_completion_rule
|
||||
msgid "account.statement.completion.rule"
|
||||
msgstr "account.statement.completion.rule"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: help:account.bank.statement.line,additionnal_bank_fields:0
|
||||
msgid ""
|
||||
"Used by completion and import system. Adds every field that is present in "
|
||||
"your bank/office statement file"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.statement.completion.rule,profile_ids:0
|
||||
#: field:account.statement.profile,rule_ids:0
|
||||
msgid "Related statement profiles"
|
||||
msgstr "Profils liés"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:158
|
||||
#: code:addons/account_statement_base_completion/statement.py:178
|
||||
#, python-format
|
||||
msgid "System error"
|
||||
msgstr "Erreur système"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.bank.statement.line,already_completed:0
|
||||
msgid "Auto-Completed"
|
||||
msgstr "Auto-Complété"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:448
|
||||
#: code:addons/account_statement_base_completion/statement.py:466
|
||||
#, python-format
|
||||
msgid "ORM bypass error"
|
||||
msgstr "Erreur de bypass de l'ORM"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:account.statement.completion.rule,sequence:0
|
||||
msgid "Sequence"
|
||||
msgstr "Séquence"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: code:addons/account_statement_base_completion/statement.py:280
|
||||
#, python-format
|
||||
msgid ""
|
||||
"Line named \"%s\" (Ref:%s) was matched by more than one partner while "
|
||||
"looking on partner label: %s"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: help:account.statement.completion.rule,sequence:0
|
||||
msgid "Lower means parsed first."
|
||||
msgstr "Plus petite séquence analysée en premier."
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: field:res.partner,bank_statement_label:0
|
||||
msgid "Bank Statement Label"
|
||||
msgstr "Description de relevé bancaire"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: help:account.bank.statement.line,already_completed:0
|
||||
msgid ""
|
||||
"When this checkbox is ticked, the auto-completion process/button will ignore "
|
||||
"this line."
|
||||
msgstr ""
|
||||
"Les lignes cochées seront ignorées lorsque vous cliquez sur le bouton auto-"
|
||||
"complétion"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: help:res.partner,bank_statement_label:0
|
||||
msgid ""
|
||||
"Enter the various label found on your bank statement separated by a ; If "
|
||||
" one of this label is include in the bank statement line, the "
|
||||
"partner will be automatically filled (as long as you use "
|
||||
"this method/rules in your statement profile)."
|
||||
msgstr ""
|
||||
"Entrez les différentes descriptions/informations sur votre relevé bancaire "
|
||||
"séparées par un ';' Si l'une d'entre elles figure dans la ligne du "
|
||||
"relevé, le partenaire correspondant sera automatiquement retrouvé "
|
||||
"(à condition d'utiliser un règle de lettrage dans le profil)."
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: model:ir.model,name:account_statement_base_completion.model_res_partner
|
||||
msgid "Partner"
|
||||
msgstr "Partenaire"
|
||||
|
||||
#. module: account_statement_base_completion
|
||||
#: view:account.bank.statement:0
|
||||
msgid "Completion Logs"
|
||||
msgstr "Journaux d'auto-complétion"
|
||||
@@ -1,99 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="bank_statement_view_form" model="ir.ui.view">
|
||||
<field name="name">account_bank_statement_import_base.bank_statement.view_form</field>
|
||||
<field name="model">account.bank.statement</field>
|
||||
<field name="inherit_id" ref="account.view_bank_statement_form" />
|
||||
<field eval="16" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="/form/sheet/notebook/page/field[@name='line_ids']/form/group/field[@name='sequence']" position="after">
|
||||
<separator colspan="4" string="Importation related infos"/>
|
||||
<field name="label" />
|
||||
<field name="already_completed" />
|
||||
</xpath>
|
||||
|
||||
<!-- <xpath expr="/form/group[2]" position="attributes">
|
||||
<attribute name="col">10</attribute>
|
||||
</xpath> -->
|
||||
|
||||
<button name="button_confirm_bank" position="before">
|
||||
<button name="button_auto_completion" string="Auto Completion" states='draft,open' type="object" class="oe_highlight" icon="gtk-execute"/>
|
||||
</button>
|
||||
|
||||
<xpath expr="/form/sheet/notebook/page[@string='Transactions']" position="after">
|
||||
<page string="Completion Logs" attrs="{'invisible':[('completion_logs','=',False)]}">
|
||||
<field name="completion_logs" colspan="4" nolabel="1" attrs="{'invisible':[('completion_logs','=',False)]}"/>
|
||||
</page>
|
||||
</xpath>
|
||||
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
<record id="bank_statement_view_form2" model="ir.ui.view">
|
||||
<field name="name">account_bank_statement_import_base.bank_statement.auto_cmpl</field>
|
||||
<field name="model">account.bank.statement</field>
|
||||
<field name="inherit_id" ref="account.view_bank_statement_form" />
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="/form/sheet/notebook/page/field[@name='line_ids']/tree/field[@name='amount']" position="after">
|
||||
<field name="already_completed" />
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="statement_rules_view_form" model="ir.ui.view">
|
||||
<field name="name">account.statement.profile.view</field>
|
||||
<field name="model">account.statement.profile</field>
|
||||
<field name="inherit_id" ref="account_statement_ext.statement_importer_view_form"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="bank_statement_prefix" position="after">
|
||||
<separator colspan="4" string="Auto-Completion Rules"/>
|
||||
<field name="rule_ids" colspan="4" nolabel="1"/>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="statement_st_completion_rule_view_form" model="ir.ui.view">
|
||||
<field name="name">account.statement.completion.rule.view</field>
|
||||
<field name="model">account.statement.completion.rule</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Statement Completion Rule">
|
||||
<field name="sequence"/>
|
||||
<field name="name" select="1" />
|
||||
<field name="function_to_call"/>
|
||||
<separator colspan="4" string="Related Profiles"/>
|
||||
<field name="profile_ids" nolabel="1" colspan="4"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="statement_st_completion_rule_view_tree" model="ir.ui.view">
|
||||
<field name="name">account.statement.completion.rule.view</field>
|
||||
<field name="model">account.statement.completion.rule</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Statement Completion Rule">
|
||||
<field name="sequence"/>
|
||||
<field name="name" select="1" />
|
||||
<field name="profile_ids" />
|
||||
<field name="function_to_call"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_st_completion_rule_tree" model="ir.actions.act_window">
|
||||
<field name="name">Statement Completion Rule</field>
|
||||
<field name="res_model">account.statement.completion.rule</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
|
||||
<menuitem string="Statement Completion Rule" action="action_st_completion_rule_tree"
|
||||
id="menu_action_st_completion_rule_tree_menu" parent="account.menu_configuration_misc"
|
||||
sequence="30"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -1,102 +0,0 @@
|
||||
-
|
||||
In order to test the banking framework, I first need to create a profile
|
||||
-
|
||||
!record {model: account.statement.profile, id: profile_test1}:
|
||||
name: Bank EUR Profile
|
||||
journal_id: account.bank_journal
|
||||
commission_account_id: account.a_expense
|
||||
company_id: base.main_company
|
||||
balance_check: True
|
||||
rule_ids:
|
||||
- bank_statement_completion_rule_4
|
||||
- bank_statement_completion_rule_5
|
||||
- bank_statement_completion_rule_2
|
||||
- bank_statement_completion_rule_3
|
||||
-
|
||||
Now I create a statement. I create statment lines separately because I need
|
||||
to find each one by XML id
|
||||
-
|
||||
!record {model: account.bank.statement, id: statement_test1}:
|
||||
name: Statement 2
|
||||
profile_id: profile_test1
|
||||
company_id: base.main_company
|
||||
-
|
||||
I create a statement line for a CI
|
||||
-
|
||||
!record {model: account.bank.statement.line, id: statement_line_ci}:
|
||||
name: Test autocompletion based on Customer Invoice Number
|
||||
statement_id: statement_test1
|
||||
ref: CI0001
|
||||
date: '2013-12-20'
|
||||
amount: 210.0
|
||||
-
|
||||
I create a statement line for a SI
|
||||
-
|
||||
!record {model: account.bank.statement.line, id: statement_line_si}:
|
||||
name: Test autocompletion based on Supplier Invoice Number
|
||||
statement_id: statement_test1
|
||||
ref: T2S12345
|
||||
date: '2013-12-19'
|
||||
amount: -65.0
|
||||
-
|
||||
I create a statement line for a CR
|
||||
-
|
||||
!record {model: account.bank.statement.line, id: statement_line_cr}:
|
||||
name: Test autocompletion based on Customer Refund Number
|
||||
statement_id: statement_test1
|
||||
ref: CR0001
|
||||
date: '2013-12-19'
|
||||
amount: -210.0
|
||||
-
|
||||
I create a statement line for the Partner Name
|
||||
-
|
||||
!record {model: account.bank.statement.line, id: statement_line_partner_name}:
|
||||
name: Test autocompletion based on Partner Name Vauxoo
|
||||
statement_id: statement_test1
|
||||
ref: /
|
||||
date: '2013-12-17'
|
||||
amount: 600.0
|
||||
-
|
||||
I create a statement line for the Partner Label
|
||||
-
|
||||
!record {model: account.bank.statement.line, id: statement_line_partner_label}:
|
||||
name: test autocompletion based on text (XXX66Z) matching with partner form information (note that Ref does not exist)
|
||||
statement_id: statement_test1
|
||||
ref: ZU788
|
||||
date: '2013-12-24'
|
||||
amount: -932.4
|
||||
-
|
||||
I run the auto complete
|
||||
-
|
||||
!python {model: account.bank.statement}: |
|
||||
result = self.button_auto_completion(cr, uid, [ref("statement_test1")])
|
||||
-
|
||||
Now I can check that all is nice and shiny, line 1. I expect the Customer
|
||||
Invoice Number to be recognised.
|
||||
I Use _ref, because ref conflicts with the field ref of the statement line
|
||||
-
|
||||
!assert {model: account.bank.statement.line, id: statement_line_ci, string: Check completion by CI number}:
|
||||
- partner_id.id == _ref("base.res_partner_12")
|
||||
-
|
||||
Line 2. I expect the Supplier invoice number to be recognised. The supplier
|
||||
invoice was created by the account module demo data, and we confirmed it
|
||||
here.
|
||||
-
|
||||
!assert {model: account.bank.statement.line, id: statement_line_si, string: Check completion by SI number}:
|
||||
- partner_id.id == _ref("base.res_partner_17")
|
||||
-
|
||||
Line 3. I expect the Customer refund number to be recognised. It should be
|
||||
the commercial partner, and not the regular partner.
|
||||
-
|
||||
!assert {model: account.bank.statement.line, id: statement_line_cr, string: Check completion by CR number and commercial partner}:
|
||||
- partner_id.id == _ref("base.res_partner_12")
|
||||
-
|
||||
Line 4. I check that the partner name has been recognised.
|
||||
-
|
||||
!assert {model: account.bank.statement.line, id: statement_line_partner_name, string: Check completion by partner name}:
|
||||
- partner_id.name == 'Vauxoo'
|
||||
-
|
||||
Line 5. I check that the partner special label has been recognised.
|
||||
-
|
||||
!assert {model: account.bank.statement.line, id: statement_line_partner_label, string: Check completion by partner label}:
|
||||
- partner_id.id == _ref("base.res_partner_6")
|
||||
@@ -1,32 +0,0 @@
|
||||
-
|
||||
I create a customer Invoice to be found by the completion.
|
||||
-
|
||||
!record {model: account.invoice, id: invoice_for_completion_1}:
|
||||
account_id: account.a_recv
|
||||
company_id: base.main_company
|
||||
currency_id: base.EUR
|
||||
internal_number: CI0001
|
||||
invoice_line:
|
||||
- account_id: account.a_sale
|
||||
name: '[PCSC234] PC Assemble SC234'
|
||||
price_unit: 210.0
|
||||
quantity: 1.0
|
||||
product_id: product.product_product_3
|
||||
uos_id: product.product_uom_unit
|
||||
journal_id: account.bank_journal
|
||||
partner_id: base.res_partner_12
|
||||
reference_type: none
|
||||
-
|
||||
I confirm the Invoice
|
||||
-
|
||||
!workflow {model: account.invoice, action: invoice_open, ref: invoice_for_completion_1}
|
||||
-
|
||||
I check that the invoice state is "Open"
|
||||
-
|
||||
!assert {model: account.invoice, id: invoice_for_completion_1}:
|
||||
- state == 'open'
|
||||
-
|
||||
I check that it is given the number "CI0001"
|
||||
-
|
||||
!assert {model: account.invoice, id: invoice_for_completion_1, string: Check CI number}:
|
||||
- number == 'CI0001'
|
||||
@@ -1,27 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#
|
||||
#
|
||||
# Authors: Laurent Mignon
|
||||
# Copyright (c) 2014 Acsone SA/NV (http://www.acsone.eu)
|
||||
# All Rights Reserved
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
#
|
||||
|
||||
from . import test_base_completion
|
||||
|
||||
checks = [
|
||||
test_base_completion
|
||||
]
|
||||
102
account_statement_base_import/README.rst
Normal file
102
account_statement_base_import/README.rst
Normal file
@@ -0,0 +1,102 @@
|
||||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
|
||||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
|
||||
:alt: License: AGPL-3
|
||||
|
||||
=============================
|
||||
Account statement base import
|
||||
=============================
|
||||
|
||||
This module is a grouping of 7.0/8.0 modules, used to import accounting files
|
||||
and completing them automatically:
|
||||
|
||||
* account_statement_base_completion
|
||||
* account_statement_base_import
|
||||
* account_statement_commission
|
||||
* account_statement_ext
|
||||
|
||||
The main change is that, in order to import financial data, this information
|
||||
is now imported directly as a Journal Entry.
|
||||
|
||||
Most of the information present in the "statement profile" is now located in
|
||||
the account journal (with an added boolean parameter which allows to use
|
||||
this journal for importation).
|
||||
|
||||
Financial data can be imported using a standard .csv or .xls file (you'll find
|
||||
it in the 'data' folder). It respects the journal to pass the entries.
|
||||
|
||||
This module can handle a commission taken by the payment office and has the
|
||||
following format:
|
||||
* __date__: date of the payment
|
||||
* __amount__: amount paid in the currency of the journal used in the
|
||||
importation
|
||||
* __label__: the comunication given by the payment office, used as
|
||||
communication in the generated entries.
|
||||
|
||||
Another column which can be used is __commission_amount__, representing
|
||||
the amount for the commission taken by line.
|
||||
|
||||
Afterwards, the goal is to populate the journal items with information that
|
||||
the bank or office gave you. For this, completion rules can be specified by
|
||||
journal.
|
||||
|
||||
Some basic rules are provided in this module:
|
||||
|
||||
1) Match from statement line label (based on partner field 'Bank Statement
|
||||
Label')
|
||||
2) Match from statement line label (based on partner name)
|
||||
3) Match from statement line label (based on Invoice reference)
|
||||
|
||||
Feel free to extend either the importation method, the completion method, or
|
||||
both.
|
||||
|
||||
|
||||
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
|
||||
:alt: Try me on Runbot
|
||||
:target: https://runbot.odoo-community.org/runbot/{repo_id}/{branch}
|
||||
|
||||
.. repo_id is available in https://github.com/OCA/maintainer-tools/blob/master/tools/repos_with_ids.txt
|
||||
.. branch is "8.0" for example
|
||||
|
||||
Known issues / Roadmap
|
||||
======================
|
||||
|
||||
* ...
|
||||
|
||||
Bug Tracker
|
||||
===========
|
||||
|
||||
Bugs are tracked on `GitHub Issues
|
||||
<https://github.com/OCA/bank-statement-reconcile/issues>`_. In case of trouble, please
|
||||
check there if your issue has already been reported. If you spotted it first,
|
||||
help us smashing it by providing a detailed and welcomed feedback.
|
||||
|
||||
Credits
|
||||
=======
|
||||
|
||||
Images
|
||||
------
|
||||
|
||||
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
|
||||
|
||||
Contributors
|
||||
------------
|
||||
|
||||
* Joël Grand-Guillaume <joel.grandguillaume@camptocamp.com>
|
||||
* Nicolas Bessi <nicolas.bessi@camptocamp.com>
|
||||
* Sébastien Beau <sebastien.beau@akretion.com>
|
||||
* Matthieu Dietrich <matthieu.dietrich@camptocamp.com>
|
||||
|
||||
Maintainer
|
||||
----------
|
||||
|
||||
.. image:: https://odoo-community.org/logo.png
|
||||
:alt: Odoo Community Association
|
||||
:target: https://odoo-community.org
|
||||
|
||||
This module is maintained by the OCA.
|
||||
|
||||
OCA, or the Odoo Community Association, is a nonprofit organization whose
|
||||
mission is to support the collaborative development of Odoo features and
|
||||
promote its widespread use.
|
||||
|
||||
To contribute to this module, please visit https://odoo-community.org.
|
||||
@@ -1,23 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Author: Joel Grand-Guillaume
|
||||
# Copyright 2011-2012 Camptocamp SA
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
# © 2011-2016 Camptocamp SA
|
||||
# Joel Grand-Guillaume, Nicolas Bessi, Matthieu Dietrich
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
from . import parser
|
||||
from . import wizard
|
||||
from . import models
|
||||
|
||||
@@ -1,76 +1,31 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Author: Joel Grand-Guillaume
|
||||
# Copyright 2011-2012 Camptocamp SA
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
# © 2011-2016 Camptocamp SA
|
||||
# Joel Grand-Guillaume, Nicolas Bessi, Matthieu Dietrich
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{'name': "Bank statement base import",
|
||||
'version': '1.2',
|
||||
'author': "Camptocamp,Odoo Community Association (OCA)",
|
||||
'maintainer': 'Camptocamp',
|
||||
'category': 'Finance',
|
||||
'complexity': 'normal',
|
||||
'depends': [
|
||||
'account'
|
||||
],
|
||||
'description': """
|
||||
This module brings basic methods and fields on bank statement to deal with
|
||||
the importation of different bank and offices. A generic abstract method is
|
||||
defined and an example that gives you a basic way of importing bank statement
|
||||
through a standard file is provided.
|
||||
|
||||
This module improves the bank statement and allows you to import your bank
|
||||
transactions with a standard .csv or .xls file (you'll find it in the 'data'
|
||||
folder). It respects the profile (provided by the accouhnt_statement_ext
|
||||
module) to pass the entries. That means, you'll have to choose a file format
|
||||
for each profile.
|
||||
In order to achieve this it uses the `xlrd` Python module which you will need
|
||||
to install separately in your environment.
|
||||
|
||||
This module can handle a commission taken by the payment office and has the
|
||||
following format:
|
||||
|
||||
* __ref__: the SO number, INV number or any matching ref found. It'll be used
|
||||
as reference in the generated entries and will be useful for reconciliation
|
||||
process
|
||||
* __date__: date of the payment
|
||||
* __amount__: amount paid in the currency of the journal used in the
|
||||
importation profile
|
||||
* __label__: the comunication given by the payment office, used as
|
||||
communication in the generated entries.
|
||||
|
||||
The goal is here to populate the statement lines of a bank statement with the
|
||||
infos that the bank or office give you. Fell free to inherit from this module
|
||||
to add your own format. Then, if you need to complete data from there, add
|
||||
your own account_statement_*_completion module and implement the needed rules.
|
||||
""",
|
||||
'website': 'http://www.camptocamp.com',
|
||||
'data': [
|
||||
"security/ir.model.access.csv",
|
||||
"data/completion_rule_data.xml",
|
||||
"wizard/import_statement_view.xml",
|
||||
"views/account_move_view.xml",
|
||||
"views/journal_view.xml",
|
||||
"views/partner_view.xml",
|
||||
],
|
||||
'test': [],
|
||||
'installable': True,
|
||||
'images': [],
|
||||
'auto_install': False,
|
||||
'license': 'AGPL-3',
|
||||
}
|
||||
{
|
||||
'name': "Bank statement base import",
|
||||
'version': '9.0.1.0.0',
|
||||
'author': "Akretion,Camptocamp,Odoo Community Association (OCA)",
|
||||
'category': 'Finance',
|
||||
'depends': ['account'],
|
||||
'website': 'http://www.camptocamp.com',
|
||||
'data': [
|
||||
"security/ir.model.access.csv",
|
||||
"data/completion_rule_data.xml",
|
||||
"wizard/import_statement_view.xml",
|
||||
"views/account_move_view.xml",
|
||||
"views/journal_view.xml",
|
||||
"views/partner_view.xml",
|
||||
],
|
||||
'test': [
|
||||
'test/partner.yml',
|
||||
'test/invoice.yml',
|
||||
'test/supplier_invoice.yml',
|
||||
'test/refund.yml',
|
||||
'test/completion_test.yml'
|
||||
],
|
||||
'installable': True,
|
||||
'auto_install': False,
|
||||
'license': 'AGPL-3',
|
||||
}
|
||||
|
||||
@@ -14,9 +14,15 @@
|
||||
</record>
|
||||
|
||||
<record id="bank_statement_completion_rule_4" model="account.move.completion.rule">
|
||||
<field name="name">Match from line label (based on Invoice reference)</field>
|
||||
<field name="name">Match from line label (based on Invoice number)</field>
|
||||
<field name="sequence">40</field>
|
||||
<field name="function_to_call">get_from_name_and_invoice</field>
|
||||
</record>
|
||||
|
||||
<record id="bank_statement_completion_rule_5" model="account.move.completion.rule">
|
||||
<field name="name">Match from line label (based on Invoice Supplier number)</field>
|
||||
<field name="sequence">45</field>
|
||||
<field name="function_to_call">get_from_name_and_supplier_invoice</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
||||
Binary file not shown.
@@ -1,23 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Author: Joel Grand-Guillaume
|
||||
# Copyright 2011-2012 Camptocamp SA
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
# © 2011-2016 Camptocamp SA
|
||||
# Joel Grand-Guillaume, Nicolas Bessi, Matthieu Dietrich
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
import sys
|
||||
import traceback
|
||||
import os
|
||||
@@ -223,10 +207,10 @@ class AccountJournal(models.Model):
|
||||
if filename:
|
||||
(filename, __) = os.path.splitext(filename)
|
||||
parser = new_move_parser(self, ftype=ftype, move_ref=filename)
|
||||
res = []
|
||||
res = self.env['account.move']
|
||||
for result_row_list in parser.parse(file_stream):
|
||||
move = self._move_import(parser, file_stream, ftype=ftype)
|
||||
res.append(move)
|
||||
res |= move
|
||||
return res
|
||||
|
||||
def _move_import(self, parser, file_stream, ftype="csv"):
|
||||
|
||||
@@ -1,23 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Author: Nicolas Bessi, Joel Grand-Guillaume
|
||||
# Copyright 2011-2012 Camptocamp SA
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
# © 2011-2016 Camptocamp SA
|
||||
# Joel Grand-Guillaume, Nicolas Bessi, Matthieu Dietrich
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
# TODO replace customer supplier by package constant
|
||||
import traceback
|
||||
import sys
|
||||
@@ -65,7 +49,9 @@ class AccountMoveCompletionRule(models.Model):
|
||||
Override this to add you own."""
|
||||
return [
|
||||
('get_from_name_and_invoice',
|
||||
'From line name (based on invoice reference)'),
|
||||
'From line name (based on customer invoice number)'),
|
||||
('get_from_name_and_supplier_invoice',
|
||||
'From line name (based on supplier invoice number)'),
|
||||
('get_from_name_and_partner_field',
|
||||
'From line name (based on partner field)'),
|
||||
('get_from_name_and_partner_name',
|
||||
@@ -90,6 +76,62 @@ class AccountMoveCompletionRule(models.Model):
|
||||
__get_functions,
|
||||
string='Method')
|
||||
|
||||
def _find_invoice(self, line, inv_type):
|
||||
"""Find invoice related to statement line"""
|
||||
inv_obj = self.env['account.invoice']
|
||||
if inv_type == 'supplier':
|
||||
type_domain = ('in_invoice', 'in_refund')
|
||||
number_field = 'reference'
|
||||
elif inv_type == 'customer':
|
||||
type_domain = ('out_invoice', 'out_refund')
|
||||
number_field = 'number'
|
||||
else:
|
||||
raise ValidationError(
|
||||
_('Invalid invoice type for completion: %') % inv_type)
|
||||
|
||||
invoices = inv_obj.search([(number_field, '=', line.name.strip()),
|
||||
('type', 'in', type_domain)])
|
||||
if invoices:
|
||||
if len(invoices) == 1:
|
||||
invoice = invoices[0]
|
||||
else:
|
||||
raise ErrorTooManyPartner(
|
||||
_('Line named "%s" was matched by more than one '
|
||||
'partner while looking on %s invoices') %
|
||||
(line.name, inv_type))
|
||||
return invoice
|
||||
return False
|
||||
|
||||
def _from_invoice(self, line, inv_type):
|
||||
"""Populate statement line values"""
|
||||
if inv_type not in ('supplier', 'customer'):
|
||||
raise ValidationError(
|
||||
_('Invalid invoice type for completion: %') %
|
||||
inv_type)
|
||||
res = {}
|
||||
invoice = self._find_invoice(line, inv_type)
|
||||
if invoice:
|
||||
partner_id = invoice.commercial_partner_id.id
|
||||
res = {'partner_id': partner_id}
|
||||
return res
|
||||
|
||||
# Should be private but data are initialised with no update XML
|
||||
def get_from_name_and_supplier_invoice(self, line):
|
||||
"""Match the partner based on the invoice number and the reference of
|
||||
the statement line. Then, call the generic get_values_for_line method
|
||||
to complete other values. If more than one partner matched, raise the
|
||||
ErrorTooManyPartner error.
|
||||
|
||||
:param dict line: read of the concerned account.bank.statement.line
|
||||
:return:
|
||||
A dict of value that can be passed directly to the write method of
|
||||
the statement line or {}
|
||||
{'partner_id': value,
|
||||
'account_id': value,
|
||||
...}
|
||||
"""
|
||||
return self._from_invoice(line, 'supplier')
|
||||
|
||||
# Should be private but data are initialised with no update XML
|
||||
def get_from_name_and_invoice(self, line):
|
||||
"""Match the partner based on the invoice number and the reference of
|
||||
@@ -105,20 +147,7 @@ class AccountMoveCompletionRule(models.Model):
|
||||
'account_id': value,
|
||||
...}
|
||||
"""
|
||||
res = {}
|
||||
inv_obj = self.env['account.invoice']
|
||||
invoices = inv_obj.search([('name', '=', line.name.strip())])
|
||||
if invoices:
|
||||
if len(invoices) == 1:
|
||||
invoice = invoices[0]
|
||||
partner_id = invoice.commercial_partner_id.id
|
||||
res = {'partner_id': partner_id}
|
||||
else:
|
||||
raise ErrorTooManyPartner(
|
||||
_('Line named "%s" (Ref:%s) was matched by more than one '
|
||||
'partner while looking on invoices') %
|
||||
(line.name))
|
||||
return res
|
||||
return self._from_invoice(line, 'customer')
|
||||
|
||||
# Should be private but data are initialised with no update XML
|
||||
def get_from_name_and_partner_field(self, line):
|
||||
@@ -140,7 +169,7 @@ class AccountMoveCompletionRule(models.Model):
|
||||
"""
|
||||
res = {}
|
||||
partner_obj = self.env['res.partner']
|
||||
or_regex = ".*; *%s *;.*" % line.name
|
||||
or_regex = ".*;? *%s *;?.*" % line.name
|
||||
sql = ("SELECT id from res_partner"
|
||||
" WHERE bank_statement_label ~* %s")
|
||||
self.env.cr.execute(sql, (or_regex, ))
|
||||
|
||||
@@ -1,24 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##########################################################################
|
||||
#
|
||||
# Copyright (C) 2011 Akretion & Camptocamp
|
||||
# Author : Sébastien BEAU, Joel Grand-Guillaume
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##########################################################################
|
||||
|
||||
# © 2011-2016 Camptocamp SA
|
||||
# Joel Grand-Guillaume, Nicolas Bessi, Matthieu Dietrich
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
from openerp import fields, models
|
||||
|
||||
|
||||
|
||||
125
account_statement_base_import/test/completion_test.yml
Normal file
125
account_statement_base_import/test/completion_test.yml
Normal file
@@ -0,0 +1,125 @@
|
||||
-
|
||||
In order to test the banking framework, I first need to create a journal
|
||||
-
|
||||
!record {model: account.journal, id: account.bank_journal}:
|
||||
used_for_import: True
|
||||
partner_id: base.res_partner_12
|
||||
commission_account_id: account.a_expense
|
||||
receivable_account_id: account.a_expense
|
||||
rule_ids:
|
||||
- bank_statement_completion_rule_4
|
||||
- bank_statement_completion_rule_2
|
||||
- bank_statement_completion_rule_3
|
||||
- bank_statement_completion_rule_5
|
||||
-
|
||||
Now I create a statement. I create statment lines separately because I need
|
||||
to find each one by XML id
|
||||
-
|
||||
!record {model: account.move, id: move_test1}:
|
||||
name: Move 2
|
||||
journal_id: account.bank_journal
|
||||
company_id: base.main_company
|
||||
-
|
||||
I create a move line for a CI
|
||||
-
|
||||
!record {model: account.move.line, id: move_line_ci}:
|
||||
name: \
|
||||
account_id: account.a_sale
|
||||
move_id: move_test1
|
||||
date_maturity: '2013-12-20'
|
||||
credit: 0.0
|
||||
-
|
||||
I create a move line for a SI
|
||||
-
|
||||
!record {model: account.move.line, id: move_line_si}:
|
||||
name: \
|
||||
account_id: account.a_expense
|
||||
move_id: move_test1
|
||||
date_maturity: '2013-12-19'
|
||||
debit: 0.0
|
||||
-
|
||||
I create a move line for a CR
|
||||
-
|
||||
!record {model: account.move.line, id: move_line_cr}:
|
||||
name: \
|
||||
account_id: account.a_expense
|
||||
move_id: move_test1
|
||||
date_maturity: '2013-12-19'
|
||||
debit: 0.0
|
||||
-
|
||||
I create a move line for the Partner Name
|
||||
-
|
||||
!record {model: account.move.line, id: move_line_partner_name}:
|
||||
name: Test autocompletion based on Partner Name Camptocamp
|
||||
account_id: account.a_sale
|
||||
move_id: move_test1
|
||||
date_maturity: '2013-12-17'
|
||||
credit: 0.0
|
||||
-
|
||||
I create a move line for the Partner Label
|
||||
-
|
||||
!record {model: account.move.line, id: move_line_partner_label}:
|
||||
name: XXX66Z
|
||||
account_id: account.a_sale
|
||||
move_id: move_test1
|
||||
date_maturity: '2013-12-24'
|
||||
debit: 0.0
|
||||
-
|
||||
and add the correct name
|
||||
-
|
||||
!python {model: account.move.line}: |
|
||||
import datetime as dt
|
||||
context['check_move_validity'] = False
|
||||
model.write(cr, uid, [ref('move_line_ci')],
|
||||
{'name': dt.date.today().strftime('TBNK/%Y/0001'),
|
||||
'credit': 210.0},
|
||||
context)
|
||||
model.write(cr, uid, [ref('move_line_si')],
|
||||
{'name': 'T2S12345',
|
||||
'debit': 65.0},
|
||||
context)
|
||||
model.write(cr, uid, [ref('move_line_cr')],
|
||||
{'name': dt.date.today().strftime('RTEXJ/%Y/0001'),
|
||||
'debit': 210.0},
|
||||
context)
|
||||
model.write(cr, uid, [ref('move_line_partner_name')],
|
||||
{'credit': 600.0},
|
||||
context)
|
||||
model.write(cr, uid, [ref('move_line_partner_label')],
|
||||
{'debit': 932.4},
|
||||
context)
|
||||
-
|
||||
I run the auto complete
|
||||
-
|
||||
!python {model: account.move}: |
|
||||
result = self.button_auto_completion(cr, uid, [ref("move_test1")])
|
||||
-
|
||||
Now I can check that all is nice and shiny, line 1. I expect the Customer
|
||||
Invoice Number to be recognised.
|
||||
I Use _ref, because ref conflicts with the field ref of the statement line
|
||||
-
|
||||
!assert {model: account.move.line, id: move_line_ci, string: Check completion by CI number}:
|
||||
- partner_id.id == _ref("base.res_partner_12")
|
||||
-
|
||||
Line 2. I expect the Supplier invoice number to be recognised. The supplier
|
||||
invoice was created by the account module demo data, and we confirmed it
|
||||
here.
|
||||
-
|
||||
!assert {model: account.move.line, id: move_line_si, string: Check completion by SI number}:
|
||||
- partner_id.id == _ref("base.res_partner_12")
|
||||
-
|
||||
Line 3. I expect the Customer refund number to be recognised. It should be
|
||||
the commercial partner, and not the regular partner.
|
||||
-
|
||||
!assert {model: account.move.line, id: move_line_cr, string: Check completion by CR number and commercial partner}:
|
||||
- partner_id.id == _ref("base.res_partner_12")
|
||||
-
|
||||
Line 4. I check that the partner name has been recognised.
|
||||
-
|
||||
!assert {model: account.move.line, id: move_line_partner_name, string: Check completion by partner name}:
|
||||
- partner_id.name == 'Camptocamp'
|
||||
-
|
||||
Line 5. I check that the partner special label has been recognised.
|
||||
-
|
||||
!assert {model: account.move.line, id: move_line_partner_label, string: Check completion by partner label}:
|
||||
- partner_id.id == _ref("base.res_partner_4")
|
||||
42
account_statement_base_import/test/invoice.yml
Normal file
42
account_statement_base_import/test/invoice.yml
Normal file
@@ -0,0 +1,42 @@
|
||||
-
|
||||
I import account minimal data
|
||||
-
|
||||
!python {model: account.invoice}: |
|
||||
openerp.tools.convert_file(cr,
|
||||
'account',
|
||||
openerp.modules.get_module_resource(
|
||||
'account',
|
||||
'test',
|
||||
'account_minimal_test.xml'),
|
||||
{}, 'init', False, 'test')
|
||||
-
|
||||
I create a customer Invoice to be found by the completion.
|
||||
-
|
||||
!record {model: account.invoice, id: invoice_for_completion_1}:
|
||||
company_id: base.main_company
|
||||
currency_id: base.EUR
|
||||
invoice_line_ids:
|
||||
- name: '[PCSC234] PC Assemble SC234'
|
||||
price_unit: 210.0
|
||||
quantity: 1.0
|
||||
product_id: product.product_product_3
|
||||
uom_id: product.product_uom_unit
|
||||
journal_id: account.bank_journal
|
||||
partner_id: base.res_partner_12
|
||||
reference_type: none
|
||||
-
|
||||
I confirm the Invoice
|
||||
-
|
||||
!workflow {model: account.invoice, action: invoice_open, ref: invoice_for_completion_1}
|
||||
-
|
||||
I check that the invoice state is "Open"
|
||||
-
|
||||
!assert {model: account.invoice, id: invoice_for_completion_1}:
|
||||
- state == 'open'
|
||||
-
|
||||
I check that it is given the number "TBNK/%Y/0001"
|
||||
-
|
||||
!python {model: account.invoice}: |
|
||||
import datetime as dt
|
||||
invoice = model.browse(cr, uid, ref('invoice_for_completion_1'), context)
|
||||
assert invoice.number == dt.date.today().strftime('TBNK/%Y/0001')
|
||||
@@ -1,5 +1,5 @@
|
||||
-
|
||||
I fill in the field Bank Statement Label in a Partner
|
||||
-
|
||||
!record {model: res.partner, id: base.res_partner_6}:
|
||||
!record {model: res.partner, id: base.res_partner_4}:
|
||||
bank_statement_label: XXX66Z
|
||||
@@ -12,17 +12,14 @@
|
||||
I create a customer refund to be found by the completion.
|
||||
-
|
||||
!record {model: account.invoice, id: refund_for_completion_1}:
|
||||
account_id: account.a_pay
|
||||
company_id: base.main_company
|
||||
currency_id: base.EUR
|
||||
internal_number: CR0001
|
||||
invoice_line:
|
||||
- account_id: account.a_expense
|
||||
name: '[PCSC234] PC Assemble SC234'
|
||||
invoice_line_ids:
|
||||
- name: '[PCSC234] PC Assemble SC234'
|
||||
price_unit: 210.0
|
||||
quantity: 1.0
|
||||
product_id: product.product_product_3
|
||||
uos_id: product.product_uom_unit
|
||||
uom_id: product.product_uom_unit
|
||||
journal_id: account.expenses_journal
|
||||
partner_id: res_partner_12_child
|
||||
type: 'out_refund'
|
||||
@@ -37,7 +34,9 @@
|
||||
!assert {model: account.invoice, id: refund_for_completion_1}:
|
||||
- state == 'open'
|
||||
-
|
||||
I check that it is given the number "CR0001"
|
||||
I check that it is given the number "RTEXJ/%Y/0001"
|
||||
-
|
||||
!assert {model: account.invoice, id: refund_for_completion_1, string: Check CI number}:
|
||||
- number == 'CR0001'
|
||||
!python {model: account.invoice}: |
|
||||
import datetime as dt
|
||||
invoice = model.browse(cr, uid, ref('refund_for_completion_1'), context)
|
||||
assert invoice.number == dt.date.today().strftime('RTEXJ/%Y/0001')
|
||||
@@ -1,3 +1,14 @@
|
||||
-
|
||||
I import account minimal data
|
||||
-
|
||||
!python {model: account.invoice}: |
|
||||
openerp.tools.convert_file(cr,
|
||||
'account',
|
||||
openerp.modules.get_module_resource(
|
||||
'account',
|
||||
'demo',
|
||||
'account_invoice_demo.yml'),
|
||||
{}, 'init', False, 'test')
|
||||
-
|
||||
I check that my invoice is a supplier invoice
|
||||
-
|
||||
@@ -8,7 +19,7 @@
|
||||
-
|
||||
!python {model: account.invoice}: |
|
||||
self.write(cr, uid, ref('account.demo_invoice_0'), {
|
||||
'supplier_invoice_number': 'T2S12345'
|
||||
'reference': 'T2S12345'
|
||||
})
|
||||
-
|
||||
I check a second time that my invoice is still a supplier invoice
|
||||
@@ -23,7 +34,7 @@
|
||||
I check that the supplier number is there
|
||||
-
|
||||
!assert {model: account.invoice, id: account.demo_invoice_0, string: Check supplier number}:
|
||||
- supplier_invoice_number == 'T2S12345'
|
||||
- reference == 'T2S12345'
|
||||
-
|
||||
I check a third time that my invoice is still a supplier invoice
|
||||
-
|
||||
@@ -19,8 +19,9 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
#
|
||||
from openerp import fields, tools
|
||||
from openerp.modules import get_module_resource
|
||||
from openerp.tests import common
|
||||
import time
|
||||
from collections import namedtuple
|
||||
|
||||
name_completion_case = namedtuple(
|
||||
@@ -51,17 +52,17 @@ class base_completion(common.TransactionCase):
|
||||
|
||||
def setUp(self):
|
||||
super(base_completion, self).setUp()
|
||||
tools.convert_file(self.cr, 'account',
|
||||
get_module_resource('account', 'test',
|
||||
'account_minimal_test.xml'),
|
||||
{}, 'init', False, 'test')
|
||||
self.account_move_obj = self.env["account.move"]
|
||||
self.account_move_line_obj = \
|
||||
self.env["account.move.line"]
|
||||
self.company_a = self.browse_ref('base.main_company')
|
||||
self.profile_obj = self.registry("account.statement.profile")
|
||||
self.partner_obj = self.registry("res.partner")
|
||||
self.account_bank_statement_obj = self.registry(
|
||||
"account.bank.statement")
|
||||
self.account_bank_statement_line_obj = self.registry(
|
||||
"account.bank.statement.line")
|
||||
self.journal_id = self.ref("account.bank_journal")
|
||||
self.partner_id = self.ref('base.main_partner')
|
||||
self.journal = self.browse_ref("account.bank_journal")
|
||||
self.partner = self.browse_ref("base.res_partner_12")
|
||||
self.account_id = self.ref("account.a_recv")
|
||||
self.partner_id = self.ref("base.res_partner_12")
|
||||
|
||||
def test_name_completion(self):
|
||||
"""Test complete partner_id from statement line label
|
||||
@@ -69,54 +70,44 @@ class base_completion(common.TransactionCase):
|
||||
the partner appears in the statement line label
|
||||
"""
|
||||
self.completion_rule_id = self.ref(
|
||||
'account_statement_base_completion.'
|
||||
'bank_statement_completion_rule_3')
|
||||
'account_statement_base_import.bank_statement_completion_rule_3')
|
||||
# Create the profile
|
||||
self.profile_id = self.profile_obj.create(self.cr, self.uid, {
|
||||
"name": "TEST",
|
||||
"commission_account_id": self.account_id,
|
||||
"journal_id": self.journal_id,
|
||||
"rule_ids": [(6, 0, [self.completion_rule_id])]})
|
||||
self.journal.write({
|
||||
'used_for_import': True,
|
||||
'partner_id': self.partner.id,
|
||||
'commission_account_id': self.account_id,
|
||||
'receivable_account_id': self.account_id,
|
||||
'rule_ids': [(6, 0, [self.completion_rule_id])]
|
||||
})
|
||||
# Create a bank statement
|
||||
self.statement_id = self.account_bank_statement_obj.create(
|
||||
self.cr, self.uid, {
|
||||
"balance_end_real": 0.0,
|
||||
"balance_start": 0.0,
|
||||
"date": time.strftime('%Y-%m-%d'),
|
||||
"journal_id": self.journal_id,
|
||||
"profile_id": self.profile_id
|
||||
})
|
||||
self.move = self.account_move_obj.create({
|
||||
"date": fields.Date.today(),
|
||||
"journal_id": self.journal.id
|
||||
})
|
||||
|
||||
for case in NAMES_COMPLETION_CASES:
|
||||
self.partner_obj.write(
|
||||
self.cr, self.uid, self.partner_id, {'name': case.partner_name}
|
||||
)
|
||||
statement_line_id = self.account_bank_statement_line_obj.create(
|
||||
self.cr, self.uid, {
|
||||
'amount': 1000.0,
|
||||
'name': case.line_label,
|
||||
'ref': 'My ref',
|
||||
'statement_id': self.statement_id,
|
||||
})
|
||||
statement_line = self.account_bank_statement_line_obj.browse(
|
||||
self.cr, self.uid, statement_line_id)
|
||||
self.partner.write({'name': case.partner_name})
|
||||
self.move_line = self.account_move_line_obj.with_context(
|
||||
check_move_validity=False
|
||||
).create({
|
||||
'account_id': self.account_id,
|
||||
'credit': 1000.0,
|
||||
'name': case.line_label,
|
||||
'move_id': self.move.id,
|
||||
})
|
||||
self.assertFalse(
|
||||
statement_line.partner_id,
|
||||
self.move_line.partner_id,
|
||||
"Partner_id must be blank before completion")
|
||||
statement_obj = self.account_bank_statement_obj.browse(
|
||||
self.cr, self.uid, self.statement_id)
|
||||
statement_obj.button_auto_completion()
|
||||
statement_line = self.account_bank_statement_line_obj.browse(
|
||||
self.cr, self.uid, statement_line_id)
|
||||
self.move.button_auto_completion()
|
||||
if case.should_match:
|
||||
self.assertEquals(
|
||||
self.partner_id, statement_line.partner_id['id'],
|
||||
self.partner, self.move_line.partner_id,
|
||||
"Missing expected partner id after completion "
|
||||
"(partner_name: %s, line_name: %s)" %
|
||||
(case.partner_name, case.line_label))
|
||||
else:
|
||||
self.assertNotEquals(
|
||||
self.partner_id, statement_line.partner_id['id'],
|
||||
self.partner, self.move_line.partner_id,
|
||||
"Partner id should be empty after completion "
|
||||
"(partner_name: %s, line_name: %s)"
|
||||
% (case.partner_name, case.line_label))
|
||||
|
||||
@@ -23,38 +23,32 @@ import base64
|
||||
import inspect
|
||||
import os
|
||||
from openerp.tests import common
|
||||
from openerp import tools
|
||||
from openerp.modules import get_module_resource
|
||||
|
||||
|
||||
class TestCodaImport(common.TransactionCase):
|
||||
|
||||
def prepare(self):
|
||||
def setUp(self):
|
||||
super(TestCodaImport, self).setUp()
|
||||
self.company_a = self.browse_ref('base.main_company')
|
||||
self.profile_obj = self.registry("account.statement.profile")
|
||||
self.account_bank_statement_obj = self.registry(
|
||||
"account.bank.statement")
|
||||
# create the 2009 fiscal year since imported coda file reference
|
||||
# statement lines in 2009
|
||||
self.fiscalyear_id = self._create_fiscalyear("2011", self.company_a.id)
|
||||
tools.convert_file(self.cr, 'account',
|
||||
get_module_resource('account', 'test',
|
||||
'account_minimal_test.xml'),
|
||||
{}, 'init', False, 'test')
|
||||
self.account_move_obj = self.env["account.move"]
|
||||
self.account_move_line_obj = self.env["account.move.line"]
|
||||
self.account_id = self.ref("account.a_recv")
|
||||
self.journal_id = self.ref("account.bank_journal")
|
||||
self.import_wizard_obj = self.registry('credit.statement.import')
|
||||
self.profile_id = self.profile_obj.create(self.cr, self.uid, {
|
||||
"name": "BASE_PROFILE",
|
||||
"commission_account_id": self.account_id,
|
||||
"journal_id": self.journal_id,
|
||||
"import_type": "generic_csvxls_so"})
|
||||
|
||||
def _create_fiscalyear(self, year, company_id):
|
||||
fiscalyear_obj = self.registry("account.fiscalyear")
|
||||
fiscalyear_id = fiscalyear_obj.create(self.cr, self.uid, {
|
||||
"name": year,
|
||||
"code": year,
|
||||
"date_start": year + "-01-01",
|
||||
"date_stop": year + "-12-31",
|
||||
"company_id": company_id
|
||||
self.journal = self.browse_ref("account.bank_journal")
|
||||
self.import_wizard_obj = self.env['credit.statement.import']
|
||||
self.partner = self.browse_ref("base.res_partner_12")
|
||||
self.journal.write({
|
||||
'used_for_import': True,
|
||||
"import_type": "generic_csvxls_so",
|
||||
'partner_id': self.partner.id,
|
||||
'commission_account_id': self.account_id,
|
||||
'receivable_account_id': self.account_id,
|
||||
})
|
||||
fiscalyear_obj.create_period3(self.cr, self.uid, [fiscalyear_id])
|
||||
return fiscalyear_id
|
||||
|
||||
def _filename_to_abs_filename(self, file_name):
|
||||
dir_name = os.path.dirname(inspect.getfile(self.__class__))
|
||||
@@ -66,45 +60,35 @@ class TestCodaImport(common.TransactionCase):
|
||||
"""
|
||||
with open(file_name) as f:
|
||||
content = f.read()
|
||||
wizard_id = self.import_wizard_obj.create(self.cr, self.uid, {
|
||||
"profile_id": self.profile_id,
|
||||
self.wizard = self.import_wizard_obj.create({
|
||||
"journal_id": self.journal.id,
|
||||
'input_statement': base64.b64encode(content),
|
||||
'file_name': os.path.basename(file_name),
|
||||
})
|
||||
res = self.import_wizard_obj.import_statement(
|
||||
self.cr, self.uid, wizard_id)
|
||||
statement_id = self.account_bank_statement_obj.search(
|
||||
self.cr, self.uid, eval(res['domain']))
|
||||
return self.account_bank_statement_obj.browse(
|
||||
self.cr, self.uid, statement_id)[0]
|
||||
res = self.wizard.import_statement()
|
||||
return self.account_move_obj.browse(res['res_id'])
|
||||
|
||||
def test_simple_xls(self):
|
||||
"""Test import from xls
|
||||
"""
|
||||
self.prepare()
|
||||
file_name = self._filename_to_abs_filename(
|
||||
os.path.join("..", "data", "statement.xls"))
|
||||
statement = self._import_file(file_name)
|
||||
self._validate_imported_satement(statement)
|
||||
move = self._import_file(file_name)
|
||||
self._validate_imported_move(move)
|
||||
|
||||
def test_simple_csv(self):
|
||||
"""Test import from csv
|
||||
"""
|
||||
self.prepare()
|
||||
file_name = self._filename_to_abs_filename(
|
||||
os.path.join("..", "data", "statement.csv"))
|
||||
statement = self._import_file(file_name)
|
||||
self._validate_imported_satement(statement)
|
||||
move = self._import_file(file_name)
|
||||
self._validate_imported_move(move)
|
||||
|
||||
def _validate_imported_satement(self, statement):
|
||||
self.assertEqual("/", statement.name)
|
||||
self.assertEqual(0.0, statement.balance_start)
|
||||
self.assertEqual(0.0, statement.balance_end_real)
|
||||
self.assertEqual(3, len(statement.line_ids))
|
||||
self.assertTrue(statement.account_id)
|
||||
st_line_obj = statement.line_ids[1]
|
||||
def _validate_imported_move(self, move):
|
||||
self.assertEqual("/", move.name)
|
||||
self.assertEqual(5, len(move.line_ids))
|
||||
move_line = move.line_ids[4]
|
||||
# common infos
|
||||
self.assertEqual(st_line_obj.ref, "51065326")
|
||||
self.assertEqual(st_line_obj.date, "2011-03-02")
|
||||
self.assertEqual(st_line_obj.amount, 189.0)
|
||||
self.assertEqual(st_line_obj.name, "label b")
|
||||
self.assertEqual(move_line.date_maturity, "2011-03-02")
|
||||
self.assertEqual(move_line.credit, 189.0)
|
||||
self.assertEqual(move_line.name, "label b")
|
||||
|
||||
@@ -11,14 +11,14 @@
|
||||
<notebook position="inside">
|
||||
<page string="Import related infos" attrs="{'invisible': [('used_for_import', '=', False)]}">
|
||||
<group>
|
||||
<field name="launch_import_completion"/>
|
||||
<field name="launch_import_completion" attrs="{'required': ['used_for_import', '=', True]}"/>
|
||||
<field name="last_import_date" readonly="1"/>
|
||||
<field name="import_type"/>
|
||||
<field name="import_type" attrs="{'required': ['used_for_import', '=', True]}"/>
|
||||
</group>
|
||||
<group>
|
||||
<field name="commission_account_id"/>
|
||||
<field name="receivable_account_id"/>
|
||||
<field name="partner_id"/>
|
||||
<field name="commission_account_id" attrs="{'required': ['used_for_import', '=', True]}"/>
|
||||
<field name="receivable_account_id" attrs="{'required': ['used_for_import', '=', True]}"/>
|
||||
<field name="partner_id" attrs="{'required': ['used_for_import', '=', True]}"/>
|
||||
</group>
|
||||
<group>
|
||||
<button name="%(account_statement_base_import.move_importer_action)d"
|
||||
|
||||
@@ -84,11 +84,21 @@ class CreditPartnerStatementImporter(models.TransientModel):
|
||||
@api.multi
|
||||
def import_statement(self):
|
||||
"""This Function import credit card agency statement"""
|
||||
moves = self.env['account.move']
|
||||
for importer in self:
|
||||
journal = importer.journal_id
|
||||
ftype = self._check_extension(importer.file_name)
|
||||
journal.with_context(
|
||||
moves |= journal.with_context(
|
||||
file_name=importer.file_name).multi_move_import(
|
||||
importer.input_statement,
|
||||
ftype.replace('.', '')
|
||||
)
|
||||
xmlid = ('account', 'action_move_journal_line')
|
||||
action = self.env['ir.actions.act_window'].for_xml_id(*xmlid)
|
||||
if len(moves) > 1:
|
||||
action['domain'] = [('id', 'in', moves.ids)]
|
||||
else:
|
||||
ref = self.env.ref('account.view_move_form')
|
||||
action['views'] = [(ref.id, 'form')]
|
||||
action['res_id'] = moves.id if moves else False
|
||||
return action
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Author: Joel Grand-Guillaume
|
||||
# Copyright 2011-2012 Camptocamp SA
|
||||
# Copyright 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
from . import commission
|
||||
@@ -1,48 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Author: Joel Grand-Guillaume
|
||||
# Copyright 2011-2012 Camptocamp SA
|
||||
# Copyright 2013 Savoir-faire Linux (<http://www.savoirfairelinux.com>)
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
{
|
||||
'name': "Bank statement import - commissions",
|
||||
'version': '1.0',
|
||||
'author': "Camptocamp,Odoo Community Association (OCA)",
|
||||
'maintainer': 'Camptocamp',
|
||||
'category': 'Finance',
|
||||
'complexity': 'normal',
|
||||
'depends': [
|
||||
'account_statement_base_import'
|
||||
],
|
||||
'description': """
|
||||
This module brings commission support to bank statement imports. It computes
|
||||
the sum of a commission field on each transaction and creates a statement
|
||||
entry for it.
|
||||
""",
|
||||
'website': 'http://www.camptocamp.com',
|
||||
'data': [
|
||||
"statement_view.xml",
|
||||
"import_statement_view.xml",
|
||||
],
|
||||
'test': [],
|
||||
'installable': False,
|
||||
'images': [],
|
||||
'auto_install': False,
|
||||
'license': 'AGPL-3',
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
from openerp.tools.translate import _
|
||||
import datetime
|
||||
from openerp.osv import orm, fields
|
||||
|
||||
|
||||
def float_or_zero(val):
|
||||
return float(val) if val else 0.0
|
||||
|
||||
|
||||
class AccountStatementProfil(orm.Model):
|
||||
_inherit = "account.statement.profile"
|
||||
|
||||
def _write_extra_statement_lines(self, cr, uid, parser, result_row_list,
|
||||
profile, statement_id, context=None):
|
||||
"""Prepare the global commission line if there is one."""
|
||||
global_commission_amount = 0
|
||||
for row in parser.result_row_list:
|
||||
global_commission_amount += float_or_zero(
|
||||
row.get('commission_amount', '0.0'))
|
||||
if not global_commission_amount:
|
||||
return
|
||||
partner_id = profile.partner_id.id
|
||||
commission_account_id = profile.commission_account_id.id
|
||||
commission_analytic_id = profile.commission_analytic_id.id
|
||||
comm_values = {
|
||||
'name': 'IN ' + _('Commission line'),
|
||||
'date': parser.get_st_vals().get('date') or
|
||||
datetime.datetime.now(),
|
||||
'amount': global_commission_amount,
|
||||
'partner_id': partner_id,
|
||||
'type': 'general',
|
||||
'statement_id': statement_id,
|
||||
'account_id': commission_account_id,
|
||||
'ref': 'commission',
|
||||
'analytic_account_id': commission_analytic_id,
|
||||
# !! We set the already_completed so auto-completion will not
|
||||
# update those values!
|
||||
'already_completed': True,
|
||||
}
|
||||
st_obj = self.pool['account.bank.statement.line']
|
||||
st_obj.create(cr, uid, comm_values, context=context)
|
||||
|
||||
|
||||
class AccountStatementLineWithCommission(orm.Model):
|
||||
_inherit = "account.bank.statement.line"
|
||||
_columns = {
|
||||
'commission_amount': fields.sparse(
|
||||
type='float',
|
||||
string='Line Commission Amount',
|
||||
serialization_field='additionnal_bank_fields'),
|
||||
}
|
||||
|
||||
|
||||
class CreditPartnerStatementImporter(orm.TransientModel):
|
||||
_inherit = "credit.statement.import"
|
||||
|
||||
_columns = {
|
||||
'commission_account_id': fields.many2one(
|
||||
'account.account', 'Commission account'),
|
||||
'commission_analytic_id': fields.many2one(
|
||||
'account.analytic.account', 'Commission analytic account'),
|
||||
}
|
||||
|
||||
def onchange_profile_id(self, cr, uid, ids, profile_id, context=None):
|
||||
res = super(CreditPartnerStatementImporter, self).onchange_profile_id(
|
||||
cr, uid, ids, profile_id, context=context)
|
||||
if profile_id:
|
||||
p = self.pool["account.statement.profile"].browse(
|
||||
cr, uid, profile_id, context=context)
|
||||
res['value']['commission_account_id'] = p.commission_account_id.id
|
||||
res['value']['commission_a'] = p.commission_analytic_id.id
|
||||
return res
|
||||
@@ -1,53 +0,0 @@
|
||||
# Translation of OpenERP Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * account_statement_commission
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 7.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2014-01-21 11:58+0000\n"
|
||||
"PO-Revision-Date: 2014-01-21 11:58+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: account_statement_commission
|
||||
#: field:credit.statement.import,commission_account_id:0
|
||||
msgid "Commission account"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_commission
|
||||
#: model:ir.model,name:account_statement_commission.model_account_bank_statement_line
|
||||
msgid "Bank Statement Line"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_commission
|
||||
#: model:ir.model,name:account_statement_commission.model_credit_statement_import
|
||||
msgid "credit.statement.import"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_commission
|
||||
#: field:credit.statement.import,commission_analytic_id:0
|
||||
msgid "Commission analytic account"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_commission
|
||||
#: model:ir.model,name:account_statement_commission.model_account_statement_profile
|
||||
msgid "Statement Profile"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_commission
|
||||
#: field:account.bank.statement.line,commission_amount:0
|
||||
msgid "Line Commission Amount"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_statement_commission
|
||||
#: code:addons/account_statement_commission/commission.py:24
|
||||
#, python-format
|
||||
msgid "Commission line"
|
||||
msgstr ""
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
# Spanish translation for banking-addons
|
||||
# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014
|
||||
# This file is distributed under the same license as the banking-addons package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: banking-addons\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2014-01-21 11:58+0000\n"
|
||||
"PO-Revision-Date: 2014-06-05 22:32+0000\n"
|
||||
"Last-Translator: Pedro Manuel Baeza <pedro.baeza@gmail.com>\n"
|
||||
"Language-Team: Spanish <es@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2014-06-06 06:36+0000\n"
|
||||
"X-Generator: Launchpad (build 17031)\n"
|
||||
|
||||
#. module: account_statement_commission
|
||||
#: field:credit.statement.import,commission_account_id:0
|
||||
msgid "Commission account"
|
||||
msgstr "Cuenta de la comisión"
|
||||
|
||||
#. module: account_statement_commission
|
||||
#: model:ir.model,name:account_statement_commission.model_account_bank_statement_line
|
||||
msgid "Bank Statement Line"
|
||||
msgstr "Línea de extracto bancario"
|
||||
|
||||
#. module: account_statement_commission
|
||||
#: model:ir.model,name:account_statement_commission.model_credit_statement_import
|
||||
msgid "credit.statement.import"
|
||||
msgstr "credit.statement.import"
|
||||
|
||||
#. module: account_statement_commission
|
||||
#: field:credit.statement.import,commission_analytic_id:0
|
||||
msgid "Commission analytic account"
|
||||
msgstr "Cuenta analítica de la comisión"
|
||||
|
||||
#. module: account_statement_commission
|
||||
#: model:ir.model,name:account_statement_commission.model_account_statement_profile
|
||||
msgid "Statement Profile"
|
||||
msgstr "Perfil de extracto"
|
||||
|
||||
#. module: account_statement_commission
|
||||
#: field:account.bank.statement.line,commission_amount:0
|
||||
msgid "Line Commission Amount"
|
||||
msgstr "Importe de la línea de comisión"
|
||||
|
||||
#. module: account_statement_commission
|
||||
#: code:addons/account_statement_commission/commission.py:24
|
||||
#, python-format
|
||||
msgid "Commission line"
|
||||
msgstr "Línea de comisión"
|
||||
@@ -1,17 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="statement_importer_view" model="ir.ui.view">
|
||||
<field name="name">credit.statement.import.config.view</field>
|
||||
<field name="model">credit.statement.import</field>
|
||||
<field name="inherit_id" ref="account_statement_base_import.statement_importer_view" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/group/field[@name='journal_id']" position="after">
|
||||
<field name="commission_account_id" readonly="1"/>
|
||||
<field name="commission_analytic_id" readonly="1"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -1,20 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<record id="bank_statement_view_form" model="ir.ui.view">
|
||||
<field name="name">account_bank_statement.bank_statement.view_form</field>
|
||||
<field name="model">account.bank.statement</field>
|
||||
<field name="inherit_id" ref="account_statement_base_completion.bank_statement_view_form" />
|
||||
<field eval="20" name="priority"/>
|
||||
<field name="arch" type="xml">
|
||||
<data>
|
||||
<xpath expr="/form/sheet/notebook/page/field[@name='line_ids']/form/group/field[@name='label']" position="after">
|
||||
<field name="commission_amount" />
|
||||
</xpath>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
Reference in New Issue
Block a user