Merge pull request #250 from pedrobaeza/8.0-bank-payment-lines

[8.0] banking: Add support for grouping the payments, for deducing a refund from an invoice and remove storno
This commit is contained in:
Stefan Rijnhart (Opener)
2016-02-24 20:40:15 +01:00
96 changed files with 1650 additions and 2587 deletions

View File

@@ -1,22 +1,5 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Mandate module for openERP
# Copyright (C) 2014 Compassion CH (http://www.compassion.ch)
# @author: Cyril Sester <csester@compassion.ch>
#
# 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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# © 2014 Compassion CH - Cyril Sester <csester@compassion.ch>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import models

View File

@@ -1,29 +1,13 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Mandate module for openERP
# Copyright (C) 2014 Compassion CH (http://www.compassion.ch)
# @author: Cyril Sester <csester@compassion.ch>,
# Alexis de Lattre <alexis.delattre@akretion.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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# © 2014 Compassion CH - Cyril Sester <csester@compassion.ch>
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# © 2015 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Account Banking Mandate',
'summary': 'Banking mandates',
'version': '8.0.0.1.0',
'version': '8.0.0.2.0',
'license': 'AGPL-3',
'author': "Compassion CH, "
"Serv. Tecnol. Avanzados - Pedro M. Baeza, "
@@ -32,13 +16,14 @@
'website': 'https://github.com/OCA/bank-payment',
'category': 'Banking addons',
'depends': [
'account_payment',
'account_banking_payment_export',
],
'data': [
'views/account_banking_mandate_view.xml',
'views/account_invoice_view.xml',
'views/account_payment_view.xml',
'views/res_partner_bank_view.xml',
'views/bank_payment_line_view.xml',
'data/mandate_reference_sequence.xml',
'data/report_paperformat.xml',
'security/mandate_security.xml',

View File

@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-02-13 19:13+0000\n"
"PO-Revision-Date: 2016-02-13 19:13+0000\n"
"POT-Creation-Date: 2016-02-16 07:21+0000\n"
"PO-Revision-Date: 2016-02-16 07:21+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -65,7 +65,12 @@ msgstr "Cuenta bancaria"
#. module: account_banking_mandate
#: model:ir.model,name:account_banking_mandate.model_res_partner_bank
msgid "Bank Accounts"
msgstr "Cuentas bancarias"
msgstr "Cuentas de banco"
#. module: account_banking_mandate
#: model:ir.model,name:account_banking_mandate.model_bank_payment_line
msgid "Bank Payment Lines"
msgstr "Líneas de pago bancario"
#. module: account_banking_mandate
#: view:website:account_banking_mandate.account_banking_mandate_document
@@ -119,13 +124,13 @@ msgid "Cancelled"
msgstr "Cancelado"
#. module: account_banking_mandate
#: code:addons/account_banking_mandate/models/account_banking_mandate.py:110
#: code:addons/account_banking_mandate/models/account_banking_mandate.py:93
#, python-format
msgid "Cannot validate the mandate '%s' because it is not attached to a bank account."
msgstr "No se puede validar el mandato '%s' porque no tiene ninguna cuenta bancaria asociada."
#. module: account_banking_mandate
#: code:addons/account_banking_mandate/models/account_banking_mandate.py:106
#: code:addons/account_banking_mandate/models/account_banking_mandate.py:89
#, python-format
msgid "Cannot validate the mandate '%s' without a date of signature."
msgstr "No se puede validar el mandato '%s' sin una fecha de firma."
@@ -145,11 +150,6 @@ msgstr "Creado por"
msgid "Created on"
msgstr "Creado en"
#. module: account_banking_mandate
#: view:payment.order:account_banking_mandate.view_mandate_payment_order_form
msgid "DD Mandate"
msgstr "Mandato bancario"
#. module: account_banking_mandate
#: view:res.partner:account_banking_mandate.mandate_partner_form
#: view:res.partner.bank:account_banking_mandate.mandate_partner_bank_tree
@@ -299,7 +299,9 @@ msgid "Location and sign: _______________________, at ______ from ____________ f
msgstr "Lugar y fecha de la firma: _______________________, a ______ de ____________ de"
#. module: account_banking_mandate
#: view:bank.payment.line:account_banking_mandate.bank_payment_line_tree
#: model:ir.actions.report.xml,name:account_banking_mandate.report_account_banking_mandate
#: view:payment.order:account_banking_mandate.view_mandate_payment_order_form
msgid "Mandate"
msgstr "Mandato SEPA"
@@ -319,19 +321,19 @@ msgid "Mandate Validated"
msgstr "Mandato validado"
#. module: account_banking_mandate
#: code:addons/account_banking_mandate/models/account_banking_mandate.py:152
#: code:addons/account_banking_mandate/models/account_banking_mandate.py:135
#, python-format
msgid "Mandate should be in cancel state"
msgstr "El mandato debe estar en estado cancelado"
#. module: account_banking_mandate
#: code:addons/account_banking_mandate/models/account_banking_mandate.py:140
#: code:addons/account_banking_mandate/models/account_banking_mandate.py:123
#, python-format
msgid "Mandate should be in draft or valid state"
msgstr "El mandato debe estar en estado borrador o validado"
#. module: account_banking_mandate
#: code:addons/account_banking_mandate/models/account_banking_mandate.py:131
#: code:addons/account_banking_mandate/models/account_banking_mandate.py:114
#, python-format
msgid "Mandate should be in draft state"
msgstr "El mandato debe estar en estado borrador"
@@ -459,19 +461,19 @@ msgid "Summary"
msgstr "Resumen"
#. module: account_banking_mandate
#: code:addons/account_banking_mandate/models/account_banking_mandate.py:92
#: code:addons/account_banking_mandate/models/account_banking_mandate.py:75
#, python-format
msgid "The date of signature of mandate '%s' is in the future !"
msgstr "La fecha de firma del mandato '%s' no puede ser superior a la actual"
#. module: account_banking_mandate
#: code:addons/account_banking_mandate/models/account_banking_mandate.py:97
#: code:addons/account_banking_mandate/models/account_banking_mandate.py:80
#, python-format
msgid "The mandate '%s' can't have a date of last debit before the date of signature."
msgstr "El mandato '%s' no puede tener una fecha de último cobro antes de la fecha de firma."
#. module: account_banking_mandate
#: code:addons/account_banking_mandate/models/payment_line.py:68
#: code:addons/account_banking_mandate/models/payment_line.py:51
#, python-format
msgid "The payment line with reference '%s' has the bank account '%s' which is not attached to the mandate '%s' (this mandate is attached to the bank account '%s')."
msgstr "La línea de pago con referencia '%s' tiene la cuenta bancaria '%s', que no está puesta en el mandato '%s' (este mandato tiene como cuenta bancaria '%s')."

View File

@@ -1,26 +1,10 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Mandate module for openERP
# Copyright (C) 2014 Compassion CH (http://www.compassion.ch)
# @author: Cyril Sester <csester@compassion.ch>,
# Alexis de Lattre <alexis.delattre@akretion.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 account_banking_mandate
from . import account_invoice
from . import res_partner_bank
from . import payment_line
# -*- coding: utf-8 -*-
# © 2014 Compassion CH - Cyril Sester <csester@compassion.ch>
# © 2015 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import account_banking_mandate
from . import account_invoice
from . import res_partner_bank
from . import payment_line
from . import bank_payment_line

View File

@@ -1,34 +1,17 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Mandate module for openERP
# Copyright (C) 2014 Compassion CH (http://www.compassion.ch)
# @author: Cyril Sester <csester@compassion.ch>,
# Alexis de Lattre <alexis.delattre@akretion.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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# © 2014 Compassion CH - Cyril Sester <csester@compassion.ch>
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# © 2015 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, exceptions, api, _
class AccountBankingMandate(models.Model):
''' The banking mandate is attached to a bank account and represents an
authorization that the bank account owner gives to a company for a
specific operation (such as direct debit)
'''
"""The banking mandate is attached to a bank account and represents an
authorization that the bank account owner gives to a company for a
specific operation (such as direct debit)
"""
_name = 'account.banking.mandate'
_description = "A generic banking mandate"
_rec_name = 'unique_mandate_reference'

View File

@@ -1,25 +1,8 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Mandate module for openERP
# Copyright (C) 2014 Compassion CH (http://www.compassion.ch)
# @author: Cyril Sester <csester@compassion.ch>,
# Alexis de Lattre <alexis.delattre@akretion.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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# © 2014 Compassion CH - Cyril Sester <csester@compassion.ch>
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields

View File

@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# © 2014 Compassion CH - Cyril Sester <csester@compassion.ch>
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# © 2015 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
class BankPaymentLine(models.Model):
_inherit = 'bank.payment.line'
mandate_id = fields.Many2one(
comodel_name='account.banking.mandate', string='Direct Debit Mandate',
related='payment_line_ids.mandate_id')
@api.model
def same_fields_payment_line_and_bank_payment_line(self):
res = super(BankPaymentLine, self).\
same_fields_payment_line_and_bank_payment_line()
res.append('mandate_id')
return res

View File

@@ -1,74 +1,59 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Mandate module for openERP
# Copyright (C) 2014 Compassion CH (http://www.compassion.ch)
# @author: Cyril Sester <csester@compassion.ch>,
# Alexis de Lattre <alexis.delattre@akretion.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 openerp import models, fields, api, exceptions, _
class PaymentLine(models.Model):
_inherit = 'payment.line'
mandate_id = fields.Many2one(
comodel_name='account.banking.mandate', string='Direct Debit Mandate',
domain=[('state', '=', 'valid')])
@api.model
def create(self, vals=None):
"""If the customer invoice has a mandate, take it
otherwise, take the first valid mandate of the bank account
"""
if vals is None:
vals = {}
partner_bank_id = vals.get('bank_id')
move_line_id = vals.get('move_line_id')
if (self.env.context.get('search_payment_order_type') == 'debit' and
'mandate_id' not in vals):
if move_line_id:
line = self.env['account.move.line'].browse(move_line_id)
if (line.invoice and line.invoice.type == 'out_invoice' and
line.invoice.mandate_id):
vals.update({
'mandate_id': line.invoice.mandate_id.id,
'bank_id': line.invoice.mandate_id.partner_bank_id.id,
})
if partner_bank_id and 'mandate_id' not in vals:
mandates = self.env['account.banking.mandate'].search(
[('partner_bank_id', '=', partner_bank_id),
('state', '=', 'valid')])
if mandates:
vals['mandate_id'] = mandates[0].id
return super(PaymentLine, self).create(vals)
@api.one
@api.constrains('mandate_id', 'bank_id')
def _check_mandate_bank_link(self):
if (self.mandate_id and self.bank_id and
self.mandate_id.partner_bank_id.id !=
self.bank_id.id):
raise exceptions.Warning(
_("The payment line with reference '%s' has the bank account "
"'%s' which is not attached to the mandate '%s' (this "
"mandate is attached to the bank account '%s').") %
(self.name,
self.bank_id.name_get()[0][1],
self.mandate_id.unique_mandate_reference,
self.mandate_id.partner_bank_id.name_get()[0][1]))
# -*- coding: utf-8 -*-
# © 2014 Compassion CH - Cyril Sester <csester@compassion.ch>
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# © 2015 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api, exceptions, _
class PaymentLine(models.Model):
_inherit = 'payment.line'
mandate_id = fields.Many2one(
comodel_name='account.banking.mandate', string='Direct Debit Mandate',
domain=[('state', '=', 'valid')])
@api.model
def create(self, vals=None):
"""If the customer invoice has a mandate, take it
otherwise, take the first valid mandate of the bank account
"""
if vals is None:
vals = {}
partner_bank_id = vals.get('bank_id')
move_line_id = vals.get('move_line_id')
if (self.env.context.get('search_payment_order_type') == 'debit' and
'mandate_id' not in vals):
if move_line_id:
line = self.env['account.move.line'].browse(move_line_id)
if (line.invoice and line.invoice.type == 'out_invoice' and
line.invoice.mandate_id):
vals.update({
'mandate_id': line.invoice.mandate_id.id,
'bank_id': line.invoice.mandate_id.partner_bank_id.id,
})
if partner_bank_id and 'mandate_id' not in vals:
mandates = self.env['account.banking.mandate'].search(
[('partner_bank_id', '=', partner_bank_id),
('state', '=', 'valid')])
if mandates:
vals['mandate_id'] = mandates[0].id
return super(PaymentLine, self).create(vals)
@api.one
@api.constrains('mandate_id', 'bank_id')
def _check_mandate_bank_link(self):
if (self.mandate_id and self.bank_id and
self.mandate_id.partner_bank_id.id !=
self.bank_id.id):
raise exceptions.Warning(
_("The payment line with reference '%s' has the bank account "
"'%s' which is not attached to the mandate '%s' (this "
"mandate is attached to the bank account '%s').") %
(self.name,
self.env['res.partner.bank'].name_get(
[self.bank_id.id])[0][1],
self.mandate_id.unique_mandate_reference,
self.env['res.partner.bank'].name_get(
[self.mandate_id.partner_bank_id.id])[0][1]))

View File

@@ -1,25 +1,7 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Mandate module for openERP
# Copyright (C) 2014 Compassion CH (http://www.compassion.ch)
# @author: Cyril Sester <csester@compassion.ch>,
# Alexis de Lattre <alexis.delattre@akretion.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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# © 2014 Compassion CH - Cyril Sester <csester@compassion.ch>
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields

View File

@@ -10,14 +10,18 @@
<record id="view_mandate_payment_order_form" model="ir.ui.view">
<field name="name">mandate.payment.order.form</field>
<field name="model">payment.order</field>
<field name="inherit_id" ref="account_payment.view_payment_order_form"/>
<field name="inherit_id" ref="account_banking_payment_export.view_payment_order_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='line_ids']/form/notebook/page/group/field[@name='bank_id']" position="after">
<field name="mandate_id" domain="[('partner_bank_id', '=', bank_id), ('state', '=', 'valid')]" invisible="context.get('search_payment_order_type')!='debit'" context="{'default_partner_bank_id': bank_id}"/>
<xpath expr="//field[@name='line_ids']/form//field[@name='bank_id']" position="after">
<field name="mandate_id"
domain="[('partner_bank_id', '=', bank_id), ('state', '=', 'valid')]"
invisible="context.get('search_payment_order_type')!='debit'"
context="{'default_partner_bank_id': bank_id}"/>
<newline />
</xpath>
<xpath expr="//field[@name='line_ids']/tree/field[@name='bank_id']" position="after">
<field name="mandate_id" string="DD Mandate" invisible="context.get('search_payment_order_type')!='debit'"/>
<field name="mandate_id" string="Mandate"
invisible="context.get('search_payment_order_type')!='debit'"/>
</xpath>
</field>
</record>

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 Akretion (http://www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
-->
<openerp>
<data>
<record id="bank_payment_line_form" model="ir.ui.view">
<field name="name">banking.mandate.bank.payment.line.form</field>
<field name="model">bank.payment.line</field>
<field name="inherit_id" ref="account_banking_payment_export.bank_payment_line_form"/>
<field name="arch" type="xml">
<field name="bank_id" position="after">
<field name="mandate_id"
invisible="context.get('search_payment_order_type')!='debit'"/>
</field>
</field>
</record>
<record id="bank_payment_line_tree" model="ir.ui.view">
<field name="name">banking.mandate.bank.payment.line.tree</field>
<field name="model">bank.payment.line</field>
<field name="inherit_id" ref="account_banking_payment_export.bank_payment_line_tree"/>
<field name="arch" type="xml">
<field name="bank_id" position="after">
<field name="mandate_id" string="Mandate"
invisible="context.get('search_payment_order_type')!='debit'"/>
</field>
</field>
</record>
</data>
</openerp>

View File

@@ -1,24 +1,7 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# PAIN Base module for Odoo
# Copyright (C) 2013 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# © 2013 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import models
from .post_install import set_default_initiating_party

View File

@@ -1,28 +1,12 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# PAIN base module for Odoo
# Copyright (C) 2013-2015 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# © 2013-2015 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Account Banking PAIN Base Module',
'summary': 'Base module for PAIN file generation',
'version': '8.0.0.2.0',
'version': '8.0.0.3.0',
'license': 'AGPL-3',
'author': "Akretion, "
"Noviat, "
@@ -37,6 +21,7 @@
},
'data': [
'views/payment_line_view.xml',
'views/bank_payment_line_view.xml',
'views/payment_mode_view.xml',
'views/res_company_view.xml',
],

View File

@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-10-31 22:52+0000\n"
"PO-Revision-Date: 2014-10-31 22:52+0000\n"
"POT-Creation-Date: 2016-02-16 07:24+0000\n"
"PO-Revision-Date: 2016-02-16 07:24+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -16,13 +16,23 @@ msgstr ""
"Plural-Forms: \n"
#. module: account_banking_pain_base
#: code:addons/account_banking_pain_base/models/banking_export_pain.py:74
#: model:ir.model,name:account_banking_pain_base.model_res_partner_bank
msgid "Bank Accounts"
msgstr "Cuentas de banco"
#. module: account_banking_pain_base
#: model:ir.model,name:account_banking_pain_base.model_bank_payment_line
msgid "Bank Payment Lines"
msgstr "Líneas de pago bancario"
#. module: account_banking_pain_base
#: code:addons/account_banking_pain_base/models/banking_export_pain.py:61
#, python-format
msgid "Cannot compute the '%s' of the Payment Line with reference '%s'."
msgstr "No se puede procesar el campo '%s' de la línea de pago con referencia '%s'."
#. module: account_banking_pain_base
#: code:addons/account_banking_pain_base/models/banking_export_pain.py:80
#: code:addons/account_banking_pain_base/models/banking_export_pain.py:66
#, python-format
msgid "Cannot compute the '%s'."
msgstr "No se puede procesar el campo '%s'."
@@ -38,23 +48,11 @@ msgid "Convert to ASCII"
msgstr "Convertir a ASCII"
#. module: account_banking_pain_base
#: code:addons/account_banking_pain_base/models/banking_export_pain.py:47
#: code:addons/account_banking_pain_base/models/banking_export_pain.py:73
#: code:addons/account_banking_pain_base/models/banking_export_pain.py:79
#: code:addons/account_banking_pain_base/models/banking_export_pain.py:89
#: code:addons/account_banking_pain_base/models/banking_export_pain.py:124
#: code:addons/account_banking_pain_base/models/banking_export_pain.py:303
#: code:addons/account_banking_pain_base/models/banking_export_pain.py:385
#: code:addons/account_banking_pain_base/models/banking_export_pain.py:280
#, python-format
msgid "Error:"
msgstr "Error:"
#. module: account_banking_pain_base
#: code:addons/account_banking_pain_base/models/banking_export_pain.py:83
#, python-format
msgid "Field type error:"
msgstr ""
#. module: account_banking_pain_base
#: selection:payment.line,priority:0
msgid "High"
@@ -70,13 +68,24 @@ msgstr "ID"
msgid "If active, Odoo will convert each accented caracter to the corresponding unaccented caracter, so that only ASCII caracters are used in the generated PAIN file."
msgstr "Si está marcado, Odoo convertirá cada carácter acentuado en el correspondiente carácter no acentuado, para que sólo se usen caracteres ASCII en el archivo PAIN generado."
#. module: account_banking_pain_base
#: field:res.company,initiating_party_identifier:0
msgid "Initiating Party Identifier"
msgstr "Identificador del iniciador de la transacción"
#. module: account_banking_pain_base
#: field:res.company,initiating_party_issuer:0
msgid "Initiating Party Issuer"
msgstr "Emisor de la transacción"
#. module: account_banking_pain_base
#: code:addons/account_banking_pain_base/models/banking_export_pain.py:386
#: code:addons/account_banking_pain_base/models/banking_export_pain.py:254
#, python-format
msgid "Missing 'Initiating Party Issuer' and/or 'Initiating Party Identifier' for the company '%s'. Both fields must have a value."
msgstr "Falta el 'Emisor de la transacción' y/o 'Identificador del iniciador de la transacción' para la compañía '%s'. Ambos campos deben tener un valor."
#. module: account_banking_pain_base
#: code:addons/account_banking_pain_base/models/banking_export_pain.py:356
#, python-format
msgid "Missing 'Structured Communication Type' on payment line with reference '%s'."
msgstr "Falta el campo 'Tipo de comunicación estructurada' en la línea de pago con referencia '%s'."
@@ -106,37 +115,43 @@ msgstr "Modo de pago"
msgid "Priority"
msgstr "Prioridad"
#. module: account_banking_pain_base
#: code:addons/account_banking_pain_base/models/banking_export_pain.py:130
#, python-format
msgid "SEPA File"
msgstr "Archivo SEPA"
#. module: account_banking_pain_base
#: field:payment.line,struct_communication_type:0
msgid "Structured Communication Type"
msgstr "Tipo de comunicación estructurada"
#. module: account_banking_pain_base
#: code:addons/account_banking_pain_base/models/banking_export_pain.py:90
#: code:addons/account_banking_pain_base/models/banking_export_pain.py:74
#, python-format
msgid "The '%s' is empty or 0. It should have a non-null value."
msgstr "'%s' está vacío o es 0. Debería tener un valor no nulo."
#. module: account_banking_pain_base
#: code:addons/account_banking_pain_base/models/banking_export_pain.py:304
#: code:addons/account_banking_pain_base/models/banking_export_pain.py:281
#, python-format
msgid "The bank account with IBAN '%s' of partner '%s' must have an associated BIC because it is a cross-border SEPA operation."
msgstr "La cuenta bancaria con IBAN '%s' de la empresa '%s' debe tener un BIC asociado, porque es una operación SEPA transfronteriza."
#. module: account_banking_pain_base
#: code:addons/account_banking_pain_base/models/banking_export_pain.py:125
#: code:addons/account_banking_pain_base/models/banking_export_pain.py:95
#, python-format
msgid "The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s"
msgstr "El archivo XML generado no se puede validar contra la definición de esquema XML oficial. El archivo XML generado el error completo se ha escrito en los registros del servidor. Aquí está el error, que le puede dar una idea de la causa del problema : %s"
#. module: account_banking_pain_base
#: code:addons/account_banking_pain_base/models/banking_export_pain.py:84
#: code:addons/account_banking_pain_base/models/banking_export_pain.py:69
#, python-format
msgid "The type of the field '%s' is %s. It should be a string or unicode."
msgstr "El tipo del campo '%s' es %s. Debería ser una cadena o unicode."
#. module: account_banking_pain_base
#: code:addons/account_banking_pain_base/models/banking_export_pain.py:47
#: code:addons/account_banking_pain_base/models/banking_export_pain.py:34
#, python-format
msgid "This IBAN is not valid : %s"
msgstr "Este IBAN no es válido: %s"
@@ -146,6 +161,11 @@ msgstr "Este IBAN no es válido: %s"
msgid "This field will be used as the 'Instruction Priority' in the generated PAIN file."
msgstr "Este campo se usará como 'Prioridad de instrucción' en el archivo PAIN generado."
#. module: account_banking_pain_base
#: help:res.company,initiating_party_identifier:0
msgid "This will be used as the 'Initiating Party Identifier' in the PAIN files generated by Odoo."
msgstr "Esto se usará como el 'Identificador del iniciador de la transacción' en los archivos PAIN generados por Odoo."
#. module: account_banking_pain_base
#: help:res.company,initiating_party_issuer:0
msgid "This will be used as the 'Initiating Party Issuer' in the PAIN files generated by Odoo."

View File

@@ -1,23 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2015 Akretion (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.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/>.
#
##############################################################################
# © 2015 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp.addons.account_banking_pain_base.post_install\
import set_default_initiating_party

View File

@@ -1,26 +1,9 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# PAIN Base module for Odoo
# Copyright (C) 2013 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# © 2013 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import payment_line
from . import bank_payment_line
from . import payment_mode
from . import res_company
from . import banking_export_pain

View File

@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# © 2013-2015 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
class BankPaymentLine(models.Model):
_inherit = 'bank.payment.line'
priority = fields.Selection(
related='payment_line_ids.priority', string='Priority')
struct_communication_type = fields.Selection(
related='payment_line_ids.struct_communication_type',
string='Structured Communication Type')
@api.model
def same_fields_payment_line_and_bank_payment_line(self):
res = super(BankPaymentLine, self).\
same_fields_payment_line_and_bank_payment_line()
res += ['priority', 'struct_communication_type']
return res

View File

@@ -1,24 +1,7 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# PAIN Base module for Odoo
# Copyright (C) 2013-2015 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# © 2013-2015 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, api, _
from openerp.exceptions import Warning

View File

@@ -1,24 +1,7 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# PAIN Base module for Odoo
# Copyright (C) 2013-2015 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# © 2013-2015 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api

View File

@@ -1,24 +1,7 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# PAIN Base module for Odoo
# Copyright (C) 2013-2015 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# © 2013-2015 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields

View File

@@ -1,26 +1,8 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# PAIN Base module for Odoo
# Copyright (C) 2013-2015 Akretion (http://www.akretion.com)
# Copyright (C) 2013 Noviat (http://www.noviat.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# @author: Luc de Meyer (Noviat)
#
# 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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# © 2013-2015 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# © 2013 Noviat (http://www.noviat.com) - Luc de Meyer
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
import logging

View File

@@ -1,22 +1,7 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) ACSONE SA/NV (<http://acsone.eu>).
#
# 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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# © 2013 ACSONE SA/NV (<http://acsone.eu>)
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields

View File

@@ -1,24 +1,7 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# PAIN Base module for Odoo
# Copyright (C) 2015 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# © 2015 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import SUPERUSER_ID

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 Akretion (http://www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
-->
<openerp>
<data>
<record id="bank_payment_line_form" model="ir.ui.view">
<field name="name">pain.base.bank.payment.line.form</field>
<field name="model">bank.payment.line</field>
<field name="inherit_id" ref="account_banking_payment_export.bank_payment_line_form"/>
<field name="arch" type="xml">
<field name="bank_id" position="after">
<field name="priority"/>
</field>
<field name="state" position="after">
<field name="struct_communication_type" attrs="{'invisible': [('state', '!=', 'structured')]}"/>
</field>
</field>
</record>
</data>
</openerp>

View File

@@ -7,25 +7,10 @@
<openerp>
<data>
<record id="view_payment_line_form" model="ir.ui.view">
<field name="name">pain.base.payment.line.form</field>
<field name="model">payment.line</field>
<field name="inherit_id" ref="account_payment.view_payment_line_form"/>
<field name="arch" type="xml">
<field name="bank_id" position="after">
<field name="priority"/>
<newline />
</field>
<field name="state" position="after">
<field name="struct_communication_type" attrs="{'invisible': [('state', '!=', 'structured')], 'required': [('state', '=', 'structured')]}"/>
</field>
</field>
</record>
<record id="view_payment_order_form" model="ir.ui.view">
<field name="name">pain.base.payment.line.inside.order.form</field>
<field name="model">payment.order</field>
<field name="inherit_id" ref="account_payment.view_payment_order_form"/>
<field name="inherit_id" ref="account_banking_payment_export.view_payment_order_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='line_ids']/form//field[@name='bank_id']" position="after">
<field name="priority"/>

View File

@@ -1,30 +1,13 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).
# (C) 2011 - 2013 Therp BV (<http://therp.nl>).
# (C) 2013 - 2014 ACSONE SA (<http://acsone.eu>).
#
# All other contributions are (C) by their respective contributors
#
# 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/>.
#
##############################################################################
# © 2009 EduSense BV (<http://www.edusense.nl>)
# © 2011-2013 Therp BV (<http://therp.nl>)
# © 2013-2014 ACSONE SA (<http://acsone.eu>).
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Account Banking - Payments Export Infrastructure',
'version': '8.0.0.1.166',
'version': '8.0.0.2.0',
'license': 'AGPL-3',
'author': "ACSONE SA/NV, "
"Therp BV, "
@@ -41,9 +24,11 @@
'views/account_payment.xml',
'views/payment_mode.xml',
'views/payment_mode_type.xml',
'views/bank_payment_line.xml',
'wizard/bank_payment_manual.xml',
'wizard/payment_order_create_view.xml',
'data/payment_mode_type.xml',
'data/bank_payment_line_seq.xml',
'workflow/account_payment.xml',
'security/ir.model.access.csv',
],

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 Akretion (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
-->
<openerp>
<data>
<record id="bank_payment_line_seq_type" model="ir.sequence.type">
<field name="name">Bank Payment Line</field>
<field name="code">bank.payment.line</field>
</record>
<record id="bank_payment_line_seq" model="ir.sequence">
<field name="name">Bank Payment Line</field>
<field name="code">bank.payment.line</field>
<field name="prefix">L</field>
<field name="padding">5</field>
<field name="number_next">1</field>
<field name="company_id" eval="False"/>
</record>
</data>
</openerp>

View File

@@ -86,6 +86,7 @@
<field name="company_id" ref="base.main_company"/>
<field name="type" ref="account_banking_payment_export.manual_bank_tranfer"/>
<field name="sale_ok" eval="False"/>
<field name="default_journal_ids" search="[('type', 'in', ('purchase', 'purchase_refund'))]"/>
</record>
<record id="payment_mode_3" model="payment.mode">
@@ -95,6 +96,7 @@
<field name="company_id" ref="base.main_company"/>
<field name="type" ref="account_banking_payment_export.manual_bank_tranfer"/>
<field name="sale_ok" eval="False"/>
<field name="default_journal_ids" search="[('type', 'in', ('purchase', 'purchase_refund'))]"/>
</record>

View File

@@ -1,276 +0,0 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_banking_payment_export
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-07-02 10:51+0000\n"
"PO-Revision-Date: 2015-07-02 10:51+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_banking_payment_export
#: field:payment.mode,active:0
#: field:payment.mode.type,active:0
msgid "Active"
msgstr ""
#. module: account_banking_payment_export
#: view:payment.manual:account_banking_payment_export.view_payment_manual_form
msgid "Cancel"
msgstr ""
#. module: account_banking_payment_export
#: field:payment.mode.type,code:0
msgid "Code"
msgstr ""
#. module: account_banking_payment_export
#: field:payment.manual,create_uid:0
#: field:payment.mode.type,create_uid:0
msgid "Created by"
msgstr ""
#. module: account_banking_payment_export
#: field:payment.manual,create_date:0
#: field:payment.mode.type,create_date:0
msgid "Created on"
msgstr ""
#. module: account_banking_payment_export
#: selection:payment.mode.type,payment_order_type:0
msgid "Debit"
msgstr ""
#. module: account_banking_payment_export
#: selection:payment.order,payment_order_type:0
msgid "Direct debit"
msgstr ""
#. module: account_banking_payment_export
#: code:addons/account_banking_payment_export/wizard/payment_order_create.py:121
#, python-format
msgid "Entry Lines"
msgstr ""
#. module: account_banking_payment_export
#: code:addons/account_banking_payment_export/models/account_payment.py:68
#, python-format
msgid "Error"
msgstr ""
#. module: account_banking_payment_export
#: field:payment.mode,type:0
msgid "Export type"
msgstr ""
#. module: account_banking_payment_export
#: field:payment.manual,id:0
#: field:payment.mode.type,id:0
msgid "ID"
msgstr ""
#. module: account_banking_payment_export
#: model:ir.model,name:account_banking_payment_export.model_account_invoice
msgid "Invoice"
msgstr ""
#. module: account_banking_payment_export
#: view:account.move.line:account_banking_payment_export.payment_order_populate_view_move_line_tree
msgid "Journal Entry"
msgstr ""
#. module: account_banking_payment_export
#: view:account.move.line:account_banking_payment_export.payment_order_populate_view_move_line_tree
#: model:ir.model,name:account_banking_payment_export.model_account_move_line
msgid "Journal Items"
msgstr ""
#. module: account_banking_payment_export
#: field:payment.manual,write_uid:0
#: field:payment.mode.type,write_uid:0
msgid "Last Updated by"
msgstr ""
#. module: account_banking_payment_export
#: field:payment.manual,write_date:0
#: field:payment.mode.type,write_date:0
msgid "Last Updated on"
msgstr ""
#. module: account_banking_payment_export
#: view:payment.manual:account_banking_payment_export.view_payment_manual_form
msgid "Manual payment"
msgstr ""
#. module: account_banking_payment_export
#: field:payment.mode.type,name:0
msgid "Name"
msgstr ""
#. module: account_banking_payment_export
#: view:payment.mode:account_banking_payment_export.view_payment_mode_form_inherit
#: field:payment.mode,note:0
msgid "Note"
msgstr ""
#. module: account_banking_payment_export
#: field:payment.mode.type,payment_order_type:0
msgid "Order type"
msgstr ""
#. module: account_banking_payment_export
#: selection:payment.mode.type,payment_order_type:0
#: selection:payment.order,payment_order_type:0
msgid "Payment"
msgstr ""
#. module: account_banking_payment_export
#: model:ir.actions.act_window,name:account_banking_payment_export.action_payment_mode_type
#: model:ir.ui.menu,name:account_banking_payment_export.menu_payment_mode_type
msgid "Payment Export Types"
msgstr ""
#. module: account_banking_payment_export
#: model:ir.model,name:account_banking_payment_export.model_payment_mode
msgid "Payment Mode"
msgstr ""
#. module: account_banking_payment_export
#: model:ir.model,name:account_banking_payment_export.model_payment_mode_type
msgid "Payment Mode Type"
msgstr ""
#. module: account_banking_payment_export
#: model:ir.model,name:account_banking_payment_export.model_payment_order
msgid "Payment Order"
msgstr ""
#. module: account_banking_payment_export
#: code:addons/account_banking_payment_export/models/account_payment.py:53
#, python-format
msgid "Payment Order Export"
msgstr ""
#. module: account_banking_payment_export
#: code:addons/account_banking_payment_export/wizard/payment_order_create.py:213
#, python-format
msgid "Payment Orders"
msgstr ""
#. module: account_banking_payment_export
#: view:payment.mode.type:account_banking_payment_export.view_payment_mode_type_form
#: help:payment.mode.type,name:0
msgid "Payment Type"
msgstr ""
#. module: account_banking_payment_export
#: view:payment.mode.type:account_banking_payment_export.view_payment_mode_type_tree
msgid "Payment Types"
msgstr ""
#. module: account_banking_payment_export
#: field:payment.order,payment_order_type:0
msgid "Payment order type"
msgstr ""
#. module: account_banking_payment_export
#: field:payment.mode.type,ir_model_id:0
msgid "Payment wizard"
msgstr ""
#. module: account_banking_payment_export
#: view:payment.manual:account_banking_payment_export.view_payment_manual_form
msgid "Please execute payment order manually, and click OK when succesfully sent."
msgstr ""
#. module: account_banking_payment_export
#: field:payment.order.create,populate_results:0
msgid "Populate results directly"
msgstr ""
#. module: account_banking_payment_export
#: help:payment.mode,type:0
msgid "Select the Export Payment Type for the Payment Mode."
msgstr ""
#. module: account_banking_payment_export
#: help:payment.mode.type,ir_model_id:0
msgid "Select the Payment Wizard for payments of this type. Leave empty for manual processing"
msgstr ""
#. module: account_banking_payment_export
#: field:payment.mode,purchase_ok:0
msgid "Selectable on purchase operations"
msgstr ""
#. module: account_banking_payment_export
#: field:payment.mode,sale_ok:0
msgid "Selectable on sale operations"
msgstr ""
#. module: account_banking_payment_export
#: model:ir.model,name:account_banking_payment_export.model_payment_manual
msgid "Send payment order(s) manually"
msgstr ""
#. module: account_banking_payment_export
#: help:payment.mode.type,code:0
msgid "Specify the Code for Payment Type"
msgstr ""
#. module: account_banking_payment_export
#: code:addons/account_banking_payment_export/models/account_invoice.py:34
#, python-format
msgid "Structured Reference"
msgstr ""
#. module: account_banking_payment_export
#: view:payment.mode.type:account_banking_payment_export.view_payment_mode_type_form
#: field:payment.mode.type,suitable_bank_types:0
msgid "Suitable bank types"
msgstr ""
#. module: account_banking_payment_export
#: help:payment.mode.type,payment_order_type:0
msgid "This field determines if this type applies to customers (Debit) or suppliers (Payment)"
msgstr ""
#. module: account_banking_payment_export
#: view:account.move.line:account_banking_payment_export.payment_order_populate_view_move_line_tree
msgid "Total Credit"
msgstr ""
#. module: account_banking_payment_export
#: view:account.move.line:account_banking_payment_export.payment_order_populate_view_move_line_tree
msgid "Total Debit"
msgstr ""
#. module: account_banking_payment_export
#: code:addons/account_banking_payment_export/models/account_payment.py:69
#, python-format
msgid "You can only combine payment orders of the same type"
msgstr ""
#. module: account_banking_payment_export
#: view:payment.order:account_banking_payment_export.view_banking_payment_order_form_1
msgid "launch_wizard"
msgstr ""
#. module: account_banking_payment_export
#: view:payment.order:account_banking_payment_export.view_banking_payment_order_form_1
msgid "{\n"
" 'invisible': [('state', '!=', 'draft')]}"
msgstr ""
#. module: account_banking_payment_export
#: view:payment.order.create:account_banking_payment_export.view_create_payment_order_lines
msgid "{'display_credit': context.get('display_credit', False),'display_debit': context.get('display_debit', False),'journal_type': 'sale', 'tree_view_ref' : 'account_banking_payment_export.payment_order_populate_view_move_line_tree'}"
msgstr ""

View File

@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-07-02 10:49+0000\n"
"PO-Revision-Date: 2015-07-02 10:49+0000\n"
"POT-Creation-Date: 2016-02-18 08:37+0000\n"
"PO-Revision-Date: 2016-02-18 08:37+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -15,12 +15,54 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: account_banking_payment_export
#: code:addons/account_banking_payment_export/models/res_partner_bank.py:17
#: code:addons/account_banking_payment_export/models/res_partner_bank.py:31
#, python-format
msgid "A valid BIC contains 8 or 11 caracters. The BIC '%s' contains %d caracters, so it is not valid."
msgstr "Un BIC válido contiene 8 u 11 caracteres. El BIC '%s' contiene %d caracteres, por lo que no es válido."
#. module: account_banking_payment_export
#: field:payment.mode,active:0
#: field:payment.mode.type,active:0
msgid "Active"
msgstr "Activo"
#. module: account_banking_payment_export
#: view:payment.order:account_banking_payment_export.view_payment_order_form
msgid "Amount"
msgstr "Importe"
#. module: account_banking_payment_export
#: model:ir.model,name:account_banking_payment_export.model_res_bank
msgid "Bank"
msgstr "Banco"
#. module: account_banking_payment_export
#: model:ir.model,name:account_banking_payment_export.model_res_partner_bank
msgid "Bank Accounts"
msgstr "Cuentas de banco"
#. module: account_banking_payment_export
#: view:bank.payment.line:account_banking_payment_export.bank_payment_line_form
#: field:payment.line,bank_line_id:0
msgid "Bank Payment Line"
msgstr "Línea de pago bancario"
#. module: account_banking_payment_export
#: field:bank.payment.line,name:0
msgid "Bank Payment Line Ref"
msgstr "Ref. de la línea de pago bancario"
#. module: account_banking_payment_export
#: view:bank.payment.line:account_banking_payment_export.bank_payment_line_tree
#: model:ir.actions.act_window,name:account_banking_payment_export.bank_payment_line_action
#: model:ir.model,name:account_banking_payment_export.model_bank_payment_line
#: view:payment.order:account_banking_payment_export.view_payment_order_form
#: field:payment.order,bank_line_ids:0
msgid "Bank Payment Lines"
msgstr "Líneas de pago bancario"
#. module: account_banking_payment_export
#: view:payment.manual:account_banking_payment_export.view_payment_manual_form
msgid "Cancel"
@@ -32,12 +74,24 @@ msgid "Code"
msgstr "Código"
#. module: account_banking_payment_export
#: field:bank.payment.line,communication:0
msgid "Communication"
msgstr "Comunicación"
#. module: account_banking_payment_export
#: field:bank.payment.line,company_id:0
msgid "Company"
msgstr "Compañía"
#. module: account_banking_payment_export
#: field:bank.payment.line,create_uid:0
#: field:payment.manual,create_uid:0
#: field:payment.mode.type,create_uid:0
msgid "Created by"
msgstr "Creado por"
#. module: account_banking_payment_export
#: field:bank.payment.line,create_date:0
#: field:payment.manual,create_date:0
#: field:payment.mode.type,create_date:0
msgid "Created on"
@@ -54,13 +108,28 @@ msgid "Direct debit"
msgstr "Adeudo directo (cobro)"
#. module: account_banking_payment_export
#: code:addons/account_banking_payment_export/wizard/payment_order_create.py:121
#: selection:payment.mode,default_date_type:0
msgid "Due"
msgstr "Vencimiento"
#. module: account_banking_payment_export
#: selection:payment.order.create,date_type:0
msgid "Due Date"
msgstr "Fecha de vencimiento"
#. module: account_banking_payment_export
#: view:payment.order:account_banking_payment_export.view_payment_order_form
msgid "Entry Information"
msgstr "Información del asiento"
#. module: account_banking_payment_export
#: code:addons/account_banking_payment_export/wizard/payment_order_create.py:149
#, python-format
msgid "Entry Lines"
msgstr "Líneas de pago"
#. module: account_banking_payment_export
#: code:addons/account_banking_payment_export/models/account_payment.py:68
#: code:addons/account_banking_payment_export/models/account_payment.py:73
#, python-format
msgid "Error"
msgstr "Error"
@@ -71,11 +140,22 @@ msgid "Export type"
msgstr "Tipo de exportación"
#. module: account_banking_payment_export
#: view:payment.order:account_banking_payment_export.view_payment_order_form
msgid "General Information"
msgstr "Información General"
#. module: account_banking_payment_export
#: field:bank.payment.line,id:0
#: field:payment.manual,id:0
#: field:payment.mode.type,id:0
msgid "ID"
msgstr "ID"
#. module: account_banking_payment_export
#: view:payment.order:account_banking_payment_export.view_payment_order_form
msgid "Information"
msgstr "Información"
#. module: account_banking_payment_export
#: model:ir.model,name:account_banking_payment_export.model_account_invoice
msgid "Invoice"
@@ -93,22 +173,52 @@ msgid "Journal Items"
msgstr "Apuntes contables"
#. module: account_banking_payment_export
#: field:payment.mode,default_journal_ids:0
#: field:payment.order.create,journal_ids:0
msgid "Journals Filter"
msgstr "Filtro de diarios"
#. module: account_banking_payment_export
#: view:payment.order.create:account_banking_payment_export.view_create_payment_order
msgid "Keep empty for using all journals"
msgstr "Dejar vacío para usar todos los diarios"
#. module: account_banking_payment_export
#: field:bank.payment.line,write_uid:0
#: field:payment.manual,write_uid:0
#: field:payment.mode.type,write_uid:0
msgid "Last Updated by"
msgstr "Última actualización por"
#. module: account_banking_payment_export
#: field:bank.payment.line,write_date:0
#: field:payment.manual,write_date:0
#: field:payment.mode.type,write_date:0
msgid "Last Updated on"
msgstr "Última actualización en"
#. module: account_banking_payment_export
#: field:payment.mode,default_invoice:0
#: field:payment.order.create,invoice:0
msgid "Linked to an Invoice or Refund"
msgstr "Vinculado a una factura o factura rectificativa"
#. module: account_banking_payment_export
#: view:payment.manual:account_banking_payment_export.view_payment_manual_form
msgid "Manual payment"
msgstr "Pago manual"
#. module: account_banking_payment_export
#: selection:payment.mode,default_date_type:0
msgid "Move"
msgstr "Asiento"
#. module: account_banking_payment_export
#: selection:payment.order.create,date_type:0
#: field:payment.order.create,move_date:0
msgid "Move Date"
msgstr "Fecha del asiento"
#. module: account_banking_payment_export
#: field:payment.mode.type,name:0
msgid "Name"
@@ -120,13 +230,29 @@ msgstr "Nombre"
msgid "Note"
msgstr "Descripción"
#. module: account_banking_payment_export
#: field:bank.payment.line,order_id:0
msgid "Order"
msgstr "Orden"
#. module: account_banking_payment_export
#: field:payment.mode.type,payment_order_type:0
msgid "Order type"
msgstr "Tipo de orden"
#. module: account_banking_payment_export
#: view:payment.order:account_banking_payment_export.view_payment_order_form
msgid "Owner Account"
msgstr "Cuenta propietario"
#. module: account_banking_payment_export
#: view:payment.order:account_banking_payment_export.view_payment_order_form
msgid "Partner Bank Account"
msgstr "Cuenta bancaria"
#. module: account_banking_payment_export
#: selection:payment.mode.type,payment_order_type:0
#: view:payment.order:account_banking_payment_export.view_payment_order_form
#: selection:payment.order,payment_order_type:0
msgid "Payment"
msgstr "Pago"
@@ -137,6 +263,18 @@ msgstr "Pago"
msgid "Payment Export Types"
msgstr "Tipos de exportación de pagos"
#. module: account_banking_payment_export
#: model:ir.model,name:account_banking_payment_export.model_payment_line
#: view:payment.order:account_banking_payment_export.view_payment_order_form
msgid "Payment Line"
msgstr "Línea de pago"
#. module: account_banking_payment_export
#: field:bank.payment.line,payment_line_ids:0
#: view:payment.order:account_banking_payment_export.view_payment_order_form
msgid "Payment Lines"
msgstr "Líneas de pago"
#. module: account_banking_payment_export
#: model:ir.model,name:account_banking_payment_export.model_payment_mode
msgid "Payment Mode"
@@ -153,13 +291,13 @@ msgid "Payment Order"
msgstr "Orden de pago"
#. module: account_banking_payment_export
#: code:addons/account_banking_payment_export/models/account_payment.py:53
#: code:addons/account_banking_payment_export/models/account_payment.py:58
#, python-format
msgid "Payment Order Export"
msgstr "Exportación de la orden de pago"
#. module: account_banking_payment_export
#: code:addons/account_banking_payment_export/wizard/payment_order_create.py:213
#: code:addons/account_banking_payment_export/wizard/payment_order_create.py:243
#, python-format
msgid "Payment Orders"
msgstr "Órdenes de pago"
@@ -191,9 +329,20 @@ msgid "Please execute payment order manually, and click OK when succesfully sent
msgstr "Ejecute la orden de pago manualmente (fuera del sistema), y pulse en Aceptar cuando la haya tramitado correctamente."
#. module: account_banking_payment_export
#: field:payment.mode,default_populate_results:0
#: field:payment.order.create,populate_results:0
msgid "Populate results directly"
msgstr "Incluir directamente los resultados"
msgid "Populate Results Directly"
msgstr "Incluir los resultados directamente"
#. module: account_banking_payment_export
#: view:bank.payment.line:account_banking_payment_export.bank_payment_line_form
msgid "Related Payment Lines"
msgstr "Líneas de pago relacionadas"
#. module: account_banking_payment_export
#: view:payment.mode:account_banking_payment_export.view_payment_mode_form_inherit
msgid "Select Move Lines to Pay - Default Values"
msgstr "Seleccione los apuntes a pagar - Valores por defecto"
#. module: account_banking_payment_export
#: help:payment.mode,type:0
@@ -226,7 +375,7 @@ msgid "Specify the Code for Payment Type"
msgstr "Especifica el código para el tipo de pago"
#. module: account_banking_payment_export
#: code:addons/account_banking_payment_export/models/account_invoice.py:34
#: code:addons/account_banking_payment_export/models/account_invoice.py:15
#, python-format
msgid "Structured Reference"
msgstr "Referencia esctructurada"
@@ -237,11 +386,22 @@ msgstr "Referencia esctructurada"
msgid "Suitable bank types"
msgstr "Tipos de cuentas bancarias adecuadas"
#. module: account_banking_payment_export
#: code:addons/account_banking_payment_export/models/account_payment.py:146
#, python-format
msgid "The amount for Partner '%s' is negative or null (%.2f) !"
msgstr "El importe para el empresa '%s' es negativo o nulo (%.2f) !"
#. module: account_banking_payment_export
#: help:payment.mode.type,payment_order_type:0
msgid "This field determines if this type applies to customers (Debit) or suppliers (Payment)"
msgstr "Este campo determina si este tipo aplica a clientes (Cobro) o a proveedores (Pago)"
#. module: account_banking_payment_export
#: view:bank.payment.line:account_banking_payment_export.bank_payment_line_tree
msgid "Total Amount"
msgstr "Importe total"
#. module: account_banking_payment_export
#: view:account.move.line:account_banking_payment_export.payment_order_populate_view_move_line_tree
msgid "Total Credit"
@@ -253,25 +413,46 @@ msgid "Total Debit"
msgstr "Total debe"
#. module: account_banking_payment_export
#: code:addons/account_banking_payment_export/models/account_payment.py:69
#: view:payment.order:account_banking_payment_export.view_payment_order_form
msgid "Total in Company Currency"
msgstr "Total en moneda de la compañía"
#. module: account_banking_payment_export
#: view:payment.order:account_banking_payment_export.view_payment_order_form
msgid "Transaction Information"
msgstr "Información de transacción"
#. module: account_banking_payment_export
#: field:payment.mode,default_date_type:0
#: field:payment.order.create,date_type:0
msgid "Type of Date Filter"
msgstr "Filtro de tipo de fecha"
#. module: account_banking_payment_export
#: code:addons/account_banking_payment_export/models/account_payment.py:74
#, python-format
msgid "You can only combine payment orders of the same type"
msgstr "Sólo puede combinar órdenes de pago del mismo tipo"
#. module: account_banking_payment_export
#: view:payment.order:account_banking_payment_export.view_banking_payment_order_form_1
#: view:payment.order:account_banking_payment_export.view_payment_order_form
msgid "launch_wizard"
msgstr "Asistente"
#. module: account_banking_payment_export
#: view:payment.order:account_banking_payment_export.view_banking_payment_order_form_1
#: view:payment.order:account_banking_payment_export.view_payment_order_form
msgid "{\n"
" 'invisible': [('state', '!=', 'draft')]}"
" 'invisible': [('state', '!=', 'draft')]}"
msgstr "{\n"
" 'invisible': [('state', '!=', 'draft')]}"
" 'invisible': [('state', '!=', 'draft')]}"
#. module: account_banking_payment_export
#: view:payment.order.create:account_banking_payment_export.view_create_payment_order_lines
msgid "{'display_credit': context.get('display_credit', False),'display_debit': context.get('display_debit', False),'journal_type': 'sale', 'tree_view_ref' : 'account_banking_payment_export.payment_order_populate_view_move_line_tree'}"
msgstr "{'display_credit': context.get('display_credit', False),'display_debit': context.get('display_debit', False),'journal_type': 'sale', 'tree_view_ref' : 'account_banking_payment_export.payment_order_populate_view_move_line_tree'}"
#. module: account_banking_payment_export
#: view:payment.order.create:account_banking_payment_export.view_create_payment_order
msgid "{'required': [('date_type', '=', 'due')], 'invisible': [('date_type', '!=', 'due')]}"
msgstr "{'required': [('date_type', '=', 'due')], 'invisible': [('date_type', '!=', 'due')]}"

View File

@@ -6,3 +6,6 @@ from . import payment_mode_type
from . import payment_mode
from . import account_move_line
from . import account_invoice
from . import bank_payment_line
from . import payment_line
from . import res_partner_bank

View File

@@ -1,26 +1,7 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 ACSONE SA (<http://acsone.eu>).
#
# All other contributions are (C) by their respective contributors
#
# 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/>.
#
##############################################################################
# © 2013-2014 ACSONE SA (<http://acsone.eu>).
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import api, models, _

View File

@@ -1,23 +1,8 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2004-2014 OpenERP S.A. (http://www.openerp.com/)
# (C) 2014 Akretion (http://www.akretion.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/>.
#
##############################################################################
# © 2004-2014 OpenERP S.A. (http://www.openerp.com/)
# © 2014 Akretion (http://www.akretion.com/)
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api

View File

@@ -1,27 +1,7 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).
# (C) 2011 - 2013 Therp BV (<http://therp.nl>).
#
# All other contributions are (C) by their respective contributors
#
# 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/>.
#
##############################################################################
# © 2009 EduSense BV (<http://www.edusense.nl>)
# © 2011-2013 Therp BV (<http://therp.nl>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api, exceptions, workflow, _
try:
@@ -43,13 +23,24 @@ class PaymentOrder(models.Model):
readonly=True, states={'draft': [('readonly', False)]})
mode_type = fields.Many2one('payment.mode.type', related='mode.type',
string='Payment Type')
bank_line_ids = fields.One2many(
'bank.payment.line', 'order_id', string="Bank Payment Lines",
readonly=True)
total = fields.Float(compute='_compute_total', store=True)
bank_line_count = fields.Integer(
compute='_bank_line_count', string='Number of Bank Lines')
@api.depends('line_ids', 'line_ids.amount')
@api.one
def _compute_total(self):
self.total = sum(self.mapped('line_ids.amount') or [0.0])
@api.multi
@api.depends('bank_line_ids')
def _bank_line_count(self):
for order in self:
order.bank_line_count = len(order.bank_line_ids)
@api.multi
def launch_wizard(self):
"""Search for a wizard to launch according to the type.
@@ -95,3 +86,68 @@ class PaymentOrder(models.Model):
'state': 'done',
})
return True
@api.multi
def action_cancel(self):
for order in self:
order.write({'state': 'cancel'})
order.bank_line_ids.unlink()
return True
@api.model
def _prepare_bank_payment_line(self, paylines):
return {
'order_id': paylines[0].order_id.id,
'payment_line_ids': [(6, 0, paylines.ids)],
'communication': '-'.join(
[line.communication for line in paylines]),
}
@api.multi
def action_open(self):
"""
Called when you click on the 'Confirm' button
Set the 'date' on payment line depending on the 'date_prefered'
setting of the payment.order
Re-generate the bank payment lines
"""
res = super(PaymentOrder, self).action_open()
bplo = self.env['bank.payment.line']
today = fields.Date.context_today(self)
for order in self:
# Delete existing bank payment lines
order.bank_line_ids.unlink()
# Create the bank payment lines from the payment lines
group_paylines = {} # key = hashcode
for payline in order.line_ids:
# Compute requested payment date
if order.date_prefered == 'due':
requested_date = payline.ml_maturity_date or today
elif order.date_prefered == 'fixed':
requested_date = order.date_scheduled or today
else:
requested_date = today
# Write requested_date on 'date' field of payment line
payline.date = requested_date
hashcode = payline.payment_line_hashcode()
if hashcode in group_paylines:
group_paylines[hashcode]['paylines'] += payline
group_paylines[hashcode]['total'] +=\
payline.amount_currency
else:
group_paylines[hashcode] = {
'paylines': payline,
'total': payline.amount_currency,
}
# Create bank payment lines
for paydict in group_paylines.values():
# Block if a bank payment line is <= 0
if paydict['total'] <= 0:
raise exceptions.Warning(_(
"The amount for Partner '%s' is negative "
"or null (%.2f) !")
% (paydict['paylines'][0].partner_id.name,
paydict['total']))
vals = self._prepare_bank_payment_line(paydict['paylines'])
bplo.create(vals)
return res

View File

@@ -0,0 +1,68 @@
# -*- coding: utf-8 -*-
# © 2015 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
import openerp.addons.decimal_precision as dp
class BankPaymentLine(models.Model):
_name = 'bank.payment.line'
_description = 'Bank Payment Lines'
name = fields.Char(string='Bank Payment Line Ref', required=True)
order_id = fields.Many2one(
'payment.order', string='Order', ondelete='cascade', select=True)
payment_line_ids = fields.One2many(
'payment.line', 'bank_line_id', string='Payment Lines')
partner_id = fields.Many2one(
'res.partner', string='Partner', related='payment_line_ids.partner_id')
# Function Float fields are sometimes badly displayed in tree view,
# see bug report https://github.com/odoo/odoo/issues/8632
amount_currency = fields.Float(
string='Amount', digits=dp.get_precision('Account'),
compute='_compute_amount', store=True)
# I would have preferred currency_id, but I need to keep the field names
# similar to the field names of payment.line
currency = fields.Many2one(
'res.currency', string='Currency', required=True,
related='payment_line_ids.currency')
bank_id = fields.Many2one(
'res.partner.bank', string='Bank Account',
related='payment_line_ids.bank_id')
date = fields.Date(
string='Payment Date', related='payment_line_ids.date')
state = fields.Selection(
related='payment_line_ids.state', string='Communication Type')
communication = fields.Char(string='Communication', required=True)
company_id = fields.Many2one(
'res.company', string='Company', readonly=True,
related='order_id.company_id', store=True)
@api.model
def same_fields_payment_line_and_bank_payment_line(self):
"""
This list of fields is used both to compute the grouping
hashcode and to copy the values from payment line
to bank payment line
The fields must have the same name on the 2 objects
"""
same_fields = [
'currency', 'partner_id',
'bank_id', 'date', 'state']
return same_fields
@api.multi
@api.depends('payment_line_ids', 'payment_line_ids.amount_currency')
def _compute_amount(self):
for line in self:
line.amount_currency = sum(
line.mapped('payment_line_ids.amount_currency'))
@api.model
@api.returns('self')
def create(self, vals):
if vals.get('name', '/') == '/':
vals['name'] = self.env['ir.sequence'].next_by_code(
'bank.payment.line')
return super(BankPaymentLine, self).create(vals)

View File

@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# © 2015 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
class PaymentLine(models.Model):
_inherit = 'payment.line'
bank_line_id = fields.Many2one(
'bank.payment.line', string='Bank Payment Line')
@api.multi
def payment_line_hashcode(self):
self.ensure_one()
bplo = self.env['bank.payment.line']
values = []
for field in bplo.same_fields_payment_line_and_bank_payment_line():
values.append(unicode(self[field]))
hashcode = '-'.join(values)
return hashcode

View File

@@ -1,27 +1,8 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).
# (C) 2011 - 2013 Therp BV (<http://therp.nl>).
#
# All other contributions are (C) by their respective contributors
#
# 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/>.
#
##############################################################################
# © 2009 EduSense BV (<http://www.edusense.nl>)
# © 2011-2013 Therp BV (<http://therp.nl>)
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api, SUPERUSER_ID
@@ -86,20 +67,11 @@ class PaymentMode(models.Model):
res = [t.code for t in payment_mode.type.suitable_bank_types]
return res
@api.model
def _default_type(self):
return self.env.ref(
'account_banking_payment_export.'
'manual_bank_tranfer', raise_if_not_found=False)\
or self.env['payment.mode.type']
type = fields.Many2one(
'payment.mode.type', string='Export type', required=True,
help='Select the Export Payment Type for the Payment Mode.',
default=_default_type)
help='Select the Export Payment Type for the Payment Mode.')
payment_order_type = fields.Selection(
related='type.payment_order_type', readonly=True, string="Order Type",
selection=[('payment', 'Payment'), ('debit', 'Debit')],
help="This field, that comes from export type, determines if this "
"mode can be selected for customers or suppliers.")
active = fields.Boolean(string='Active', default=True)
@@ -108,3 +80,27 @@ class PaymentMode(models.Model):
purchase_ok = fields.Boolean(string='Selectable on purchase operations',
default=True)
note = fields.Text(string="Note", translate=True)
# Default options for the "payment.order.create" wizard
default_journal_ids = fields.Many2many(
'account.journal', string="Journals Filter")
default_invoice = fields.Boolean(
string='Linked to an Invoice or Refund', default=False)
default_date_type = fields.Selection([
('due', 'Due'),
('move', 'Move'),
], default='due', string="Type of Date Filter")
default_populate_results = fields.Boolean(
string='Populate Results Directly')
@api.onchange('type')
def type_on_change(self):
if self.type:
ajo = self.env['account.journal']
aj_ids = []
if self.type.payment_order_type == 'payment':
aj_ids = ajo.search([
('type', 'in', ('purchase_refund', 'purchase'))]).ids
elif self.type.payment_order_type == 'debit':
aj_ids = ajo.search([
('type', 'in', ('sale_refund', 'sale'))]).ids
self.default_journal_ids = [(6, 0, aj_ids)]

View File

@@ -1,27 +1,8 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).
# (C) 2011 - 2013 Therp BV (<http://therp.nl>).
#
# All other contributions are (C) by their respective contributors
#
# 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/>.
#
##############################################################################
# © 2009 EduSense BV (<http://www.edusense.nl>)
# © 2011-2013 Therp BV (<http://therp.nl>)
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields

View File

@@ -0,0 +1,34 @@
# -*- coding: utf-8 -*-
# © 2015 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, api, _
from openerp.exceptions import ValidationError
class ResPartnerBank(models.Model):
_inherit = 'res.partner.bank'
@api.multi
@api.constrains('bank_bic')
def check_bic_length(self):
for pbank in self:
if pbank.bank_bic and len(pbank.bank_bic) not in (8, 11):
raise ValidationError(_(
"A valid BIC contains 8 or 11 caracters. The BIC '%s' "
"contains %d caracters, so it is not valid.")
% (pbank.bank_bic, len(pbank.bank_bic)))
class ResBank(models.Model):
_inherit = 'res.bank'
@api.multi
@api.constrains('bic')
def check_bic_length(self):
for bank in self:
if bank.bic and len(bank.bic) not in (8, 11):
raise ValidationError(_(
"A valid BIC contains 8 or 11 caracters. The BIC '%s' "
"contains %d caracters, so it is not valid.")
% (bank.bic, len(bank.bic)))

View File

@@ -1,2 +1,3 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_payment_mode_type","payment.mode.type","model_payment_mode_type","account_payment.group_account_payment",1,1,1,1
"access_bank_payment_line","Full access on bank.payment.line to Payment Manager","model_bank_payment_line","account_payment.group_account_payment",1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_payment_mode_type payment.mode.type model_payment_mode_type account_payment.group_account_payment 1 1 1 1
3 access_bank_payment_line Full access on bank.payment.line to Payment Manager model_bank_payment_line account_payment.group_account_payment 1 1 1 1

View File

@@ -1,27 +1,107 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- restore wizard functionality when making payments
-->
<data>
<record id="view_banking_payment_order_form_1" model="ir.ui.view">
<field name="name">account.payment.order.form.banking-1</field>
<field name="inherit_id" ref="account_payment.view_payment_order_form" />
<field name="model">payment.order</field>
<field name="arch" type="xml">
<xpath expr="//button[@string='Make Payments']"
position="attributes">
<attribute name="name">launch_wizard</attribute>
</xpath>
<field name="mode" position="after">
<field name="mode_type" invisible="1"/>
</field>
<xpath expr="//button[@string='Invoices']" position="attributes">
<attribute name="attrs">{
'invisible': [('state', '!=', 'draft')]}</attribute>
</xpath>
</field>
</record>
</data>
<!-- restore wizard functionality when making payments -->
<record id="view_payment_order_form" model="ir.ui.view">
<field name="name">account.payment.order.form.banking-1</field>
<field name="inherit_id" ref="account_payment.view_payment_order_form" />
<field name="model">payment.order</field>
<field name="arch" type="xml">
<xpath expr="//button[@string='Make Payments']" position="attributes">
<attribute name="name">launch_wizard</attribute>
</xpath>
<field name="mode" position="after">
<field name="mode_type" invisible="1"/>
<field name="payment_order_type" invisible="1"/>
<field name="bank_line_count" attrs="{'invisible': [('state', 'in', ('draft', 'cancel'))]}"/>
</field>
<xpath expr="//button[@string='Invoices']" position="attributes">
<attribute name="attrs">{
'invisible': [('state', '!=', 'draft')]}</attribute>
</xpath>
<!-- sorry, I have no choice but to replace the line_ids field
in order to introduce a 'notebook' in this view -->
<field name="line_ids" position="replace">
<notebook>
<page string="Payment Lines" name="payment-lines">
<!-- copy/paste from the view that we inherit -->
<field name="line_ids" context="{'order_id': active_id or False}" >
<form string="Payment Line">
<notebook>
<page string="Payment">
<group col="4">
<field name="move_line_id" on_change="onchange_move_line(move_line_id,parent.mode,parent.date_prefered,parent.date_scheduled,currency,company_currency)" domain="[('reconcile_id','=', False), ('account_id.reconcile', '=', True)] "/> <!-- we removed the filter on amount_to_pay, because we want to be able to select refunds -->
<separator colspan="4" string="Transaction Information"/>
<field name="date"/>
<label for="amount_currency" string="Amount"/>
<div>
<field name="amount_currency" on_change="onchange_amount(amount_currency,currency,company_currency)" class="oe_inline"/>
<field name="currency" nolabel="1" class="oe_inline"/>
</div>
<field name="partner_id" on_change="onchange_partner(partner_id,parent.mode)"/>
<field domain="[('partner_id','=',partner_id)]" name="bank_id"/>
<separator colspan="2" string="Owner Account"/>
<separator colspan="2" string="Partner Bank Account"/>
<field colspan="2" name="info_owner" nolabel="1"/>
<field colspan="2" name="info_partner" nolabel="1"/>
<field colspan="4" name="communication"/>
<field colspan="4" name="communication2"/>
<field name="name"/>
<field name="state"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
</group>
</page>
<page string="Information">
<group col="4" string="General Information">
<label for="amount" groups="base.group_multi_currency"/>
<div groups="base.group_multi_currency">
<field name="amount" class="oe_inline"/>
<field name="company_currency" class="oe_inline"/>
</div>
<separator colspan="4" string="Entry Information"/>
<field name="create_date" readonly="1"/>
<field name="ml_maturity_date"/>
<field name="ml_inv_ref"/>
<field name="bank_line_id" readonly="1"/>
</group>
</page>
</notebook>
</form>
<tree string="Payment Line">
<field name="ml_inv_ref" />
<field name="partner_id"/>
<field name="communication"/>
<field name="bank_id" domain="[('partner_id', '=', partner_id)]"/>
<field name="ml_maturity_date"/>
<field name="date"/>
<field name="amount_currency" string="Amount"/>
<field name="currency"/>
<field name="name"/>
<field name="amount" sum="Total in Company Currency" invisible="1"/>
</tree>
</field>
<!-- end of the copy/paste -->
</page>
<page string="Bank Payment Lines" name="bank-payment-lines">
<field name="bank_line_ids" context="{'search_payment_order_type': context.get('search_payment_order_type')}"/>
</page>
</notebook>
</field>
</field>
</record>
<record id="view_payment_order_tree" model="ir.ui.view">
<field name="name">account_banking_payment_export.payment.order.tree</field>
<field name="inherit_id" ref="account_payment.view_payment_order_tree" />
<field name="model">payment.order</field>
<field name="arch" type="xml">
<field name="date_done" position="after">
<field name="bank_line_count"/>
</field>
</field>
</record>
</data>
</openerp>

View File

@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!--
Copyright (C) 2015 Akretion (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
-->
<record id="bank_payment_line_form" model="ir.ui.view">
<field name="name">bank.payment.line.form</field>
<field name="model">bank.payment.line</field>
<field name="arch" type="xml">
<form string="Bank Payment Line">
<group name="main">
<field name="order_id"
invisible="not context.get('bank_payment_line_main_view')"/>
<field name="name"/>
<field name="company_id" groups="base.group_multi_company"
invisible="not context.get('bank_payment_line_main_view')"/>
<field name="partner_id"/>
<field name="date"/>
<field name="amount_currency" widget="monetary"
options="{'currency_field': 'currency'}"/>
<field name="currency" invisible="1"/>
<field name="bank_id"/>
<field name="state"/>
<field name="communication"/>
</group>
<group string="Related Payment Lines" name="payment-lines">
<field name="payment_line_ids" nolabel="1"/>
</group>
</form>
</field>
</record>
<record id="bank_payment_line_tree" model="ir.ui.view">
<field name="name">bank.payment.line.tree</field>
<field name="model">bank.payment.line</field>
<field name="arch" type="xml">
<tree string="Bank Payment Lines">
<field name="order_id"
invisible="not context.get('bank_payment_line_main_view')"/>
<field name="partner_id"/>
<field name="communication"/>
<field name="bank_id"/>
<field name="date"/>
<field name="amount_currency" widget="monetary"
options="{'currency_field': 'currency'}"
sum="Total Amount"/>
<field name="currency"/>
<field name="name"/>
<field name="company_id" groups="base.group_multi_company"
invisible="not context.get('bank_payment_line_main_view')"/>
</tree>
</field>
</record>
<record id="bank_payment_line_action" model="ir.actions.act_window">
<field name="name">Bank Payment Lines</field>
<field name="res_model">bank.payment.line</field>
<field name="view_mode">tree,form</field>
<field name="context">{'bank_payment_line_main_view': True}</field>
</record>
</data>
</openerp>

View File

@@ -17,6 +17,12 @@
<field name="sale_ok"/>
</field>
<form position="inside">
<group name="payment_order_create_defaults" string="Select Move Lines to Pay - Default Values">
<field name="default_populate_results"/>
<field name="default_journal_ids" widget="many2many_tags"/>
<field name="default_invoice"/>
<field name="default_date_type"/>
</group>
<group string="Note" col="4">
<field name="note" nolabel="1"/>
</group>

View File

@@ -4,11 +4,10 @@
# Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).
# (C) 2011 - 2013 Therp BV (<http://therp.nl>).
# (C) 2014 - 2015 ACSONE SA/NV (<http://acsone.eu>).
# (C) 2015 Akretion (<http://www.akretion.com>).
#
# All other contributions are (C) by their respective contributors
#
# 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
@@ -30,8 +29,18 @@ from openerp import models, fields, api, _
class PaymentOrderCreate(models.TransientModel):
_inherit = 'payment.order.create'
populate_results = fields.Boolean(string="Populate results directly",
default=True)
journal_ids = fields.Many2many(
'account.journal', string='Journals Filter')
invoice = fields.Boolean(
string='Linked to an Invoice or Refund')
date_type = fields.Selection([
('due', 'Due Date'),
('move', 'Move Date'),
], string="Type of Date Filter", required=True)
duedate = fields.Date(required=False)
move_date = fields.Date(
string='Move Date', default=fields.Date.context_today)
populate_results = fields.Boolean(string="Populate Results Directly")
@api.model
def default_get(self, field_list):
@@ -40,6 +49,16 @@ class PaymentOrderCreate(models.TransientModel):
if ('entries' in field_list and context.get('line_ids') and
context.get('populate_results')):
res.update({'entries': context['line_ids']})
assert context.get('active_model') == 'payment.order',\
'active_model should be payment.order'
assert context.get('active_id'), 'Missing active_id in context !'
pay_order = self.env['payment.order'].browse(context['active_id'])
res.update({
'journal_ids': pay_order.mode.default_journal_ids.ids or False,
'invoice': pay_order.mode.default_invoice,
'date_type': pay_order.mode.default_date_type,
'populate_results': pay_order.mode.default_populate_results,
})
return res
@api.multi
@@ -56,12 +75,14 @@ class PaymentOrderCreate(models.TransientModel):
# Do not propose partially reconciled credit lines,
# as they are deducted from a customer invoice, and
# will not be refunded with a payment.
domain += [('credit', '>', 0),
'|',
('account_id.type', '=', 'payable'),
'&',
('account_id.type', '=', 'receivable'),
('reconcile_partial_id', '=', False)]
domain += [
('credit', '>', 0),
'|',
('account_id.type', '=', 'payable'),
'&',
('account_id.type', '=', 'receivable'),
('reconcile_partial_id', '=', False),
]
@api.multi
def filter_lines(self, lines):
@@ -99,12 +120,20 @@ class PaymentOrderCreate(models.TransientModel):
payment = self.env['payment.order'].browse(
self.env.context['active_id'])
# Search for move line to pay:
journals = self.journal_ids or self.env['account.journal'].search([])
domain = [('move_id.state', '=', 'posted'),
('reconcile_id', '=', False),
('company_id', '=', payment.mode.company_id.id),
'|',
('date_maturity', '<=', self.duedate),
('date_maturity', '=', False)]
('journal_id', 'in', journals.ids)]
if self.date_type == 'due':
domain += [
'|',
('date_maturity', '<=', self.duedate),
('date_maturity', '=', False)]
elif self.date_type == 'move':
domain.append(('date', '<=', self.move_date))
if self.invoice:
domain.append(('invoice', '!=', False))
self.extend_payment_order_domain(payment, domain)
# -- end account_direct_debit --
lines = line_obj.search(domain)
@@ -171,7 +200,13 @@ class PaymentOrderCreate(models.TransientModel):
# customer invoice number (in the case of debit order)
communication = line.invoice.number.replace('/', '')
state = 'structured'
amount_currency = line.amount_residual_currency
# support debit orders when enabled
if line.debit > 0:
amount_currency = line.amount_residual_currency * -1
else:
amount_currency = line.amount_residual_currency
if payment.payment_order_type == 'debit':
amount_currency *= -1
line2bank = line.line2bank(payment.mode.id)
# -- end account banking
res = {'move_line_id': line.id,

View File

@@ -13,8 +13,20 @@
<field name="inherit_id" ref="account_payment.view_create_payment_order"/>
<field name="arch" type="xml">
<field name="duedate" position="after">
<field name="journal_ids"
widget="many2many_tags"
placeholder="Keep empty for using all journals"
/>
<field name="invoice"/>
<field name="populate_results"/>
</field>
<field name="duedate" position="before">
<field name="date_type"/>
<field name="move_date" attrs="{'required': [('date_type', '=', 'move')], 'invisible': [('date_type', '!=', 'move')]}"/>
</field>
<field name="duedate" position="attributes">
<attribute name="attrs">{'required': [('date_type', '=', 'due')], 'invisible': [('date_type', '!=', 'due')]}</attribute>
</field>
</field>
</record>

View File

@@ -12,5 +12,9 @@
<field name="action">action_done()</field>
</record>
<record id="account_payment.act_cancel" model="workflow.activity">
<field name="action">action_cancel()</field>
</record>
</data>
</openerp>

View File

@@ -1,32 +1,12 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).
# (C) 2011 - 2013 Therp BV (<http://therp.nl>).
# (C) 2014 ACSONE SA/NV (<http://acsone.eu>).
#
# All other contributions are (C) by their respective contributors
#
# 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/>.
#
##############################################################################
# © 2009 EduSense BV (<http://www.edusense.nl>)
# © 2011-2013 Therp BV (<http://therp.nl>)
# © 2013-2014 ACSONE SA (<http://acsone.eu>).
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Account Banking - Payments Transfer Account',
'version': '8.0.0.2.0',
'version': '8.0.0.3.0',
'license': 'AGPL-3',
'author': "Banking addons community,Odoo Community Association (OCA)",
'website': 'https://github.com/OCA/banking',

View File

@@ -1,4 +1,7 @@
# -*- coding: utf-8 -*-
from . import account_payment
from . import payment_line
from . import bank_payment_line
from . import payment_mode
from . import account_move_reconcile

View File

@@ -1,27 +1,7 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 ACSONE SA (<http://acsone.eu>).
# Copyright (C) 2014 Akretion (www.akretion.com)
#
# All other contributions are (C) by their respective contributors
#
# 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/>.
#
##############################################################################
# © 2014 ACSONE SA (<http://acsone.eu>).
# © 2014 Akretion (www.akretion.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, workflow, api

View File

@@ -1,31 +1,12 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).
# (C) 2011 - 2013 Therp BV (<http://therp.nl>).
# (C) 2014 ACSONE SA (<http://acsone.eu>).
# (C) 2014 Akretion (www.akretion.com)
#
# All other contributions are (C) by their respective contributors
#
# 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/>.
#
##############################################################################
# © 2009 EduSense BV (<http://www.edusense.nl>)
# © 2011-2013 Therp BV (<http://therp.nl>)
# © 2013-2014 ACSONE SA (<http://acsone.eu>).
# © 2014-2015 Akretion (www.akretion.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api, _
from openerp.exceptions import Warning as UserError
class PaymentOrder(models.Model):
@@ -104,8 +85,8 @@ class PaymentOrder(models.Model):
"""
res = []
for order in self:
for order_line in order.line_ids:
move_line = order_line.transfer_move_line_id
for bank_line in order.bank_line_ids:
move_line = bank_line.transfer_move_line_id
if move_line:
res.append(move_line)
return res
@@ -141,23 +122,16 @@ class PaymentOrder(models.Model):
@api.multi
def _prepare_move_line_transfer_account(
self, amount, move, payment_lines, labels):
if len(payment_lines) == 1:
partner_id = payment_lines[0].partner_id.id
name = _('%s line %s') % (labels[self.payment_order_type],
payment_lines[0].name)
if payment_lines[0].move_line_id.id and\
payment_lines[0].move_line_id.move_id.state != 'draft':
name = "%s (%s)" % (name,
payment_lines[0].move_line_id.move_id.name)
elif payment_lines[0].ml_inv_ref.id:
name = "%s (%s)" % (name,
payment_lines[0].ml_inv_ref.number)
self, amount, move, bank_payment_lines, labels):
if len(bank_payment_lines) == 1:
partner_id = bank_payment_lines[0].partner_id.id
name = _('%s bank line %s') % (labels[self.payment_order_type],
bank_payment_lines[0].name)
else:
partner_id = False
name = '%s %s' % (
labels[self.payment_order_type], self.reference)
date_maturity = payment_lines[0].date
date_maturity = bank_payment_lines[0].date
vals = {
'name': name,
'move_id': move.id,
@@ -172,24 +146,28 @@ class PaymentOrder(models.Model):
return vals
@api.multi
def _prepare_move_line_partner_account(self, line, move, labels):
if line.move_line_id:
account_id = line.move_line_id.account_id.id
def _prepare_move_line_partner_account(self, bank_line, move, labels):
# TODO : ALEXIS check don't group if move_line_id.account_id
# is not the same
if bank_line.payment_line_ids[0].move_line_id:
account_id =\
bank_line.payment_line_ids[0].move_line_id.account_id.id
else:
if self.payment_order_type == 'debit':
account_id = line.partner_id.property_account_receivable.id
account_id =\
bank_line.partner_id.property_account_receivable.id
else:
account_id = line.partner_id.property_account_payable.id
account_id = bank_line.partner_id.property_account_payable.id
vals = {
'name': _('%s line %s') % (
labels[self.payment_order_type], line.name),
labels[self.payment_order_type], bank_line.name),
'move_id': move.id,
'partner_id': line.partner_id.id,
'partner_id': bank_line.partner_id.id,
'account_id': account_id,
'credit': (self.payment_order_type == 'debit' and
line.amount or 0.0),
bank_line.amount_currency or 0.0),
'debit': (self.payment_order_type == 'payment' and
line.amount or 0.0),
bank_line.amount_currency or 0.0),
}
return vals
@@ -199,28 +177,35 @@ class PaymentOrder(models.Model):
return
@api.multi
def _create_move_line_partner_account(self, line, move, labels):
def _create_move_line_partner_account(self, bank_line, move, labels):
"""This method is designed to be inherited in a custom module"""
# TODO: take multicurrency into account
company_currency = self.env.user.company_id.currency_id
if bank_line.currency != company_currency:
raise UserError(_(
"Cannot generate the transfer move when "
"the currency of the payment (%s) is not the "
"same as the currency of the company. This "
"is not supported for the moment.")
% (bank_line.currency.name, company_currency.name))
aml_obj = self.env['account.move.line']
# create the payment/debit counterpart move line
# on the partner account
partner_ml_vals = self._prepare_move_line_partner_account(
line, move, labels)
bank_line, move, labels)
partner_move_line = aml_obj.create(partner_ml_vals)
# register the payment/debit move line
# on the payment line and call reconciliation on it
line.write({'transit_move_line_id': partner_move_line.id})
bank_line.write({'transit_move_line_id': partner_move_line.id})
@api.multi
def _reconcile_payment_lines(self, payment_lines):
for line in payment_lines:
if line.move_line_id:
line.debit_reconcile()
def _reconcile_payment_lines(self, bank_payment_lines):
for bline in bank_payment_lines:
if all([pline.move_line_id for pline in bline.payment_line_ids]):
bline.debit_reconcile()
else:
self.action_sent_no_move_line_hook(line)
self.action_sent_no_move_line_hook(bline)
@api.one
def action_sent(self):
@@ -232,8 +217,8 @@ class PaymentOrder(models.Model):
am_obj = self.env['account.move']
aml_obj = self.env['account.move.line']
labels = {
'payment': _('Payment order'),
'debit': _('Direct debit order'),
'payment': _('Payment'),
'debit': _('Direct debit'),
}
if self.mode.transfer_journal_id and self.mode.transfer_account_id:
# prepare a dict "trfmoves" that can be used when
@@ -241,37 +226,27 @@ class PaymentOrder(models.Model):
# key = unique identifier (date or True or line.id)
# value = [pay_line1, pay_line2, ...]
trfmoves = {}
if self.mode.transfer_move_option == 'line':
for line in self.line_ids:
trfmoves[line.id] = [line]
else:
if self.date_prefered in ('now', 'fixed'):
trfmoves[True] = []
for line in self.line_ids:
trfmoves[True].append(line)
else: # date_prefered == due
for line in self.line_ids:
if line.date in trfmoves:
trfmoves[line.date].append(line)
else:
trfmoves[line.date] = [line]
for bline in self.bank_line_ids:
hashcode = bline.move_line_transfer_account_hashcode()
if hashcode in trfmoves:
trfmoves[hashcode].append(bline)
else:
trfmoves[hashcode] = [bline]
for identifier, lines in trfmoves.iteritems():
for hashcode, blines in trfmoves.iteritems():
mvals = self._prepare_transfer_move()
move = am_obj.create(mvals)
total_amount = 0
for line in lines:
total_amount += line.amount
self._create_move_line_partner_account(line, move, labels)
for bline in blines:
total_amount += bline.amount_currency
self._create_move_line_partner_account(bline, move, labels)
# create the payment/debit move line on the transfer account
trf_ml_vals = self._prepare_move_line_transfer_account(
total_amount, move, lines, labels)
total_amount, move, blines, labels)
aml_obj.create(trf_ml_vals)
self._reconcile_payment_lines(lines)
self._reconcile_payment_lines(blines)
# consider entry_posted on account_journal
if move.journal_id.entry_posted:
# post account move
move.post()
# State field is written by act_sent_wait

View File

@@ -0,0 +1,94 @@
# -*- coding: utf-8 -*-
# © 2009 EduSense BV (<http://www.edusense.nl>)
# © 2011-2013 Therp BV (<http://therp.nl>)
# © 2015 Akretion (www.akretion.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api, _
from openerp.exceptions import Warning as UserError
class BankPaymentLine(models.Model):
_inherit = 'bank.payment.line'
transit_move_line_id = fields.Many2one(
'account.move.line', string='Transfer move line', readonly=True,
help="Move line through which the payment/debit order "
"pays the invoice")
transfer_move_line_id = fields.Many2one(
'account.move.line', compute='_get_transfer_move_line',
string='Transfer move line counterpart',
help="Counterpart move line on the transfer account")
@api.multi
def move_line_transfer_account_hashcode(self):
"""
This method is inherited in the module
account_banking_sepa_direct_debit
"""
self.ensure_one()
if self.order_id.mode.transfer_move_option == 'date':
hashcode = self.date
else:
hashcode = unicode(self.id)
return hashcode
@api.multi
def _get_transfer_move_line(self):
for bank_line in self:
if bank_line.transit_move_line_id:
order_type = bank_line.order_id.payment_order_type
trf_lines = bank_line.transit_move_line_id.move_id.line_id
for move_line in trf_lines:
if order_type == 'debit' and move_line.debit > 0:
bank_line.transfer_move_line_id = move_line
elif order_type == 'payment' and move_line.credit > 0:
bank_line.transfer_move_line_id = move_line
@api.one
def debit_reconcile(self):
"""
Reconcile a debit order's payment line with the the move line
that it is based on. Called from payment_order.action_sent().
As the amount is derived directly from the counterpart move line,
we do not expect a write off. Take partial reconciliations into
account though.
:param payment_line_id: the single id of the canceled payment line
"""
transit_move_line = self.transit_move_line_id
assert not transit_move_line.reconcile_id,\
'Transit move should not be reconciled'
assert not transit_move_line.reconcile_partial_id,\
'Transit move should not be partially reconciled'
lines_to_rec = transit_move_line
for payment_line in self.payment_line_ids:
if not payment_line.move_line_id:
raise UserError(_(
"Can not reconcile: no move line for "
"payment line %s of partner '%s'.") % (
payment_line.name,
payment_line.partner_id.name))
if payment_line.move_line_id.reconcile_id:
raise UserError(_(
"Move line '%s' of partner '%s' has already "
"been reconciled") % (
payment_line.move_line_id.name,
payment_line.partner_id.name))
if (
payment_line.move_line_id.account_id !=
transit_move_line.account_id):
raise UserError(_(
"For partner '%s', the account of the account "
"move line to pay (%s) is different from the "
"account of of the transit move line (%s).") % (
payment_line.move_line_id.partner_id.name,
payment_line.move_line_id.account_id.code,
transit_move_line.account_id.code))
lines_to_rec += payment_line.move_line_id
lines_to_rec.reconcile_partial(type='auto')

View File

@@ -1,29 +1,9 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).
# (C) 2011 - 2013 Therp BV (<http://therp.nl>).
#
# All other contributions are (C) by their respective contributors
#
# 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 openerp import models, fields, workflow, api, exceptions
from openerp.tools.translate import _
# © 2009 EduSense BV (<http://www.edusense.nl>)
# © 2011-2013 Therp BV (<http://therp.nl>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
class PaymentLine(models.Model):
@@ -35,110 +15,17 @@ class PaymentLine(models.Model):
'''
_inherit = 'payment.line'
@api.multi
def _get_transfer_move_line(self):
for order_line in self:
if order_line.transit_move_line_id:
order_type = order_line.order_id.payment_order_type
trf_lines = order_line.transit_move_line_id.move_id.line_id
for move_line in trf_lines:
if order_type == 'debit' and move_line.debit > 0:
order_line.transfer_move_line_id = move_line
elif order_type == 'payment' and move_line.credit > 0:
order_line.transfer_move_line_id = move_line
msg = fields.Char('Message', required=False, readonly=True, default='')
date_done = fields.Date('Date Confirmed', select=True, readonly=True)
transit_move_line_id = fields.Many2one(
'account.move.line', string='Transfer move line', readonly=True,
help="Move line through which the payment/debit order "
"pays the invoice")
transfer_move_line_id = fields.Many2one(
'account.move.line', compute='_get_transfer_move_line',
string='Transfer move line counterpart',
help="Counterpart move line on the transfer account")
"""
Hooks for processing direct debit orders, such as implemented in
account_direct_debit module.
"""
@api.multi
def get_storno_account_id(self, amount, currency_id):
"""
Hook for verifying a match of the payment line with the amount.
Return the account associated with the storno.
Used in account_banking interactive mode
:param payment_line_id: the single payment line id
:param amount: the (signed) amount debited from the bank account
:param currency: the bank account's currency *browse object*
:return: an account if there is a full match, False otherwise
:rtype: database id of an account.account resource.
"""
return False
@api.multi
def debit_storno(self, amount, currency_id, storno_retry=True):
def payment_line_hashcode(self):
"""
Hook for handling a canceled item of a direct debit order.
Presumably called from a bank statement import routine.
Decide on the direction that the invoice's workflow needs to take.
You may optionally return an incomplete reconcile for the caller
to reconcile the now void payment.
:param payment_line_id: the single payment line id
:param amount: the (negative) amount debited from the bank account
:param currency: the bank account's currency *browse object*
:param boolean storno_retry: whether the storno is considered fatal \
or not.
:return: an incomplete reconcile for the caller to fill
:rtype: database id of an account.move.reconcile resource.
Don't group the payment lines that are attached to the same supplier
but to move lines with different accounts (very unlikely),
for easier generation/comprehension of the transfer move
"""
return False
@api.one
def debit_reconcile(self):
"""
Reconcile a debit order's payment line with the the move line
that it is based on. Called from payment_order.action_sent().
As the amount is derived directly from the counterpart move line,
we do not expect a write off. Take partial reconciliations into
account though.
:param payment_line_id: the single id of the canceled payment line
"""
transit_move_line = self.transit_move_line_id
torec_move_line = self.move_line_id
if (not transit_move_line or not torec_move_line):
raise exceptions.except_orm(
_('Can not reconcile'),
_('No move line for line %s') % self.name
)
if torec_move_line.reconcile_id:
raise exceptions.except_orm(
_('Error'),
_('Move line %s has already been reconciled') %
torec_move_line.name
)
if (transit_move_line.reconcile_id or
transit_move_line.reconcile_partial_id):
raise exceptions.except_orm(
_('Error'),
_('Move line %s has already been reconciled') %
transit_move_line.name
)
line_ids = [transit_move_line.id, torec_move_line.id]
self.env['account.move.line'].browse(line_ids).reconcile_partial(
type='auto')
# If a bank transaction of a storno was first confirmed
# and now canceled (the invoice is now in state 'debit_denied'
if torec_move_line.invoice:
workflow.trg_validate(
self.env.uid, 'account.invoice', torec_move_line.invoice.id,
'undo_debit_denied', self.env.cr)
res = super(PaymentLine, self).payment_line_hashcode()
res += '-' + unicode(
self.move_line_id and self.move_line_id.account_id or False)
return res

View File

@@ -1,28 +1,8 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).
# (C) 2011 - 2013 Therp BV (<http://therp.nl>).
# (C) 2014 Akretion (www.akretion.com)
#
# All other contributions are (C) by their respective contributors
#
# 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/>.
#
##############################################################################
# © 2009 EduSense BV (<http://www.edusense.nl>)
# © 2011-2013 Therp BV (<http://therp.nl>)
# © 2014 Akretion (www.akretion.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields

View File

@@ -1,24 +1,6 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Account Banking Payment Transfer module for Odoo
# Copyright (C) 2015 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# © 2015 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
def set_date_sent(cr, pool):

View File

@@ -42,7 +42,7 @@
quantity: 1.0
journal_id: account.expenses_journal
-
Make sure that the type is in_invoice
Make sure that the type is in_refund
-
!python {model: account.invoice}: |
self.write(cr, uid, ref("account_refund_supplier_refunded"), {'type': 'in_refund'})
@@ -51,67 +51,38 @@
-
!workflow {model: account.invoice, action: invoice_open, ref: account_refund_supplier_refunded}
-
I reconcile the invoice and the refund
-
!record {model: account.move.line.reconcile, id: account_move_line_reconcile0}:
trans_nbr: 2
credit: 600.0
debit: 200.0
writeoff: -400.0
-
Then I click on the 'Partial Reconcile' button
-
!python {model: account.move.line.reconcile}: |
move_line_obj = self.pool.get('account.move.line')
inv_obj = self.pool.get('account.invoice')
invoice_move_id = inv_obj.browse(cr, uid, ref("account_invoice_supplier_refunded")).move_id.id
refund_move_id = inv_obj.browse(cr, uid, ref("account_refund_supplier_refunded")).move_id.id
debit_line_id = move_line_obj.search(cr, uid, [('move_id', '=', refund_move_id),('debit', '=', 200)])[0]
credit_line_id = move_line_obj.search(cr, uid, [('move_id', '=', invoice_move_id),('credit', '=', 600)])[0]
ids = [debit_line_id, credit_line_id]
partial_reconcile = self.trans_rec_reconcile_partial_reconcile(cr, uid, [ref('account_move_line_reconcile0')], {
'active_model': 'account.move.line', 'active_ids': ids, 'tz': False, 'active_id': ids[1]})
move_line = move_line_obj.browse(cr, uid, ids)
assert move_line[0].reconcile_partial_id, "Partial reconcilation is not done"
-
I check that the invoice balance (residual) is now 400
-
!assert {model: account.invoice, id: account_invoice_supplier_refunded, severity: error, string: Invoice residual should be 400.}:
- residual == 400
- amount_total == 600
-
I create a payment order on which I will select the invoice I created
I create a payment order
-
!record {model: payment.order, id: partial_payment_order_1}:
mode: account_banking_payment_transfer.payment_mode0
date_prefered: 'due'
date_prefered: 'now'
-
!record {model: payment.order.create, id: payment_order_create_1}:
duedate: !eval time.strftime('%Y-%m-%d')
-
I search for the invoice entries to make the payment.
-
!python {model: payment.order.create}: |
self.search_entries(cr, uid, [ref("payment_order_create_1")], {
"active_model": "payment.order", "active_ids": [ref("partial_payment_order_1")],
"active_id": ref("partial_payment_order_1"), })
-
I create payment lines entries.
I run the select move line to pay wizard
-
!python {model: payment.order.create}: |
context = {
"active_model": "payment.order",
"active_ids": [ref("partial_payment_order_1")],
"active_id": ref("partial_payment_order_1"),
}
wiz_id = self.create(cr, uid, {}, context=context)
self.search_entries(cr, uid, [wiz_id], context=context)
mline_ids = []
invoice = self.pool.get('account.invoice').browse(cr, uid, ref("account_invoice_supplier_refunded"))
for l in invoice.move_id.line_id:
if not l.debit and l.credit:
move_line = l
mline_ids.append(l.id)
break
self.write(cr, uid, [ref("payment_order_create_1")], {'entries': [(6,0,[move_line.id])]})
self.create_payment(cr, uid, [ref("payment_order_create_1")], {
"active_model": "payment.order", "active_ids": [ref("partial_payment_order_1")],
"active_id": ref("partial_payment_order_1")})
refund = self.pool.get('account.invoice').browse(cr, uid, ref("account_refund_supplier_refunded"))
for l in refund.move_id.line_id:
if not l.credit and l.debit:
mline_ids.append(l.id)
break
self.write(cr, uid, [wiz_id], {'entries': [(6, 0, mline_ids)]})
self.create_payment(cr, uid, [wiz_id], context=context)
pay_obj = self.pool.get('payment.order')
pay = pay_obj.browse(cr, uid, ref('partial_payment_order_1'))
assert pay.line_ids[0].amount_currency == 400
assert pay.total == 400
assert len(pay.line_ids) == 2
-
I confirm the payment order.
-
@@ -121,6 +92,7 @@
-
!assert {model: payment.order, id: partial_payment_order_1, severity: error, string: Payment Order should be 'Confirmed'.}:
- state == 'open'
- total == 400.0
-
I create the wizard for paying the payment
-
@@ -159,4 +131,4 @@
!assert {model: account.invoice, id: account_invoice_supplier_refunded, severity: error, string: Invoice residual should be 0.}:
- residual == 0
- amount_total == 600
- state == 'paid'
- state == 'paid'

View File

@@ -25,31 +25,26 @@
-
!workflow {model: account.invoice, action: invoice_open, ref: account_invoice_supplier_partial}
-
I create a payment order on which I will select the invoice I created
I create a payment order
-
!record {model: payment.order, id: partial_payment_order_2}:
mode: account_banking_payment_transfer.payment_mode0
date_prefered: 'due'
-
!record {model: payment.order.create, id: payment_order_create_2}:
duedate: !eval time.strftime('%Y-%m-%d')
-
I search for the invoice entries to make the payment.
-
!python {model: payment.order.create}: |
self.search_entries(cr, uid, [ref("payment_order_create_2")], {
"active_model": "payment.order", "active_ids": [ref("partial_payment_order_2")],
"active_id": ref("partial_payment_order_2"), })
-
I create payment lines entries.
I run the select move line to pay wizard
-
!python {model: payment.order.create}: |
context = {
"active_model": "payment.order",
"active_ids": [ref("partial_payment_order_2")],
"active_id": ref("partial_payment_order_2"),
}
wiz_id = self.create(cr, uid, {}, context=context)
self.search_entries(cr, uid, [wiz_id], context=context)
invoice = self.pool.get('account.invoice').browse(cr, uid, ref("account_invoice_supplier_partial"))
move_line = invoice.move_id.line_id[0]
self.write(cr, uid, [ref("payment_order_create_2")], {'entries': [(6,0,[move_line.id])]})
self.create_payment(cr, uid, [ref("payment_order_create_2")], {
"active_model": "payment.order", "active_ids": [ref("partial_payment_order_2")],
"active_id": ref("partial_payment_order_2")})
self.write(cr, uid, [wiz_id], {'entries': [(6, 0, [move_line.id])]})
self.create_payment(cr, uid, [wiz_id], context=context)
pay_obj = self.pool.get('payment.order')
pay = pay_obj.browse(cr, uid, ref('partial_payment_order_2'))
assert pay.line_ids
@@ -118,29 +113,24 @@
!record {model: payment.order, id: partial_partial_payment_order_2}:
mode: account_banking_payment_transfer.payment_mode0
date_prefered: 'due'
-
!record {model: payment.order.create, id: partial_payment_order_create_2}:
duedate: !eval time.strftime('%Y-%m-%d')
-
I search for the invoice entries to make the payment.
-
!python {model: payment.order.create}: |
self.search_entries(cr, uid, [ref("partial_payment_order_create_2")], {
"active_model": "payment.order", "active_ids": [ref("partial_partial_payment_order_2")],
"active_id": ref("partial_partial_payment_order_2"), })
-
I create payment lines entries.
-
!python {model: payment.order.create}: |
context = {
"active_model": "payment.order",
"active_ids": [ref("partial_partial_payment_order_2")],
"active_id": ref("partial_partial_payment_order_2"),
}
wiz_id = self.create(cr, uid, {}, context=context)
self.search_entries(cr, uid, [wiz_id], context=context)
invoice = self.pool.get('account.invoice').browse(cr, uid, ref("account_invoice_supplier_partial"))
for l in invoice.move_id.line_id:
if not l.debit and l.credit:
move_line = l
break
self.write(cr, uid, [ref("partial_payment_order_create_2")], {'entries': [(6,0,[move_line.id])]})
self.create_payment(cr, uid, [ref("partial_payment_order_create_2")], {
"active_model": "payment.order", "active_ids": [ref("partial_partial_payment_order_2")],
"active_id": ref("partial_partial_payment_order_2")})
self.write(cr, uid, [wiz_id], {'entries': [(6,0,[move_line.id])]})
self.create_payment(cr, uid, [wiz_id], context=context)
pay_obj = self.pool.get('payment.order')
pay = pay_obj.browse(cr, uid, ref('partial_partial_payment_order_2'))
assert len(pay.line_ids) == 1
@@ -198,29 +188,24 @@
!record {model: payment.order, id: partial_partial_payment_order_3}:
mode: account_banking_payment_transfer.payment_mode0
date_prefered: 'due'
-
!record {model: payment.order.create, id: partial_payment_order_create_3}:
duedate: !eval time.strftime('%Y-%m-%d')
-
I search for the invoice entries to make the payment.
-
!python {model: payment.order.create}: |
self.search_entries(cr, uid, [ref("partial_payment_order_create_3")], {
"active_model": "payment.order", "active_ids": [ref("partial_partial_payment_order_3")],
"active_id": ref("partial_partial_payment_order_3"), })
-
I create payment lines entries.
-
!python {model: payment.order.create}: |
context = {
"active_model": "payment.order",
"active_ids": [ref("partial_partial_payment_order_3")],
"active_id": ref("partial_partial_payment_order_3"),
}
wiz_id = self.create(cr, uid, {}, context=context)
self.search_entries(cr, uid, [wiz_id], context=context)
invoice = self.pool.get('account.invoice').browse(cr, uid, ref("account_invoice_supplier_partial"))
for l in invoice.move_id.line_id:
if not l.debit and l.credit:
move_line = l
break
self.write(cr, uid, [ref("partial_payment_order_create_3")], {'entries': [(6,0,[move_line.id])]})
self.create_payment(cr, uid, [ref("partial_payment_order_create_3")], {
"active_model": "payment.order", "active_ids": [ref("partial_partial_payment_order_3")],
"active_id": ref("partial_partial_payment_order_3")})
self.write(cr, uid, [wiz_id], {'entries': [(6, 0, [move_line.id])]})
self.create_payment(cr, uid, [wiz_id], context=context)
pay_obj = self.pool.get('payment.order')
pay = pay_obj.browse(cr, uid, ref('partial_partial_payment_order_3'))
assert len(pay.line_ids) == 1
@@ -265,12 +250,3 @@
assert sum_credit == 0
assert inv.residual == 0
assert inv.state == 'paid'

View File

@@ -2,7 +2,7 @@
I create a supplier invoice
-
!record {model: account.invoice, id: account_invoice_supplier0, view: account.invoice_supplier_form}:
check_total: 450.0
check_total: 1005.55
partner_id: base.res_partner_4
reference_type: none
type: in_invoice
@@ -35,34 +35,29 @@
- state == 'open'
- type == 'in_invoice'
-
I create a payment order on which I will select the invoice I created
I create a payment order
-
!record {model: payment.order, id: payment_order_0}:
mode: account_banking_payment_transfer.payment_mode0
date_prefered: 'due'
-
!record {model: payment.order.create, id: payment_order_create_0}:
duedate: !eval time.strftime('%Y-%m-%d')
-
I search for the invoice entries to make the payment.
-
!python {model: payment.order.create}: |
self.search_entries(cr, uid, [ref("payment_order_create_0")], {
"active_model": "payment.order", "active_ids": [ref("payment_order_0")],
"active_id": ref("payment_order_0"), })
-
I create payment lines entries.
I run the select move line to pay wizard
-
!python {model: payment.order.create}: |
context = {
"active_model": "payment.order",
"active_ids": [ref("payment_order_0")],
"active_id": ref("payment_order_0"),
}
wiz_id = self.create(cr, uid, {}, context=context)
self.search_entries(cr, uid, [wiz_id], context=context)
invoice = self.pool.get('account.invoice').browse(cr, uid, ref("account_invoice_supplier0"))
entries = []
for move_line in invoice.move_id.line_id:
if move_line.credit and not move_line.debit:
entries.append((6, 0, [move_line.id]))
self.write(cr, uid, [ref("payment_order_create_0")], {'entries': entries})
self.create_payment(cr, uid, [ref("payment_order_create_0")], {
"active_model": "payment.order", "active_ids": [ref("payment_order_0")],
"active_id": ref("payment_order_0")})
self.write(cr, uid, [wiz_id], {'entries': entries})
self.create_payment(cr, uid, [wiz_id], context=context)
pay_obj = self.pool.get('payment.order')
pay = pay_obj.browse(cr, uid, ref('payment_order_0'))
for line in pay.line_ids:
@@ -161,4 +156,4 @@
I check that the payment is done
-
!assert {model: payment.order, id: payment_order_0, severity: error, string: Payment Order should be done}:
- state == 'done'
- state == 'done'

View File

@@ -4,7 +4,7 @@
<record id="view_payment_order_form_inherit" model="ir.ui.view">
<field name="name">account.payment.order.form (account_banking_payment_transfer)</field>
<field name="model">payment.order</field>
<field name="inherit_id" ref="account_payment.view_payment_order_form" />
<field name="inherit_id" ref="account_banking_payment_export.view_payment_order_form" />
<field name="arch" type="xml">
<xpath expr="//button[@name='%(account_payment.action_create_payment_order)d']" position="after">
<button class="oe_inline oe_stat_button"
@@ -14,7 +14,22 @@
<field name="partial_reconcile_count" widget="statinfo"/>
</button>
</xpath>
<field name="mode" position="after">
<field name="date_sent"/>
</field>
</field>
</record>
<record id="view_payment_order_tree" model="ir.ui.view">
<field name="name">account_banking_payment_transfer.payment.order.tree</field>
<field name="model">payment.order</field>
<field name="inherit_id" ref="account_banking_payment_export.view_payment_order_tree" />
<field name="arch" type="xml">
<field name="date_done" position="before">
<field name="date_sent"/>
</field>
</field>
</record>
</data>
</openerp>

View File

@@ -1,23 +1,4 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# SEPA Credit Transfer module for OpenERP
# Copyright (C) 2010-2013 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# © 2010-2013 Akretion (www.akretion.com)
from . import wizard

View File

@@ -1,28 +1,12 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# SEPA Credit Transfer module for Odoo
# Copyright (C) 2010-2015 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# © 2010-2015 Akretion (www.akretion.com)
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Account Banking SEPA Credit Transfer',
'summary': 'Create SEPA XML files for Credit Transfers',
'version': '8.0.0.3.0',
'version': '8.0.0.4.0',
'license': 'AGPL-3',
'author': "Akretion, "
"Serv. Tecnol. Avanzados - Pedro M. Baeza, "

View File

@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-10-31 22:52+0000\n"
"PO-Revision-Date: 2014-10-31 22:52+0000\n"
"POT-Creation-Date: 2016-02-16 07:50+0000\n"
"PO-Revision-Date: 2016-02-16 07:50+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -16,19 +16,22 @@ msgstr ""
"Plural-Forms: \n"
#. module: account_banking_sepa_credit_transfer
#: field:banking.export.sepa,batch_booking:0
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:199
#, python-format
msgid "Bank account is missing on the bank payment line of partner '%s' (reference '%s')."
msgstr "Falta la cuenta bancaria en la línea de pago de la empresa '%s' (referencia '%s')."
#. module: account_banking_sepa_credit_transfer
#: field:banking.export.sepa.wizard,batch_booking:0
msgid "Batch Booking"
msgstr "Registro en lote"
#. module: account_banking_sepa_credit_transfer
#: selection:banking.export.sepa,charge_bearer:0
#: selection:banking.export.sepa.wizard,charge_bearer:0
msgid "Borne by Creditor"
msgstr "A cargo del acreedor"
#. module: account_banking_sepa_credit_transfer
#: selection:banking.export.sepa,charge_bearer:0
#: selection:banking.export.sepa.wizard,charge_bearer:0
msgid "Borne by Debtor"
msgstr "A cargo del deudor"
@@ -39,7 +42,6 @@ msgid "Cancel"
msgstr "Cancelar"
#. module: account_banking_sepa_credit_transfer
#: field:banking.export.sepa,charge_bearer:0
#: field:banking.export.sepa.wizard,charge_bearer:0
msgid "Charge Bearer"
msgstr "A cargo del portador"
@@ -50,7 +52,6 @@ msgid "Create"
msgstr "Crear"
#. module: account_banking_sepa_credit_transfer
#: field:banking.export.sepa,create_uid:0
#: field:banking.export.sepa.wizard,create_uid:0
msgid "Created by"
msgstr "Creado por"
@@ -60,18 +61,6 @@ msgstr "Creado por"
msgid "Created on"
msgstr "Creado en"
#. module: account_banking_sepa_credit_transfer
#: selection:banking.export.sepa,state:0
msgid "Draft"
msgstr "Borrador"
#. module: account_banking_sepa_credit_transfer
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:124
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:232
#, python-format
msgid "Error:"
msgstr "Error:"
#. module: account_banking_sepa_credit_transfer
#: model:ir.model,name:account_banking_sepa_credit_transfer.model_banking_export_sepa_wizard
msgid "Export SEPA Credit Transfer File"
@@ -93,97 +82,55 @@ msgid "Finish"
msgstr "Finalizar"
#. module: account_banking_sepa_credit_transfer
#: selection:banking.export.sepa,charge_bearer:0
#: selection:banking.export.sepa.wizard,charge_bearer:0
msgid "Following Service Level"
msgstr "Según el acuerdo de servicio"
#. module: account_banking_sepa_credit_transfer
#: help:banking.export.sepa,charge_bearer:0
msgid "Following service level : transaction charges are to be applied following the rules agreed in the service level and/or scheme (SEPA Core messages must use this). Shared : transaction charges on the creditor side are to be borne by the creditor, transaction charges on the debtor side are to be borne by the debtor. Borne by creditor : all transaction charges are to be borne by the creditor. Borne by debtor : all transaction charges are to be borne by the debtor."
msgstr "Según el acuerdo de servicio: los costes de la transacción se aplicarán siguiendo las reglas acordadas en el nivel de servicio y/o en el esquema (las remesas SEPA Core deben usar esta opción). Compartidos: los costes de la transacción en la parte del acreedor están a cargo del acreedor, y los costes de la transacción del lado del deudor estarán a cargo del deudor. A cargo del acreedor: todos los costes de la transacción estarán a cargo del acreedor. A cargo del deudor: Todos los costes de la transacción estarán a cargo del deudor."
#. module: account_banking_sepa_credit_transfer
#: help:banking.export.sepa.wizard,charge_bearer:0
msgid "Following service level : transaction charges are to be applied following the rules agreed in the service level and/or scheme (SEPA Core messages must use this). Shared : transaction charges on the debtor side are to be borne by the debtor, transaction charges on the creditor side are to be borne by the creditor. Borne by creditor : all transaction charges are to be borne by the creditor. Borne by debtor : all transaction charges are to be borne by the debtor."
msgstr "Según el acuerdo de servicio: los costes de la transacción se aplicarán siguiendo las reglas acordadas en el nivel de servicio y/o en el esquema (las remesas SEPA Core deben usar esta opción). Compartidos: los costes de la transacción en la parte del acreedor están a cargo del acreedor, y los costes de la transacción del lado del deudor estarán a cargo del deudor. A cargo del acreedor: todos los costes de la transacción estarán a cargo del acreedor. A cargo del deudor: Todos los costes de la transacción estarán a cargo del deudor."
#. module: account_banking_sepa_credit_transfer
#: view:banking.export.sepa:account_banking_sepa_credit_transfer.view_banking_export_sepa_form
msgid "General Information"
msgstr "Información general"
#. module: account_banking_sepa_credit_transfer
#: view:banking.export.sepa.wizard:account_banking_sepa_credit_transfer.banking_export_sepa_wizard_view
msgid "Generate"
msgstr "Generar"
#. module: account_banking_sepa_credit_transfer
#: field:banking.export.sepa,create_date:0
msgid "Generation Date"
msgstr "Fecha de generación"
#. module: account_banking_sepa_credit_transfer
#: field:banking.export.sepa,id:0
#: field:banking.export.sepa.wizard,id:0
msgid "ID"
msgstr "ID"
#. module: account_banking_sepa_credit_transfer
#: help:banking.export.sepa,batch_booking:0
#: help:banking.export.sepa.wizard,batch_booking:0
msgid "If true, the bank statement will display only one debit line for all the wire transfers of the SEPA XML file ; if false, the bank statement will display one debit line per wire transfer of the SEPA XML file."
msgstr "Si está marcado, el extracto bancario mostrará sólo una línea del haber para todos los adeudos directos del archivo SEPA; si no está marcado, entonces el extracto bancario mostrará una línea por cada adeudo directo del archivo SEPA."
#. module: account_banking_sepa_credit_transfer
#: field:banking.export.sepa,write_uid:0
#: field:banking.export.sepa.wizard,write_uid:0
msgid "Last Updated by"
msgstr "Última actualización por"
#. module: account_banking_sepa_credit_transfer
#: field:banking.export.sepa,write_date:0
#: field:banking.export.sepa.wizard,write_date:0
msgid "Last Updated on"
msgstr "Última actualización en"
#. module: account_banking_sepa_credit_transfer
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:233
#, python-format
msgid "Missing Bank Account on invoice '%s' (payment order line reference '%s')."
msgstr "Falta la cuenta bancaria en la factura '%s' (línea de pago con referencia '%s')."
#. module: account_banking_sepa_credit_transfer
#: field:banking.export.sepa,nb_transactions:0
#: field:banking.export.sepa.wizard,nb_transactions:0
msgid "Number of Transactions"
msgstr "Nº de transacciones"
#. module: account_banking_sepa_credit_transfer
#: view:banking.export.sepa:account_banking_sepa_credit_transfer.view_banking_export_sepa_form
#: field:banking.export.sepa,payment_order_ids:0
#: field:banking.export.sepa.wizard,payment_order_ids:0
msgid "Payment Orders"
msgstr "Órdenes de pago"
#. module: account_banking_sepa_credit_transfer
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:125
#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:98
#, python-format
msgid "Payment Type Code '%s' is not supported. The only Payment Type Codes supported for SEPA Credit Transfers are 'pain.001.001.02', 'pain.001.001.03', 'pain.001.001.04' and 'pain.001.001.05'."
msgstr "El código de tipo de pago '%s' no está soportado. Los únicos código de tipo de pago soportados por las transferencias SEPA son 'pain.001.001.02', 'pain.001.001.03', 'pain.001.001.04' y 'pain.001.001.05'."
#. module: account_banking_sepa_credit_transfer
#: view:banking.export.sepa:account_banking_sepa_credit_transfer.view_banking_export_sepa_form
#: view:banking.export.sepa:account_banking_sepa_credit_transfer.view_banking_export_sepa_tree
msgid "SEPA Credit Transfer"
msgstr "Transferencia SEPA"
#. module: account_banking_sepa_credit_transfer
#: model:ir.actions.act_window,name:account_banking_sepa_credit_transfer.act_banking_export_sepa_payment_order
#: model:ir.actions.act_window,name:account_banking_sepa_credit_transfer.action_account_banking_sepa
#: model:ir.ui.menu,name:account_banking_sepa_credit_transfer.menu_account_banking_sepa
msgid "SEPA Credit Transfer Files"
msgstr "Archivos de transferencias SEPA"
msgid "Payment Type Code '%s' is not supported. The only Payment Type Codes supported for SEPA Credit Transfers are 'pain.001.001.02', 'pain.001.001.03', 'pain.001.001.04', 'pain.001.001.05' and 'pain.001.003.03'."
msgstr "El código de tipo de pago '%s' no está soportado. Los únicos códigos de tipo de pago soportados para una transferencia de crédito SEPA son 'pain.001.001.02', 'pain.001.001.03', 'pain.001.001.04', 'pain.001.001.05' y 'pain.001.003.03'."
#. module: account_banking_sepa_credit_transfer
#: view:banking.export.sepa.wizard:account_banking_sepa_credit_transfer.banking_export_sepa_wizard_view
@@ -191,35 +138,16 @@ msgid "SEPA File Generation"
msgstr "Generación de archivo SEPA"
#. module: account_banking_sepa_credit_transfer
#: field:banking.export.sepa,file:0
#: field:banking.export.sepa.wizard,file_id:0
msgid "SEPA XML File"
msgstr "Archivo SEPA XML"
#. module: account_banking_sepa_credit_transfer
#: model:ir.model,name:account_banking_sepa_credit_transfer.model_banking_export_sepa
msgid "SEPA export"
msgstr "Exportación de SEPA"
#. module: account_banking_sepa_credit_transfer
#: selection:banking.export.sepa,state:0
msgid "Sent"
msgstr "Enviado"
#. module: account_banking_sepa_credit_transfer
#: selection:banking.export.sepa,charge_bearer:0
#: selection:banking.export.sepa.wizard,charge_bearer:0
msgid "Shared"
msgstr "Compartidos"
#. module: account_banking_sepa_credit_transfer
#: field:banking.export.sepa,state:0
#: field:banking.export.sepa.wizard,state:0
msgid "State"
msgstr "Estado"
#. module: account_banking_sepa_credit_transfer
#: field:banking.export.sepa,total_amount:0
#: field:banking.export.sepa.wizard,total_amount:0
msgid "Total Amount"
msgstr "Importe total"

View File

@@ -1,23 +1,5 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# SEPA Credit Transfer module for Odoo
# Copyright (C) 2010-2013 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# © 2010-2013 Akretion (www.akretion.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import export_sepa

View File

@@ -1,25 +1,7 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# SEPA Credit Transfer module for Odoo
# Copyright (C) 2010-2015 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# © 2010-2015 Akretion (www.akretion.com)
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api, _
from openerp.exceptions import Warning
@@ -151,25 +133,19 @@ class BankingExportSepaWizard(models.TransientModel):
lines_per_group = {}
# key = (requested_date, priority)
# values = list of lines as object
today = fields.Date.context_today(self)
for payment_order in self.payment_order_ids:
total_amount = total_amount + payment_order.total
for line in payment_order.line_ids:
for line in payment_order.bank_line_ids:
priority = line.priority
if payment_order.date_prefered == 'due':
requested_date = line.ml_maturity_date or today
elif payment_order.date_prefered == 'fixed':
requested_date = payment_order.date_scheduled or today
else:
requested_date = today
key = (requested_date, priority)
# The field line.date is the requested payment date
# taking into account the 'date_prefered' setting
# cf account_banking_payment_export/models/account_payment.py
# in the inherit of action_open()
key = (line.date, priority)
if key in lines_per_group:
lines_per_group[key].append(line)
else:
lines_per_group[key] = [line]
# Write requested_date on 'Payment date' of the pay line
if requested_date != line.date:
line.date = requested_date
for (requested_date, priority), lines in lines_per_group.items():
# B. Payment info
payment_info_2_0, nb_of_transactions_2_4, control_sum_2_5 = \
@@ -220,9 +196,9 @@ class BankingExportSepaWizard(models.TransientModel):
amount_control_sum_2_5 += line.amount_currency
if not line.bank_id:
raise Warning(
_("Missing Bank Account on invoice '%s' (payment "
"order line reference '%s').")
% (line.ml_inv_ref.number, line.name))
_("Bank account is missing on the bank payment line "
"of partner '%s' (reference '%s').")
% (line.partner_id.name, line.name))
self.generate_party_block(
credit_transfer_transaction_info_2_27, 'Cdtr',
'C', 'line.partner_id.name', 'line.bank_id.acc_number',

View File

@@ -1,24 +1,6 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# SEPA Direct Debit module for OpenERP
# Copyright (C) 2013 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# © 2013 Akretion (www.akretion.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import models
from . import wizard

View File

@@ -1,28 +1,12 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# SEPA Direct Debit module for Odoo
# Copyright (C) 2013-2015 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# © 2013-2015 Akretion (www.akretion.com)
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Account Banking SEPA Direct Debit',
'summary': 'Create SEPA files for Direct Debit',
'version': '8.0.0.2.0',
'version': '8.0.0.3.0',
'license': 'AGPL-3',
'author': "Akretion, "
"Serv. Tecnol. Avanzados - Pedro M. Baeza, "

View File

@@ -10,6 +10,7 @@
<field name="company_id" ref="base.main_company"/>
<field name="type" ref="export_sdd_008_001_02"/>
<field name="purchase_ok" eval="False"/>
<field name="default_journal_ids" search="[('type', 'in', ('sale', 'sale_refund'))]"/>
</record>
<record id="base.main_company" model="res.company">

View File

@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-10-31 22:53+0000\n"
"PO-Revision-Date: 2014-10-31 22:53+0000\n"
"POT-Creation-Date: 2016-02-16 07:53+0000\n"
"PO-Revision-Date: 2016-02-16 07:53+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -18,17 +18,17 @@ msgstr ""
#. module: account_banking_sepa_direct_debit
#: model:ir.actions.act_window,help:account_banking_sepa_direct_debit.mandate_action
msgid "<p class=\"oe_view_nocontent_create\">\n"
" Click to create a new SEPA Direct Debit Mandate.\n"
" </p><p>\n"
" A SEPA Direct Debit Mandate is a document signed by your customer that gives you the autorization to do one or several direct debits on his bank account.\n"
" </p>\n"
" "
" Click to create a new SEPA Direct Debit Mandate.\n"
" </p><p>\n"
" A SEPA Direct Debit Mandate is a document signed by your customer that gives you the autorization to do one or several direct debits on his bank account.\n"
" </p>\n"
" "
msgstr "<p class=\"oe_view_nocontent_create\">\n"
" Pulse para crear un nuevo mandato de adeudo directo SEPA.\n"
" </p><p>\n"
" Un mandato de adeudo directo SEPA es un documento firmado por su cliente que le autoriza a realizar uno o más cobros directos en su cuenta bancaria, también conocidas como domiciliaciones.\n"
" </p>\n"
" "
" Pulse para crear un nuevo mandato bancario.\n"
" </p><p>\n"
" Un mandato bancario es un documento firmado por su cliente que le da la autorización para hacer una o varias operaciones en su cuenta bancaria.\n"
" </p>\n"
" "
#. module: account_banking_sepa_direct_debit
#: model:ir.model,name:account_banking_sepa_direct_debit.model_account_banking_mandate
@@ -36,10 +36,15 @@ msgid "A generic banking mandate"
msgstr "Un mandato bancario genérico"
#. module: account_banking_sepa_direct_debit
#: code:addons/account_banking_sepa_direct_debit/models/account_banking_mandate.py:120
#: code:addons/account_banking_sepa_direct_debit/models/account_banking_mandate.py:106
#, python-format
msgid "As you changed the bank account attached to this mandate, the 'Sequence Type' has been set back to 'First'."
msgstr "Puesto que ha cambiar la cuenta bancaria relacionada con este mandato, el 'Tipo de secuencia' se ha vuelto a 'Inicial'."
msgstr "Puesto que ha cambiado la cuenta bancaria relacionada con este mandato, el 'Tipo de secuencia' se ha vuelto a 'Inicial'."
#. module: account_banking_sepa_direct_debit
#: model:ir.model,name:account_banking_sepa_direct_debit.model_bank_payment_line
msgid "Bank Payment Lines"
msgstr "Lineas de pago bancario"
#. module: account_banking_sepa_direct_debit
#: selection:account.banking.mandate,scheme:0
@@ -47,19 +52,16 @@ msgid "Basic (CORE)"
msgstr "Básico (CORE)"
#. module: account_banking_sepa_direct_debit
#: field:banking.export.sdd,batch_booking:0
#: field:banking.export.sdd.wizard,batch_booking:0
msgid "Batch Booking"
msgstr "Registro en lote"
#. module: account_banking_sepa_direct_debit
#: selection:banking.export.sdd,charge_bearer:0
#: selection:banking.export.sdd.wizard,charge_bearer:0
msgid "Borne by Creditor"
msgstr "A cargo del acreedor"
#. module: account_banking_sepa_direct_debit
#: selection:banking.export.sdd,charge_bearer:0
#: selection:banking.export.sdd.wizard,charge_bearer:0
msgid "Borne by Debtor"
msgstr "A cargo del deudor"
@@ -70,7 +72,6 @@ msgid "Cancel"
msgstr "Cancelar"
#. module: account_banking_sepa_direct_debit
#: field:banking.export.sdd,charge_bearer:0
#: field:banking.export.sdd.wizard,charge_bearer:0
msgid "Charge Bearer"
msgstr "A cargo del portador"
@@ -86,7 +87,6 @@ msgid "Create"
msgstr "Crear"
#. module: account_banking_sepa_direct_debit
#: field:banking.export.sdd,create_uid:0
#: field:banking.export.sdd.wizard,create_uid:0
msgid "Created by"
msgstr "Creado por"
@@ -96,11 +96,6 @@ msgstr "Creado por"
msgid "Created on"
msgstr "Creado en"
#. module: account_banking_sepa_direct_debit
#: selection:banking.export.sdd,state:0
msgid "Draft"
msgstr "Borrador"
#. module: account_banking_sepa_direct_debit
#: help:res.company,sepa_creditor_identifier:0
msgid "Enter the Creditor Identifier that has been attributed to your company to make SEPA Direct Debits. This identifier is composed of :\n"
@@ -120,20 +115,11 @@ msgid "Enterprise (B2B)"
msgstr "Empresa (B2B)"
#. module: account_banking_sepa_direct_debit
#: code:addons/account_banking_sepa_direct_debit/models/res_company.py:79
#: code:addons/account_banking_sepa_direct_debit/models/res_company.py:62
#, python-format
msgid "Error"
msgstr "Error"
#. module: account_banking_sepa_direct_debit
#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:137
#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:185
#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:193
#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:202
#, python-format
msgid "Error:"
msgstr "Error:"
#. module: account_banking_sepa_direct_debit
#: model:ir.model,name:account_banking_sepa_direct_debit.model_banking_export_sdd_wizard
msgid "Export SEPA Direct Debit File"
@@ -145,7 +131,6 @@ msgid "File"
msgstr "Archivo"
#. module: account_banking_sepa_direct_debit
#: field:banking.export.sdd,filename:0
#: field:banking.export.sdd.wizard,filename:0
msgid "Filename"
msgstr "Nombre de archivo"
@@ -166,39 +151,21 @@ msgid "First"
msgstr "Inicial"
#. module: account_banking_sepa_direct_debit
#: selection:banking.export.sdd,charge_bearer:0
#: selection:banking.export.sdd.wizard,charge_bearer:0
msgid "Following Service Level"
msgstr "Según el acuerdo de servicio"
#. module: account_banking_sepa_direct_debit
#: help:banking.export.sdd,charge_bearer:0
#: help:banking.export.sdd.wizard,charge_bearer:0
msgid "Following service level : transaction charges are to be applied following the rules agreed in the service level and/or scheme (SEPA Core messages must use this). Shared : transaction charges on the creditor side are to be borne by the creditor, transaction charges on the debtor side are to be borne by the debtor. Borne by creditor : all transaction charges are to be borne by the creditor. Borne by debtor : all transaction charges are to be borne by the debtor."
msgstr "Según el acuerdo de servicio: los costes de la transacción se aplicarán siguiendo las reglas acordadas en el nivel de servicio y/o en el esquema (las remesas SEPA Core deben usar esta opción). Compartidos: los costes de la transacción en la parte del acreedor están a cargo del acreedor, y los costes de la transacción del lado del deudor estarán a cargo del deudor. A cargo del acreedor: todos los costes de la transacción estarán a cargo del acreedor. A cargo del deudor: Todos los costes de la transacción estarán a cargo del deudor."
#. module: account_banking_sepa_direct_debit
#: view:banking.export.sdd:account_banking_sepa_direct_debit.view_banking_export_sdd_form
msgid "General Information"
msgstr "Información general"
#. module: account_banking_sepa_direct_debit
#: view:banking.export.sdd.wizard:account_banking_sepa_direct_debit.banking_export_sdd_wizard_view
msgid "Generate"
msgstr "Generar"
#. module: account_banking_sepa_direct_debit
#: model:ir.actions.act_window,name:account_banking_sepa_direct_debit.act_banking_export_sdd_payment_order
msgid "Generated SEPA Direct Debit Files"
msgstr "Archivos de adeudos directos SEPA generados"
#. module: account_banking_sepa_direct_debit
#: field:banking.export.sdd,create_date:0
msgid "Generation Date"
msgstr "Fecha de generación"
#. module: account_banking_sepa_direct_debit
#: field:banking.export.sdd,id:0
#: field:banking.export.sdd.wizard,id:0
msgid "ID"
msgstr "ID"
@@ -209,34 +176,31 @@ msgid "If this field is not active, the mandate section of the next direct debit
msgstr "Si este campo no está marcado, la sección 'mandato' del próximo archivo de adeudo directo que lo incluya contendrá el valor de los campos 'Identificación del mandato original' y 'Identificación del esquema original del acreedor'. Esto se requiere en algunos países (Bélgica por ejemplo), pero no en todos ellos. Si no es un requisito en su país, este campo siempre debe estar marcado."
#. module: account_banking_sepa_direct_debit
#: help:banking.export.sdd,batch_booking:0
#: help:banking.export.sdd.wizard,batch_booking:0
msgid "If true, the bank statement will display only one credit line for all the direct debits of the SEPA file ; if false, the bank statement will display one credit line per direct debit of the SEPA file."
msgstr "Si está marcado, el extracto bancario mostrará sólo una línea del haber para todos los adeudos directos del archivo SEPA; si no está marcado, entonces el extracto bancario mostrará una línea por cada adeudo directo del archivo SEPA."
#. module: account_banking_sepa_direct_debit
#: code:addons/account_banking_sepa_direct_debit/models/res_company.py:80
#: code:addons/account_banking_sepa_direct_debit/models/res_company.py:63
#, python-format
msgid "Invalid SEPA Creditor Identifier."
msgstr "Identificador de acreedor SEPA no válido."
#. module: account_banking_sepa_direct_debit
#: field:banking.export.sdd,write_uid:0
#: field:banking.export.sdd.wizard,write_uid:0
msgid "Last Updated by"
msgstr "Última actualización por"
#. module: account_banking_sepa_direct_debit
#: field:banking.export.sdd,write_date:0
#: field:banking.export.sdd.wizard,write_date:0
msgid "Last Updated on"
msgstr "Última actualización en"
#. module: account_banking_sepa_direct_debit
#: code:addons/account_banking_sepa_direct_debit/models/account_banking_mandate.py:119
#: code:addons/account_banking_sepa_direct_debit/models/account_banking_mandate.py:105
#, python-format
msgid "Mandate update"
msgstr ""
msgstr "Actualizacion de mandato"
#. module: account_banking_sepa_direct_debit
#: field:account.banking.mandate,sepa_migrated:0
@@ -244,13 +208,12 @@ msgid "Migrated to SEPA"
msgstr "Migrado a SEPA"
#. module: account_banking_sepa_direct_debit
#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:186
#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:159
#, python-format
msgid "Missing SEPA Direct Debit mandate on the payment line with partner '%s' and Invoice ref '%s'."
msgstr "Falta el mandato de adeudo directo SEPA en la línea con la empresa '%s' y la factura con referencia '%s'"
msgid "Missing SEPA Direct Debit mandate on the bank payment line with partner '%s' (reference '%s')."
msgstr "Falta el mandato de adeudo directo SEPA en la linea de pago bancario con la empresa '%s' (referencia '%s')."
#. module: account_banking_sepa_direct_debit
#: field:banking.export.sdd,nb_transactions:0
#: field:banking.export.sdd.wizard,nb_transactions:0
msgid "Number of Transactions"
msgstr "Nº de transacciones"
@@ -277,17 +240,15 @@ msgid "Original Mandate Required (SEPA)"
msgstr "Mandato original requerido (SEPA)"
#. module: account_banking_sepa_direct_debit
#: view:banking.export.sdd:account_banking_sepa_direct_debit.view_banking_export_sdd_form
#: field:banking.export.sdd,payment_order_ids:0
#: field:banking.export.sdd.wizard,payment_order_ids:0
msgid "Payment Orders"
msgstr "Órdenes de pago"
#. module: account_banking_sepa_direct_debit
#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:138
#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:117
#, python-format
msgid "Payment Type Code '%s' is not supported. The only Payment Type Code supported for SEPA Direct Debit are 'pain.008.001.02', 'pain.008.001.03' and 'pain.008.001.04'."
msgstr ""
msgstr "El código de tipo de pago '%s' no está soportado. Los únicos códigos de tipo de pago soportados para los adedudos directos SEPA son 'pain.008.001.02', 'pain.008.001.03' y 'pain.008.001.04'."
#. module: account_banking_sepa_direct_debit
#: view:account.banking.mandate:account_banking_sepa_direct_debit.sdd_mandate_search
@@ -300,11 +261,6 @@ msgstr "Recurrente"
msgid "Recurring"
msgstr "Periódico"
#. module: account_banking_sepa_direct_debit
#: field:banking.export.sdd.wizard,file_id:0
msgid "SDD File"
msgstr "Archivo SDD"
#. module: account_banking_sepa_direct_debit
#: view:res.partner:account_banking_sepa_direct_debit.sdd_mandate_partner_form
#: view:res.partner.bank:account_banking_sepa_direct_debit.sdd_mandate_partner_bank_tree
@@ -316,18 +272,6 @@ msgstr "Mandatos SDD"
msgid "SEPA Creditor Identifier"
msgstr "Identificador de acreedor SEPA"
#. module: account_banking_sepa_direct_debit
#: view:banking.export.sdd:account_banking_sepa_direct_debit.view_banking_export_sdd_form
#: view:banking.export.sdd:account_banking_sepa_direct_debit.view_banking_export_sdd_tree
msgid "SEPA Direct Debit"
msgstr "Adeudo directo SEPA"
#. module: account_banking_sepa_direct_debit
#: model:ir.actions.act_window,name:account_banking_sepa_direct_debit.action_account_banking_sdd
#: model:ir.ui.menu,name:account_banking_sepa_direct_debit.menu_account_banking_sdd
msgid "SEPA Direct Debit Files"
msgstr "Archivos de adeudos directos SEPA"
#. module: account_banking_sepa_direct_debit
#: model:ir.actions.act_window,name:account_banking_sepa_direct_debit.mandate_action
msgid "SEPA Direct Debit Mandates"
@@ -339,24 +283,16 @@ msgid "SEPA Direct Debit XML file generation"
msgstr "Generación del archivo XML de adeudo directo SEPA"
#. module: account_banking_sepa_direct_debit
#: model:ir.model,name:account_banking_sepa_direct_debit.model_banking_export_sdd
msgid "SEPA Direct Debit export"
msgstr "Exportación de adeudo directo SEPA"
#. module: account_banking_sepa_direct_debit
#: field:banking.export.sdd,file:0
msgid "SEPA File"
msgstr "Archivo SEPA"
#. module: account_banking_sepa_direct_debit
#: view:account.banking.mandate:account_banking_sepa_direct_debit.sdd_mandate_search
#: field:account.banking.mandate,scheme:0
msgid "Scheme"
msgstr "Esquema"
#. module: account_banking_sepa_direct_debit
#: selection:banking.export.sdd,state:0
msgid "Sent"
msgstr "Enviado"
#: view:account.banking.mandate:account_banking_sepa_direct_debit.sdd_mandate_search
#: view:account.banking.mandate:account_banking_sepa_direct_debit.sdd_mandate_tree
msgid "Sequence Type"
msgstr "Tipo de secuencia"
#. module: account_banking_sepa_direct_debit
#: field:account.banking.mandate,recurrent_sequence_type:0
@@ -382,37 +318,35 @@ msgid "Sequence Type set to Recurring"
msgstr "Tipo de secuencia establecida a 'Recurrente'"
#. module: account_banking_sepa_direct_debit
#: selection:banking.export.sdd,charge_bearer:0
#: selection:banking.export.sdd.wizard,charge_bearer:0
msgid "Shared"
msgstr "Compartidos"
#. module: account_banking_sepa_direct_debit
#: field:banking.export.sdd,state:0
#: field:banking.export.sdd.wizard,state:0
msgid "State"
msgstr "Estado"
#. module: account_banking_sepa_direct_debit
#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:194
#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:166
#, python-format
msgid "The SEPA Direct Debit mandate with reference '%s' for partner '%s' has expired."
msgstr "El mandato de adeudo directo SEPA con referencia '%s' para la empresa '%s' ha expirado."
#. module: account_banking_sepa_direct_debit
#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:203
#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:174
#, python-format
msgid "The mandate with reference '%s' for partner '%s' has type set to 'One-Off' and it has a last debit date set to '%s', so we can't use it."
msgstr "El mandato con referencia '%s' para la empresa '%s' tipo como 'Único', ya tiene como fecha de último cobro '%s', por lo que no se puede usar."
#. module: account_banking_sepa_direct_debit
#: code:addons/account_banking_sepa_direct_debit/models/account_banking_mandate.py:86
#: code:addons/account_banking_sepa_direct_debit/models/account_banking_mandate.py:71
#, python-format
msgid "The recurrent mandate '%s' must have a sequence type."
msgstr "El mandato periódico '%s' debe tener un tipo de secuencia."
#. module: account_banking_sepa_direct_debit
#: code:addons/account_banking_sepa_direct_debit/models/account_banking_mandate.py:95
#: code:addons/account_banking_sepa_direct_debit/models/account_banking_mandate.py:80
#, python-format
msgid "The recurrent mandate '%s' which is not marked as 'Migrated to SEPA' must have its recurrent sequence type set to 'First'."
msgstr "El mandato periódico '%s', que no está marcado como 'Migrado a SEPA', debe establecer su tipo de secuencia a 'Inicial'."
@@ -423,12 +357,12 @@ msgid "This field is only used for Recurrent mandates, not for One-Off mandates.
msgstr "Este campo se utiliza sólo para mandatos periódicos, no para únicos."
#. module: account_banking_sepa_direct_debit
#: field:banking.export.sdd,total_amount:0
#: field:banking.export.sdd.wizard,total_amount:0
msgid "Total Amount"
msgstr "Importe total"
#. module: account_banking_sepa_direct_debit
#: view:account.banking.mandate:account_banking_sepa_direct_debit.sdd_mandate_search
#: view:account.banking.mandate:account_banking_sepa_direct_debit.sdd_mandate_tree
msgid "Type"
msgstr "Tipo"
@@ -449,7 +383,7 @@ msgid "When the field 'Migrated to SEPA' is not active, this field will be used
msgstr "Cuando el campo 'Migrado a SEPA' no está marcado, este campo se usa como identificación del mandato original en el archivo de adeudo directo."
#. module: account_banking_sepa_direct_debit
#: code:addons/account_banking_sepa_direct_debit/models/account_banking_mandate.py:105
#: code:addons/account_banking_sepa_direct_debit/models/account_banking_mandate.py:90
#, python-format
msgid "You must set the 'Original Mandate Identification' on the recurrent mandate '%s' which is not marked as 'Migrated to SEPA'."
msgstr "Debe establecer el campo 'Identificación de mandato original en el mandato periódico '%s', que no está marcado como 'Migrado a SEPA'."

View File

@@ -1,24 +1,5 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# SEPA Direct Debit module for OpenERP
# Copyright (C) 2013 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
from . import res_company
from . import account_banking_mandate
from . import bank_payment_line

View File

@@ -1,24 +1,7 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# SEPA Direct Debit module for OpenERP
# Copyright (C) 2013 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# © 2013 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api, exceptions, _
from datetime import datetime

View File

@@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
# © 2015 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, api
class BankPaymentLine(models.Model):
_inherit = 'bank.payment.line'
@api.multi
def move_line_transfer_account_hashcode(self):
"""
From my experience, even when you ask several direct debits
at the same date with enough delay, you will have several credits
on your bank statement: one for each mandate types.
So we split the transfer move lines by mandate type, so easier
reconciliation of the bank statement.
"""
hashcode = super(BankPaymentLine, self).\
move_line_transfer_account_hashcode()
hashcode += '-' + unicode(self.mandate_id.recurrent_sequence_type)
return hashcode

View File

@@ -1,24 +1,7 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# SEPA Direct Debit module for OpenERP
# Copyright (C) 2013 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# © 2013 Akretion (www.akretion.com)
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api, exceptions, _
import logging

View File

@@ -144,25 +144,22 @@ class BankingExportSddWizard(models.TransientModel):
# key = (requested_date, priority, sequence type)
# value = list of lines as objects
# Iterate on payment orders
today = fields.Date.context_today(self)
for payment_order in self.payment_order_ids:
total_amount = total_amount + payment_order.total
# Iterate each payment lines
for line in payment_order.line_ids:
for line in payment_order.bank_line_ids:
transactions_count_1_6 += 1
priority = line.priority
if payment_order.date_prefered == 'due':
requested_date = line.ml_maturity_date or today
elif payment_order.date_prefered == 'fixed':
requested_date = payment_order.date_scheduled or today
else:
requested_date = today
# The field line.date is the requested payment date
# taking into account the 'date_prefered' setting
# cf account_banking_payment_export/models/account_payment.py
# in the inherit of action_open()
if not line.mandate_id:
raise Warning(
_("Missing SEPA Direct Debit mandate on the payment "
"line with partner '%s' and Invoice ref '%s'.")
% (line.partner_id.name,
line.ml_inv_ref.number))
_("Missing SEPA Direct Debit mandate on the "
"bank payment line with partner '%s' "
"(reference '%s').")
% (line.partner_id.name, line.name))
scheme = line.mandate_id.scheme
if line.mandate_id.state != 'valid':
raise Warning(
@@ -191,14 +188,11 @@ class BankingExportSddWizard(models.TransientModel):
line.mandate_id.recurrent_sequence_type
assert seq_type_label is not False
seq_type = seq_type_map[seq_type_label]
key = (requested_date, priority, seq_type, scheme)
key = (line.date, priority, seq_type, scheme)
if key in lines_per_group:
lines_per_group[key].append(line)
else:
lines_per_group[key] = [line]
# Write requested_exec_date on 'Payment date' of the pay line
if requested_date != line.date:
line.date = requested_date
for (requested_date, priority, sequence_type, scheme), lines in \
lines_per_group.items():
@@ -374,18 +368,18 @@ class BankingExportSddWizard(models.TransientModel):
to_expire_mandates = abmo.browse([])
first_mandates = abmo.browse([])
all_mandates = abmo.browse([])
for line in order.line_ids:
if line.mandate_id in all_mandates:
for bline in order.bank_line_ids:
if bline.mandate_id in all_mandates:
continue
all_mandates += line.mandate_id
if line.mandate_id.type == 'oneoff':
to_expire_mandates += line.mandate_id
elif line.mandate_id.type == 'recurrent':
seq_type = line.mandate_id.recurrent_sequence_type
all_mandates += bline.mandate_id
if bline.mandate_id.type == 'oneoff':
to_expire_mandates += bline.mandate_id
elif bline.mandate_id.type == 'recurrent':
seq_type = bline.mandate_id.recurrent_sequence_type
if seq_type == 'final':
to_expire_mandates += line.mandate_id
to_expire_mandates += bline.mandate_id
elif seq_type == 'first':
first_mandates += line.mandate_id
first_mandates += bline.mandate_id
all_mandates.write(
{'last_debit_date': fields.Date.context_today(self)})
to_expire_mandates.write({'state': 'expired'})

View File

@@ -253,7 +253,10 @@ class TestPaymentRoundtrip(TransactionCase):
'mode': self.payment_mode_id,
'date_prefered': 'now',
})
context = {'active_id': self.payment_order_id}
context = {
'active_id': self.payment_order_id,
'active_model': 'payment.order',
}
entries = reg('account.move.line').search(
cr, uid, [
('company_id', '=', self.company_id),
@@ -398,7 +401,7 @@ class TestPaymentRoundtrip(TransactionCase):
payment_order = reg('payment.order').browse(
cr, uid, self.payment_order_id)
assert payment_order.line_ids, 'Payment order has no payment lines'
for line in payment_order.line_ids:
for line in payment_order.bank_line_ids:
assert line.transit_move_line_id, \
'Payment order has no transfer move line'
assert line.transit_move_line_id.reconcile_id, \
@@ -413,7 +416,7 @@ class TestPaymentRoundtrip(TransactionCase):
payment_order = reg('payment.order').browse(
cr, uid, self.payment_order_id)
assert payment_order.line_ids, 'Payment order has no payment lines'
for line in payment_order.line_ids:
for line in payment_order.bank_line_ids:
assert line.transfer_move_line_id, \
'Payment order has no transfer move line'
assert line.transfer_move_line_id.reconcile_id, \

View File

@@ -8,11 +8,8 @@ This module adds support for direct debit orders, analogous to payment orders.
A new entry in the Accounting/Payment menu allow you to create a direct debit
order that helps you to select any customer invoices for you to collect.
This module explicitely implements direct debit orders as applicable
in the Netherlands. Debit orders are advanced in total by the bank.
Amounts that cannot be debited or are canceled by account owners are
credited afterwards. Such a creditation is called a storno. This style of
direct debit order may not apply to your country.
Debit orders are advanced in total by the bank. Amounts that cannot be
debited or are canceled by account owners are credited afterwards.
Installation
============
@@ -25,12 +22,12 @@ This module is part of the OCA/bank-payment suite.
Configuration
=============
Please refer to module "Account Banking SEPA Direct Debit"
Please refer to module *Account Banking SEPA Direct Debit*
Usage
=====
Please refer to module "Account Banking SEPA Direct Debit"
Please refer to module *Account Banking SEPA Direct Debit*
For further information, please visit:
@@ -58,7 +55,7 @@ Contributors
* Stefan Rijnhart
* Pedro M. Baeza
* Alexis de Lattre
* Alexis de Lattre <alexis.delattre@akretion.com>
* Danimar Ribeiro
* Stéphane Bidoul <stephane.bidoul@acsone.eu>
* Alexandre Fayolle

View File

@@ -1,26 +1,12 @@
##############################################################################
#
# Copyright (C) 2011 - 2013 Therp BV (<http://therp.nl>).
# Copyright (C) 2011 Smile (<http://smile.fr>).
# 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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# © 2011 Smile (<http://smile.fr>)
# © 2011-2013 Therp BV (<http://therp.nl>)
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Direct Debit',
'version': '8.0.2.0.0',
'version': '8.0.2.1.0',
'license': 'AGPL-3',
'author': 'Therp BV, '
'Smile, '
@@ -30,10 +16,8 @@
'depends': ['account_banking_payment_export'],
'data': [
'views/account_payment.xml',
'views/account_invoice.xml',
'views/payment_mode.xml',
'views/payment_mode_type.xml',
'workflow/account_invoice.xml',
'data/account_payment_term.xml',
'data/payment_mode_type.xml'
],

View File

@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-10-31 23:05+0000\n"
"PO-Revision-Date: 2014-10-31 23:05+0000\n"
"POT-Creation-Date: 2016-02-16 07:59+0000\n"
"PO-Revision-Date: 2016-02-16 07:59+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -20,33 +20,6 @@ msgstr ""
msgid "A debit order is a debit request from your company to collect customer invoices. Here you can register all debit orders that should be done, keep track of all debit orders and mention the invoice reference and the partner the withdrawal should be done for."
msgstr "Una orden de cobro es una petición de dinero de su compañía para saldar las facturas de cliente. Aquí puede registrar todas las órdenes de cobro que se deban realizar, seguirles el rastro, y apuntar la referencia de factura y de la empresa para la que se debe hacer el cargo."
#. module: account_direct_debit
#: field:account.move.line,amount_to_receive:0
msgid "Amount to receive"
msgstr "Importe a cobrar"
#. module: account_direct_debit
#: code:addons/account_direct_debit/models/payment_line.py:133
#, python-format
msgid "Can not reconcile"
msgstr "No puede ser conciliada"
#. module: account_direct_debit
#: code:addons/account_direct_debit/models/payment_line.py:134
#, python-format
msgid "Cancelation of payment line '%s' has already been processed"
msgstr ""
#. module: account_direct_debit
#: view:account.invoice:account_direct_debit.invoice_form
msgid "Debit Denied"
msgstr "Cobro denegado"
#. module: account_direct_debit
#: view:account.invoice:account_direct_debit.view_account_invoice_filter
msgid "Debit denied"
msgstr "Cobro denegado"
#. module: account_direct_debit
#: model:ir.actions.act_window,name:account_direct_debit.action_debit_order_tree
#: model:ir.ui.menu,name:account_direct_debit.menu_action_debit_order_form
@@ -63,28 +36,6 @@ msgstr "Cobro"
msgid "Direct debit in 14 days"
msgstr "Adeudo directo en 14 días"
#. module: account_direct_debit
#: code:addons/account_direct_debit/models/account_invoice.py:149
#, python-format
msgid "Error !"
msgstr "Error"
#. module: account_direct_debit
#: help:payment.line,storno:0
msgid "If this is true, the debit order has been canceled by the bank or by the customer"
msgstr "Si la casilla está marcada, la orden de cobro ha sido cancelada por el banco o por el cliente"
#. module: account_direct_debit
#: model:ir.model,name:account_direct_debit.model_account_invoice
msgid "Invoice"
msgstr "Factura"
#. module: account_direct_debit
#: code:addons/account_direct_debit/models/account_invoice.py:154
#, python-format
msgid "Invoice '%s': direct debit is denied."
msgstr "Factura '%s': adeudo directo denegado"
#. module: account_direct_debit
#: view:payment.order:account_direct_debit.view_payment_order_form
msgid "Invoices"
@@ -93,35 +44,25 @@ msgstr "Facturas"
#. module: account_direct_debit
#: model:ir.model,name:account_direct_debit.model_account_move_line
msgid "Journal Items"
msgstr "Asientos contables"
msgstr "Apuntes contables"
#. module: account_direct_debit
#: model:ir.model,name:account_direct_debit.model_payment_line
msgid "Payment Line"
msgstr "Línea de pago"
#. module: account_direct_debit
#: model:ir.model,name:account_direct_debit.model_payment_order
msgid "Payment Order"
msgstr "Orden de pago"
#. module: account_direct_debit
#: view:payment.order:account_direct_debit.view_payment_order_form
msgid "Select invoices to collect"
msgstr "Seleccione facturas"
#. module: account_direct_debit
#: view:account.invoice:account_direct_debit.view_account_invoice_filter
msgid "Show only invoices with state Debit denied"
msgstr "Mostrar sólo facturas con el cobro denegado"
#: view:payment.order:account_direct_debit.view_payment_order_form
msgid "[('payment_order_type', '=', payment_order_type)]"
msgstr "[('payment_order_type', '=', payment_order_type)]"
#. module: account_direct_debit
#: field:payment.line,storno:0
msgid "Storno"
msgstr "Storno"
#: view:payment.order:account_direct_debit.view_payment_order_form
msgid "{'invisible': ['|', ('state', '!=', 'draft'), ('payment_order_type', '!=', 'payment')]}"
msgstr "{'invisible': ['|', ('state', '!=', 'draft'), ('payment_order_type', '!=', 'payment')]}"
#. module: account_direct_debit
#: code:addons/account_direct_debit/models/account_invoice.py:150
#, python-format
msgid "You cannot set invoice '%s' to state 'debit denied', as it is still reconciled."
msgstr "No puede establecer la factura '%s' al estado 'cobro denegado', ya que ya se encuentra conciliada."

View File

@@ -1,4 +1,4 @@
from . import account_payment
# -*- coding: utf-8 -*-
from . import payment_line
from . import account_move_line
from . import account_invoice

View File

@@ -1,165 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2011 - 2013 Therp BV (<http://therp.nl>).
#
# All other contributions are (C) by their respective contributors
#
# 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/>.
#
##############################################################################
"""
This module adds support for Direct debit orders as applicable
in the Netherlands. Debit orders are advanced in total by the bank.
Amounts that cannot be debited or are canceled by account owners are
credited afterwards. Such a creditation is called a storno.
Invoice workflow:
1 the sale leads to
1300 Debtors 100
8000 Sales 100
Balance:
Debtors 2000 |
Sales | 2000
2 an external booking takes place
1100 Bank 100
1300 Debtors 100
This booking is reconciled with [1]
The invoice gets set to state 'paid', and 'reconciled' = True
Balance:
Debtors 1900 |
Bank 100 |
Sales | 2000
This module implements the following diversion:
2a the invoice is included in a direct debit order. When the order is
confirmed, a move is created per invoice:
2000 Transfer account 100 |
1300 Debtors | 100
Reconciliation takes place between 1 and 2a.
The invoice gets set to state 'paid', and 'reconciled' = True
Balance:
Debtors 0 |
Transfer account 2000 |
Bank 0 |
Sales | 2000
3a the direct debit order is booked on the bank account
Balance:
1100 Bank 2000 |
2000 Transfer account | 2000
Reconciliation takes place between 3a and 2a
Balance:
Debtors 0 |
Transfer account 0 |
Bank 2000 |
Sales | 2000
4 a storno from invoice [1] triggers a new booking on the bank account
1300 Debtors 100 |
1100 Bank | 100
Balance:
Debtors 100 |
Transfer account 0 |
Bank 1900 |
Sales | 2000
The reconciliation of 2a is undone. The booking of 2a is reconciled
with the booking of 4 instead.
The payment line attribute 'storno' is set to True and the invoice
state is no longer 'paid'.
Two cases need to be distinguisted:
1) If the storno is a manual storno from the partner, the invoice is set to
state 'debit_denied', with 'reconciled' = False
This module implements this option by allowing the bank module to call
netsvc.LocalService("workflow").trg_validate(
uid, 'account.invoice', ids, 'debit_denied', cr)
2) If the storno is an error generated by the bank (assumingly non-fatal),
the invoice is reopened for the next debit run. This is a call to
existing
netsvc.LocalService("workflow").trg_validate(
uid, 'account.invoice', ids, 'open_test', cr)
Should also be adding a log entry on the invoice for tracing purposes
self._log_event(cr, uid, ids, -1.0, 'Debit denied')
If not for that funny comment
"#TODO: implement messages system" in account/invoice.py
Repeating non-fatal fatal errors need to be dealt with manually by checking
open invoices with a matured invoice- or due date.
"""
from openerp.osv import orm
from openerp.tools.translate import _
class AccountInvoice(orm.Model):
_inherit = "account.invoice"
def _register_hook(self, cr):
"""
Adding a state to the hardcoded state list of the inherited
model. The alternative is duplicating the field definition
in columns but only one module can do that!
Maybe apply a similar trick when overriding the buttons' 'states'
attributes in the form view, manipulating the xml in fields_view_get().
"""
self._columns['state'].selection.append(
('debit_denied', 'Debit denied'))
return super(AccountInvoice, self)._register_hook(cr)
def action_debit_denied(self, cr, uid, ids, context=None):
for invoice_id in ids:
if self.test_paid(cr, uid, [invoice_id], context):
number = self.read(
cr, uid, invoice_id, ['number'], context=context)['number']
raise orm.except_orm(
_('Error !'),
_("You cannot set invoice '%s' to state 'debit "
"denied', as it is still reconciled.") % number)
self.write(cr, uid, ids, {'state': 'debit_denied'}, context=context)
for inv_id, name in self.name_get(cr, uid, ids, context=context):
message = _("Invoice '%s': direct debit is denied.") % name
self.log(cr, uid, inv_id, message)
return True
def test_undo_debit_denied(self, cr, uid, ids, context=None):
"""
Called from the workflow. Used to unset paid state on
invoices that were paid with bank transfers which are being cancelled
"""
for invoice in self.read(cr, uid, ids, ['reconciled'], context):
if not invoice['reconciled']:
return False
return True

View File

@@ -1,91 +1,15 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module (C) 2011 - 2013 Therp BV (<http://therp.nl>).
# (C) 2011 Smile Benelux (<http://smile.fr>).
#
# 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 Smile (<http://smile.fr>)
# © 2011-2013 Therp BV (<http://therp.nl>)
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from operator import itemgetter
from openerp.osv import fields, orm
from openerp import models
class AccountMoveLine(orm.Model):
class AccountMoveLine(models.Model):
_inherit = "account.move.line"
def _amount_to_receive(self, cr, uid, ids, name, arg=None, context=None):
"""Return the amount still to receive regarding all the debit orders
(excepting canceled orders).
This is the reverse from amount_to_pay() in
account_payment/account_move_line.py
"""
if not ids:
return {}
cr.execute("""SELECT ml.id,
CASE WHEN ml.amount_currency > 0
THEN ml.amount_currency
ELSE ml.debit
END -
(SELECT coalesce(sum(amount_currency),0)
FROM payment_line pl
INNER JOIN payment_order po
ON (pl.order_id = po.id)
WHERE move_line_id = ml.id
AND pl.storno is false
AND po.state != 'cancel') AS amount
FROM account_move_line ml
WHERE id IN %s""", (tuple(ids),))
r = dict(cr.fetchall())
return r
def _to_receive_search(self, cr, uid, obj, name, args, context=None):
"""Reverse of account_payment/account_move_line.py:_to_pay_search().
"""
if not args:
return []
line_obj = self.pool.get('account.move.line')
search_context = dict(context or {}, all_fiscalyear=True)
query = line_obj._query_get(cr, uid, context=search_context)
where = ' and '.join(map(lambda x: '''(SELECT
CASE WHEN l.amount_currency > 0
THEN l.amount_currency
ELSE l.debit
END - coalesce(sum(pl.amount_currency), 0)
FROM payment_line pl
INNER JOIN payment_order po ON (pl.order_id = po.id)
WHERE move_line_id = l.id
AND pl.storno is false
AND po.state != 'cancel'
) %(operator)s %%s ''' % {'operator': x[1]}, args))
sql_args = tuple(map(itemgetter(2), args))
cr.execute(('''SELECT id
FROM account_move_line l
WHERE account_id IN (select id
FROM account_account
WHERE type=%s AND active)
AND reconcile_id IS null
AND debit > 0
AND ''' + where + ' and ' + query), ('receivable',) + sql_args)
res = cr.fetchall()
if not res:
return [('id', '=', '0')]
return [('id', 'in', map(lambda x:x[0], res))]
def line2bank(self, cr, uid, ids, payment_type=None, context=None):
"""I have to inherit this function for direct debits to fix the
following issue : if the customer invoice has a value for
@@ -112,10 +36,3 @@ class AccountMoveLine(orm.Model):
return line2bank
return super(AccountMoveLine, self).line2bank(
cr, uid, ids, payment_type=pay_mode.id, context=context)
_columns = {
'amount_to_receive': fields.function(
_amount_to_receive, method=True,
type='float', string='Amount to receive',
fnct_search=_to_receive_search),
}

View File

@@ -1,19 +0,0 @@
# -*- coding: utf-8 -*-
from openerp.osv import orm
class PaymentOrder(orm.Model):
_inherit = 'payment.order'
def test_undo_done(self, cr, uid, ids, context=None):
"""Called from the workflow. Used to unset done state on
payment orders that were reconciled with bank transfers
which are being cancelled
"""
for order in self.browse(cr, uid, ids, context=context):
if order.payment_order_type == 'debit':
for line in order.line_ids:
if line.storno:
return False
return super(PaymentOrder, self).test_undo_done(
cr, uid, ids, context=context)

View File

@@ -1,131 +1,14 @@
# -*- coding: utf-8 -*-
from openerp import api, exceptions, models, fields, _, workflow
# © 2011 Smile (<http://smile.fr>)
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields
class PaymentLine(models.Model):
_inherit = 'payment.line'
@api.multi
def debit_storno(self, amount, currency, storno_retry=True):
"""The processing of a storno is triggered by a debit
transfer on one of the company's bank accounts.
This method offers to re-reconcile the original debit
payment. For this purpose, we have registered that
payment move on the payment line.
Return the (now incomplete) reconcile id. The caller MUST
re-reconcile this reconcile with the bank transfer and
re-open the associated invoice.
:param payment_line_id: the single payment line id
:param amount: the (signed) amount debited from the bank account
:param currency: the bank account's currency *browse object*
:param boolean storno_retry: when True, attempt to reopen the invoice,
set the invoice to 'Debit denied' otherwise.
:return: an incomplete reconcile for the caller to fill
:rtype: database id of an account.move.reconcile resource.
"""
self.ensure_one()
reconcile_obj = self.env['account.move.reconcile']
line = self
reconcile = reconcile_obj.browse([])
if (line.transit_move_line_id and not line.storno and
self.env['res.currency'].is_zero(
currency, (
(line.transit_move_line_id.credit or 0.0) -
(line.transit_move_line_id.debit or 0.0) + amount))):
# Two different cases, full and partial
# Both cases differ subtly in the procedure to follow
# Needs refractoring, but why is this not in the OpenERP API?
# Actually, given the nature of a direct debit order and storno,
# we should not need to take partial into account on the side of
# the transit_move_line.
if line.transit_move_line_id.reconcile_partial_id:
reconcile_partial = \
line.transit_move_line_id.reconcile_partial_id
reconcile = line.transit_move_line_id.reconcile_id
if len(reconcile.line_partial_ids) == 2:
# reuse the simple reconcile for the storno transfer
reconcile_partial.write({
'line_id': [(6, 0, line.transit_move_line_id.id)],
'line_partial_ids': [(6, 0, [])]
})
else:
# split up the original reconcile in a partial one
# and a new one for reconciling the storno transfer
reconcile_partial.write({
'line_partial_ids': [(3, line.transit_move_line_id.id)]
})
reconcile = reconcile_obj.create({
'type': 'auto',
'line_id': [(6, 0, line.transit_move_line_id.id)]
})
elif line.transit_move_line_id.reconcile_id:
reconcile = line.transit_move_line_id.reconcile_id
if len(line.transit_move_line_id.reconcile_id.line_id) == 2:
# reuse the simple reconcile for the storno transfer
reconcile.write({
'line_id': [(6, 0, [line.transit_move_line_id.id])],
})
else:
# split up the original reconcile in a partial one
# and a new one for reconciling the storno transfer
reconcile = line.transit_move_line_id.reconcile_id
partial_ids = [x.id for x in reconcile.line_id
if x.id != line.transit_move_line_id.id]
reconcile.write({
'line_partial_ids': [(6, 0, partial_ids)],
'line_id': [(6, 0, [])],
})
reconcile = reconcile_obj.create({
'type': 'auto',
'line_id': [(6, 0, line.transit_move_line_id.id)]
})
# mark the payment line for storno processed
if reconcile:
self.write({'storno': True})
# put forth the invoice workflow
if line.move_line_id.invoice:
activity = (storno_retry and 'open_test' or
'invoice_debit_denied')
workflow.trg_validate(
self.env.uid, 'account.invoice',
line.move_line_id.invoice.id, activity, self.env.cr)
return reconcile.id
@api.multi
def get_storno_account_id(self, amount, currency):
"""Check the match of the arguments, and return the account associated
with the storno.
Used in account_banking interactive mode
:param payment_line_id: the single payment line id
:param amount: the (signed) amount debited from the bank account
:param currency: the bank account's currency *browse object*
:return: an account if there is a full match, False otherwise
:rtype: database id of an account.account resource.
"""
self.ensure_one()
account_id = False
if (self.transit_move_line_id and not self.storno and
self.env['res.currency'].is_zero(
currency, (
(self.transit_move_line_id.credit or 0.0) -
(self.transit_move_line_id.debit or 0.0) + amount))):
account_id = self.transit_move_line_id.account_id.id
return account_id
@api.one
def debit_reconcile(self):
"""Raise if a payment line is passed for which storno is True."""
if self.storno:
raise exceptions.except_orm(
_('Can not reconcile'),
_('Cancelation of payment line \'%s\' has already been '
'processed') % self.name)
return super(PaymentLine, self).debit_reconcile()
storno = fields.Boolean(
'Storno', readonly=True,
help="If this is true, the debit order has been canceled by the bank "
"or by the customer")
# The original string is "Destination Bank Account"...
# but in direct debit this field is the *Source* Bank Account !
bank_id = fields.Many2one(string='Partner Bank Account')

View File

@@ -1,39 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="invoice_form" model="ir.ui.view">
<field name="name">account.invoice.form</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
<!--
Add new state 'debit_denied' to applicable buttons.
Maybe apply trick in fields_view_get instead, for
better compatibility with other modules?
-->
<!-- button name="invoice_open" position="attributes">
<attribute name="states">draft,proforma2,debit_denied</attribute>
</button -->
<button name="invoice_open" position="after">
<button name="invoice_debit_denied" states="paid"
string="Debit Denied"/>
</button>
</field>
</record>
<record id="view_account_invoice_filter" model="ir.ui.view">
<field name="name">account.invoice.select direct debit</field>
<field name="model">account.invoice</field>
<field name="type">search</field>
<field name="inherit_id" ref="account.view_account_invoice_filter"/>
<field name="arch" type="xml">
<filter name="invoices" position="after">
<filter name="debit_denied"
string="Debit denied"
domain="[('state','=','debit_denied')]"
help="Show only invoices with state Debit denied"
/>
</filter>
</field>
</record>
</data>
</openerp>

View File

@@ -23,43 +23,26 @@
<menuitem action="action_debit_order_tree" id="menu_action_debit_order_form" parent="account_payment.menu_main_payment" sequence="4"/>
<record id="view_payment_order_form" model="ir.ui.view">
<field name="name">payment.order.form</field>
<field name="name">direct.debit.payment.order.form</field>
<field name="model">payment.order</field>
<field name="inherit_id" ref="account_payment.view_payment_order_form"/>
<field name="inherit_id" ref="account_banking_payment_export.view_payment_order_form"/>
<field name="priority" eval="60"/>
<field name="arch" type="xml">
<data>
<form position="inside">
<field name="payment_order_type" invisible="1"/>
</form>
<button string="Invoices" position="attributes">
<attribute name="attrs">{'invisible': ['|', ('state', '!=', 'draft'), ('payment_order_type', '!=', 'payment')]}</attribute>
</button>
<div class=" oe_right oe_button_box" position="inside">
<button name="%(account_payment.action_create_payment_order)s"
class="oe_inline oe_stat_button oe_right"
string="Invoices"
help="Select invoices to collect"
type="action"
attrs="{'invisible': ['|', ('state', '!=', 'draft'), ('payment_order_type', '!=', 'debit')]}"
icon="fa-pencil-square-o"
widget="statinfo"/>
</div>
<field name="mode" position="attributes">
<attribute name="domain">[('payment_order_type', '=', payment_order_type)]</attribute>
</field>
</data>
</field>
</record>
<record id="view_payment_line_tree" model="ir.ui.view">
<field name="name">Payment Lines</field>
<field name="model">payment.line</field>
<field name="inherit_id" ref="account_payment.view_payment_line_tree"/>
<field eval="4" name="priority"/>
<field name="arch" type="xml">
<field name="name" position="after">
<field name="storno"/>
<button string="Invoices" position="attributes">
<attribute name="attrs">{'invisible': ['|', ('state', '!=', 'draft'), ('payment_order_type', '!=', 'payment')]}</attribute>
</button>
<div class=" oe_right oe_button_box" position="inside">
<button name="%(account_payment.action_create_payment_order)s"
class="oe_inline oe_stat_button oe_right"
string="Invoices"
help="Select invoices to collect"
type="action"
attrs="{'invisible': ['|', ('state', '!=', 'draft'), ('payment_order_type', '!=', 'debit')]}"
icon="fa-pencil-square-o"
widget="statinfo"/>
</div>
<field name="mode" position="attributes">
<attribute name="domain">[('payment_order_type', '=', payment_order_type)]</attribute>
</field>
</field>
</record>

View File

@@ -1,26 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2013 Therp BV (<http://therp.nl>).
#
# All other contributions are (C) by their respective contributors
#
# 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/>.
#
##############################################################################
# © 2013 Therp BV (<http://therp.nl>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, api
@@ -33,9 +13,18 @@ class PaymentOrderCreate(models.TransientModel):
super(PaymentOrderCreate, self).extend_payment_order_domain(
payment_order, domain)
if payment_order.payment_order_type == 'debit':
domain += ['|',
('invoice', '=', False),
('invoice.state', '!=', 'debit_denied'),
('account_id.type', '=', 'receivable'),
('amount_to_receive', '>', 0)]
# For receivables, propose all unreconciled debit lines,
# including partially reconciled ones.
# If they are partially reconciled with a customer refund,
# the residual will be added to the payment order.
#
# For payables, normally suppliers will be the initiating party
# for possible supplier refunds (via a transfer for example),
# or they keep the amount for decreasing future supplier invoices,
# so there's not too much sense for adding them to a direct debit
# order
domain += [
('debit', '>', 0),
('account_id.type', '=', 'receivable'),
]
return True

View File

@@ -1,51 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="act_debit_denied" model="workflow.activity">
<field name="wkf_id" ref="account.wkf"/>
<field name="name">debit_denied</field>
<field name="action">action_debit_denied()</field>
<field name="kind">function</field>
</record>
<record id="paid_to_debit_denied" model="workflow.transition">
<!--
Set an invoice to state debit denied, either manually
or by confirming a bank statement line that constitutes
a fatal storno
-->
<field name="act_from" ref="account.act_paid"/>
<field name="act_to" ref="act_debit_denied"/>
<field name="signal">invoice_debit_denied</field>
</record>
<record id="open_test_to_debit_denied" model="workflow.transition">
<!--
A storno leads to unreconciling the move line, which
reopens the invoice. We need to allow a transition from
this state to the debit denied state if the storno is fatal.
-->
<field name="act_from" ref="account.act_open_test"/>
<field name="act_to" ref="act_debit_denied"/>
<field name="signal">invoice_debit_denied</field>
</record>
<record id="debit_denied_to_paid" model="workflow.transition">
<!--
Cancel a bank statement line that constitutes a fatal
storno
-->
<field name="act_from" ref="act_debit_denied"/>
<field name="act_to" ref="account.act_paid"/>
<field name="condition">test_undo_debit_denied()</field>
<field name="signal">undo_debit_denied</field>
</record>
<record id="debit_denied_to_open" model="workflow.transition">
<!--
Allow the user to manually reset a debit denied status
on a paid invoice (but only after manually unreconciling
the invoice)
-->
<field name="act_from" ref="act_debit_denied"/>
<field name="act_to" ref="account.act_open_test"/>
<field name="signal">open_test</field>
</record>
</data>
</openerp>

View File

@@ -1,24 +1,6 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Account Payment Partner module for OpenERP
# Copyright (C) 2014 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# © 2014 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import models
from . import wizard

View File

@@ -1,29 +1,11 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Account Payment Partner module for OpenERP
# Copyright (C) 2014 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# © 2014 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Account Payment Partner',
'version': '8.0.0.1.0',
'version': '8.0.0.2.0',
'category': 'Banking addons',
'license': 'AGPL-3',
'summary': 'Adds payment mode on partners and invoices',
@@ -36,7 +18,9 @@
'views/res_partner_view.xml',
'views/account_invoice_view.xml',
'views/report_invoice.xml',
'views/payment_mode.xml',
'security/ir.model.access.csv',
'wizard/payment_order_create_view.xml',
],
'demo': ['demo/partner_demo.xml'],
'installable': True,

View File

@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 8.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-07-02 10:55+0000\n"
"PO-Revision-Date: 2015-07-02 10:55+0000\n"
"POT-Creation-Date: 2016-02-16 08:01+0000\n"
"PO-Revision-Date: 2016-02-16 08:01+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -15,6 +15,12 @@ msgstr ""
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
#. module: account_payment_partner
#: selection:payment.mode,default_payment_mode:0
#: selection:payment.order.create,payment_mode:0
msgid "Any"
msgstr "Cualquiera"
#. module: account_payment_partner
#: view:website:account.report_invoice_document
msgid "Bank Account:"
@@ -37,14 +43,33 @@ msgstr "Empresa"
#. module: account_payment_partner
#: field:account.invoice,payment_mode_id:0
#: model:ir.model,name:account_payment_partner.model_payment_mode
msgid "Payment Mode"
msgstr "Modo de pago"
#. module: account_payment_partner
#: field:payment.mode,default_payment_mode:0
#: field:payment.order.create,payment_mode:0
msgid "Payment Mode on Invoice"
msgstr "Modo de pago en la factura"
#. module: account_payment_partner
#: view:website:account.report_invoice_document
msgid "Payment Mode:"
msgstr "Modo de pago:"
#. module: account_payment_partner
#: selection:payment.mode,default_payment_mode:0
#: selection:payment.order.create,payment_mode:0
msgid "Same"
msgstr "Igual"
#. module: account_payment_partner
#: selection:payment.mode,default_payment_mode:0
#: selection:payment.order.create,payment_mode:0
msgid "Same or empty"
msgstr "Igual o vacío"
#. module: account_payment_partner
#: help:res.partner,customer_payment_mode:0
msgid "Select the default payment mode for this customer."

View File

@@ -1,24 +1,5 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Account Payment Partner module for OpenERP
# Copyright (C) 2014 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
from . import res_partner
from . import account_invoice
from . import payment_mode

View File

@@ -1,24 +1,7 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Account Payment Partner module for OpenERP
# Copyright (C) 2014 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# © 2014 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api

View File

@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# © 2014 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields
class PaymentMode(models.Model):
_inherit = "payment.mode"
default_payment_mode = fields.Selection([
('same', 'Same'),
('same_or_null', 'Same or empty'),
('any', 'Any'),
], string='Payment Mode on Invoice', default='same')

View File

@@ -1,24 +1,7 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Account Payment Partner module for OpenERP
# Copyright (C) 2014 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.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/>.
#
##############################################################################
# -*- coding: utf-8 -*-
# © 2014 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api

View File

@@ -1,2 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_payment_mode_read,Read access on payment.mode to Employees,account_payment.model_payment_mode,base.group_user,1,0,0,0
access_payment_mode_type_read,Read access on payment.mode.type to Employees,account_banking_payment_export.model_payment_mode_type,base.group_user,1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_payment_mode_read Read access on payment.mode to Employees account_payment.model_payment_mode base.group_user 1 0 0 0
3 access_payment_mode_type_read Read access on payment.mode.type to Employees account_banking_payment_export.model_payment_mode_type base.group_user 1 0 0 0

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_payment_mode_form" model="ir.ui.view">
<field name="name">account_payment_partner.payment.mode.form</field>
<field name="model">payment.mode</field>
<field name="inherit_id" ref="account_banking_payment_export.view_payment_mode_form_inherit"/>
<field name="arch" type="xml">
<group name="payment_order_create_defaults" position="inside">
<field name="default_payment_mode"
attrs="{'invisible': [('default_invoice', '=', False)]}"/>
</group>
</field>
</record>
</data>
</openerp>

View File

@@ -1,8 +1,8 @@
# -*- encoding: utf-8 -*-
# -*- coding: utf-8 -*-
##############################################################################
#
# Account Payment Partner module for OpenERP
# Copyright (C) 2014 Akretion (http://www.akretion.com)
# Account Payment Partner module for Odoo
# Copyright (C) 2014-2015 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can redistribute it and/or modify
@@ -20,39 +20,41 @@
#
##############################################################################
from openerp import models, api
from openerp import models, fields, api
class PaymentOrderCreate(models.TransientModel):
_inherit = 'payment.order.create'
payment_mode = fields.Selection([
('same', 'Same'),
('same_or_null', 'Same or empty'),
('any', 'Any'),
], string='Payment Mode on Invoice')
@api.model
def default_get(self, field_list):
res = super(PaymentOrderCreate, self).default_get(field_list)
context = self.env.context
assert context.get('active_model') == 'payment.order',\
'active_model should be payment.order'
assert context.get('active_id'), 'Missing active_id in context !'
pay_order = self.env['payment.order'].browse(context['active_id'])
res['payment_mode'] = pay_order.mode.default_payment_mode
return res
@api.multi
def extend_payment_order_domain(self, payment_order, domain):
res = super(PaymentOrderCreate, self).extend_payment_order_domain(
payment_order, domain)
# Monkey patch for fixing problem with the core search function
# when args has ('invoice', '=', False), referred in the issue #4857
# (https://github.com/odoo/odoo/issues/4857)
#
# Original domain:
# domain += ['|', '|',
# ('invoice', '=', False),
# ('invoice.payment_mode_id', '=', False),
# ('invoice.payment_mode_id', '=', payment_order.mode.id)]
self.env.cr.execute(
"SELECT l.id "
"FROM account_move_line l "
"LEFT OUTER JOIN account_invoice i "
"ON l.move_id = i.move_id "
"INNER JOIN account_account a "
"ON a.id = l.account_id "
"WHERE i.id IS NULL"
" AND l.reconcile_id IS NULL"
" AND a.type in ('receivable', 'payable')")
ids = [x[0] for x in self.env.cr.fetchall()]
domain += ['|',
('id', 'in', ids),
'|',
('invoice.payment_mode_id', '=', False),
('invoice.payment_mode_id', '=', payment_order.mode.id)]
if self.invoice and self.payment_mode:
if self.payment_mode == 'same':
domain.append(
('invoice.payment_mode_id', '=', payment_order.mode.id))
elif self.payment_mode == 'same_or_null':
domain += [
'|',
('invoice.payment_mode_id', '=', False),
('invoice.payment_mode_id', '=', payment_order.mode.id)]
# if payment_mode == 'any', don't modify domain
return res

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 Akretion (http://www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
-->
<openerp>
<data>
<record id="view_create_payment_order" model="ir.ui.view">
<field name="name">account_payment_partner.payment.order.create.form</field>
<field name="model">payment.order.create</field>
<field name="inherit_id" ref="account_banking_payment_export.view_create_payment_order"/>
<field name="arch" type="xml">
<field name="invoice" position="after">
<field name="payment_mode"
attrs="{'invisible': [('invoice', '=', False)], 'required': [('invoice', '=', True)]}"/>
</field>
</field>
</record>
</data>
</openerp>