diff --git a/.travis.yml b/.travis.yml index a9a07bb6e..d51e2c078 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,7 @@ virtualenv: install: - git clone https://github.com/OCA/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools - export PATH=${HOME}/maintainer-quality-tools/travis:${PATH} + - sudo pip install unidecode - travis_install_nightly script: diff --git a/__unported__/account_banking_payment_export/__init__.py b/__unported__/account_banking_payment_export/__init__.py deleted file mode 100644 index 9186ee3ad..000000000 --- a/__unported__/account_banking_payment_export/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from . import model diff --git a/__unported__/account_banking_payment_export/i18n/account_banking_payment_export.pot b/__unported__/account_banking_payment_export/i18n/account_banking_payment_export.pot deleted file mode 100644 index bb2ac6301..000000000 --- a/__unported__/account_banking_payment_export/i18n/account_banking_payment_export.pot +++ /dev/null @@ -1,145 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * account_banking_payment_export -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-10-25 15:58+0000\n" -"PO-Revision-Date: 2013-10-25 15:58+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: account_banking_payment_export -#: help:payment.mode.type,name:0 -msgid "Payment 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 -#: view:payment.manual:0 -msgid "Please execute payment order manually, and click OK when succesfully sent." -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 -#: code:addons/account_banking_payment_export/model/account_payment.py:69 -#, python-format -msgid "You can only combine payment orders of the same type" -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_account_move_line -msgid "Journal Items" -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 -#: field:payment.mode.type,name:0 -msgid "Name" -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 -#: view:payment.manual:0 -msgid "Manual payment" -msgstr "" - -#. module: account_banking_payment_export -#: field:payment.manual,payment_order_ids:0 -msgid "Payment orders" -msgstr "" - -#. module: account_banking_payment_export -#: code:addons/account_banking_payment_export/model/account_payment.py:52 -#, python-format -msgid "Payment Order Export" -msgstr "" - -#. module: account_banking_payment_export -#: help:payment.mode,type:0 -msgid "Select the Payment Type for the Payment Mode." -msgstr "" - -#. module: account_banking_payment_export -#: view:payment.order:0 -msgid "launch_wizard" -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 -#: model:ir.model,name:account_banking_payment_export.model_payment_order_create -msgid "payment.order.create" -msgstr "" - -#. module: account_banking_payment_export -#: code:addons/account_banking_payment_export/model/account_payment.py:68 -#, python-format -msgid "Error" -msgstr "" - -#. module: account_banking_payment_export -#: field:payment.mode.type,ir_model_id:0 -msgid "Payment wizard" -msgstr "" - -#. module: account_banking_payment_export -#: field:payment.mode,type:0 -msgid "Payment type" -msgstr "" - -#. module: account_banking_payment_export -#: field:payment.mode.type,code:0 -msgid "Code" -msgstr "" - -#. module: account_banking_payment_export -#: view:payment.manual:0 -msgid "OK" -msgstr "" - -#. module: account_banking_payment_export -#: view:payment.mode.type:0 -msgid "Payment mode" -msgstr "" - -#. module: account_banking_payment_export -#: view:payment.manual:0 -msgid "Cancel" -msgstr "" - -#. module: account_banking_payment_export -#: field:payment.mode.type,suitable_bank_types:0 -msgid "Suitable bank types" -msgstr "" - diff --git a/__unported__/account_banking_payment_export/migrations/7.0.0.1.165/pre-migration.py b/__unported__/account_banking_payment_export/migrations/7.0.0.1.165/pre-migration.py deleted file mode 100644 index a420f05fd..000000000 --- a/__unported__/account_banking_payment_export/migrations/7.0.0.1.165/pre-migration.py +++ /dev/null @@ -1,33 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (C) 2014 Akretion (http://www.akretion.com/) -# @author: Alexis de Lattre -# -# 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 . -# -############################################################################## - - -def migrate(cr, version): - if not version: - return - cr.execute( - "UPDATE payment_line SET communication = communication2, " - "communication2 = null " - "FROM payment_order " - "WHERE payment_line.order_id = payment_order.id " - "AND payment_order.state in ('draft', 'open') " - "AND payment_line.state = 'normal' " - "AND communication2 is not null") diff --git a/__unported__/account_banking_payment_export/model/bank_payment_manual.py b/__unported__/account_banking_payment_export/model/bank_payment_manual.py deleted file mode 100644 index cd17f4dd1..000000000 --- a/__unported__/account_banking_payment_export/model/bank_payment_manual.py +++ /dev/null @@ -1,65 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (C) 2009 EduSense BV (). -# (C) 2011 - 2013 Therp BV (). -# -# 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 . -# -############################################################################## - -''' -This module contains a single "wizard" for confirming manual -bank transfers. -''' - -from openerp.osv import orm, fields -from openerp import netsvc - - -class payment_manual(orm.TransientModel): - _name = 'payment.manual' - _description = 'Send payment order(s) manually' - - _columns = { - 'payment_order_ids': fields.many2many( - 'payment.order', - 'wiz_manual_payorders_rel', - 'wizard_id', - 'payment_order_id', - 'Payment orders', - readonly=True - ), - } - - def create(self, cr, uid, vals, context=None): - payment_order_ids = context.get('active_ids', []) - vals.update({ - 'payment_order_ids': [[6, 0, payment_order_ids]], - }) - return super(payment_manual, self).create( - cr, uid, vals, context=context - ) - - def button_ok(self, cr, uid, ids, context=None): - wf_service = netsvc.LocalService('workflow') - for wiz in self.browse(cr, uid, ids, context=context): - for order_id in wiz.payment_order_ids: - wf_service.trg_validate( - uid, 'payment.order', order_id.id, 'done', cr) - return {'type': 'ir.actions.act_window_close'} diff --git a/__unported__/account_banking_payment_export/model/payment_mode_type.py b/__unported__/account_banking_payment_export/model/payment_mode_type.py deleted file mode 100644 index 5514595ec..000000000 --- a/__unported__/account_banking_payment_export/model/payment_mode_type.py +++ /dev/null @@ -1,73 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (C) 2009 EduSense BV (). -# (C) 2011 - 2013 Therp BV (). -# -# 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 . -# -############################################################################## - -from openerp.osv import orm, fields - - -class payment_mode_type(orm.Model): - _name = 'payment.mode.type' - _description = 'Payment Mode Type' - _columns = { - 'name': fields.char( - 'Name', size=64, required=True, - help='Payment Type' - ), - 'code': fields.char( - 'Code', size=64, required=True, - help='Specify the Code for Payment Type' - ), - 'suitable_bank_types': fields.many2many( - 'res.partner.bank.type', - 'bank_type_payment_type_rel', - 'pay_type_id', 'bank_type_id', - 'Suitable bank types', required=True), - 'ir_model_id': fields.many2one( - 'ir.model', 'Payment wizard', - help=('Select the Payment Wizard for payments of this type. ' - 'Leave empty for manual processing'), - domain=[('osv_memory', '=', True)], - ), - 'payment_order_type': fields.selection( - [('payment', 'Payment'), ('debit', 'Direct debit')], - 'Payment order type', required=True, - ), - 'active': fields.boolean('Active'), - } - - _defaults = { - 'payment_order_type': 'payment', - 'active': True, - } - - def _auto_init(self, cr, context=None): - r = super(payment_mode_type, self)._auto_init(cr, context=context) - # migrate xmlid from manual_bank_transfer to avoid dependency on - # account_banking - cr.execute("""UPDATE ir_model_data - SET module='account_banking_payment_export' - WHERE module='account_banking' AND - name='manual_bank_tranfer' AND - model='payment.mode.type'""") - return r diff --git a/__unported__/account_banking_payment_export/model/payment_order_create.py b/__unported__/account_banking_payment_export/model/payment_order_create.py deleted file mode 100644 index 910673da7..000000000 --- a/__unported__/account_banking_payment_export/model/payment_order_create.py +++ /dev/null @@ -1,201 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (C) 2009 EduSense BV (). -# (C) 2011 - 2013 Therp BV (). -# -# 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 . -# -############################################################################## - -from openerp.osv import orm, fields -from openerp.tools.translate import _ - - -class payment_order_create(orm.TransientModel): - _inherit = 'payment.order.create' - - def extend_payment_order_domain( - self, cr, uid, payment_order, domain, context=None): - if payment_order.payment_order_type == 'payment': - domain += [ - ('account_id.type', 'in', ('payable', 'receivable')), - ('amount_to_pay', '>', 0) - ] - return True - - def search_entries(self, cr, uid, ids, context=None): - """ - This method taken from account_payment module. - We adapt the domain based on the payment_order_type - """ - line_obj = self.pool.get('account.move.line') - mod_obj = self.pool.get('ir.model.data') - if context is None: - context = {} - data = self.read(cr, uid, ids, ['duedate'], context=context)[0] - search_due_date = data['duedate'] - - # start account_banking_payment - payment = self.pool.get('payment.order').browse( - cr, uid, context['active_id'], context=context) - # Search for move line to pay: - domain = [ - ('move_id.state', '=', 'posted'), - ('reconcile_id', '=', False), - ('company_id', '=', payment.mode.company_id.id), - ] - self.extend_payment_order_domain( - cr, uid, payment, domain, context=context) - # end account_direct_debit - - domain = domain + [ - '|', ('date_maturity', '<=', search_due_date), - ('date_maturity', '=', False) - ] - line_ids = line_obj.search(cr, uid, domain, context=context) - context.update({'line_ids': line_ids}) - model_data_ids = mod_obj.search( - cr, uid, [ - ('model', '=', 'ir.ui.view'), - ('name', '=', 'view_create_payment_order_lines')], - context=context) - resource_id = mod_obj.read( - cr, uid, model_data_ids, fields=['res_id'], - context=context)[0]['res_id'] - return { - 'name': _('Entry Lines'), - 'context': context, - 'view_type': 'form', - 'view_mode': 'form', - 'res_model': 'payment.order.create', - 'views': [(resource_id, 'form')], - 'type': 'ir.actions.act_window', - 'target': 'new', - } - - def _prepare_payment_line(self, cr, uid, payment, line, context=None): - '''This function is designed to be inherited - The resulting dict is passed to the create method of payment.line''' - _today = fields.date.context_today(self, cr, uid, context=context) - if payment.date_prefered == "now": - # no payment date => immediate payment - date_to_pay = False - elif payment.date_prefered == 'due': - # account_banking - # date_to_pay = line.date_maturity - date_to_pay = ( - line.date_maturity - if line.date_maturity and line.date_maturity > _today - else False) - # end account banking - elif payment.date_prefered == 'fixed': - # account_banking - # date_to_pay = payment.date_scheduled - date_to_pay = ( - payment.date_scheduled - if payment.date_scheduled and payment.date_scheduled > _today - else False) - # end account banking - - # account_banking - state = 'normal' - communication = line.ref or '-' - if line.invoice: - if line.invoice.type in ('in_invoice', 'in_refund'): - if line.invoice.reference_type == 'structured': - state = 'structured' - communication = line.invoice.reference - else: - if line.invoice.reference: - communication = line.invoice.reference - elif line.invoice.supplier_invoice_number: - communication = line.invoice.supplier_invoice_number - else: - # Make sure that the communication includes the - # customer invoice number (in the case of debit order) - communication = line.invoice.number.replace('/', '') - state = 'structured' - - # support debit orders when enabled - if (payment.payment_order_type == 'debit' - and 'amount_to_receive' in line): - amount_currency = line.amount_to_receive - else: - amount_currency = line.amount_to_pay - # end account_banking - - # account banking - # t = None - # line2bank = line_obj.line2bank(cr, uid, line_ids, t, context) - line2bank = self.pool['account.move.line'].line2bank( - cr, uid, [line.id], payment.mode.id, context) - # end account banking - - res = { - 'move_line_id': line.id, - 'amount_currency': amount_currency, - 'bank_id': line2bank.get(line.id), - 'order_id': payment.id, - 'partner_id': line.partner_id and line.partner_id.id or False, - # account banking - # 'communication': line.ref or '/' - 'communication': communication, - 'state': state, - # end account banking - 'date': date_to_pay, - 'currency': (line.invoice and line.invoice.currency_id.id - or line.journal_id.currency.id - or line.journal_id.company_id.currency_id.id), - } - return res - - def create_payment(self, cr, uid, ids, context=None): - ''' - This method is a slightly modified version of the existing method on - this model in account_payment. - - pass the payment mode to line2bank() - - allow invoices to create influence on the payment process: not only - 'Free' references are allowed, but others as well - - check date_to_pay is not in the past. - ''' - if context is None: - context = {} - data = self.read(cr, uid, ids, [], context=context)[0] - line_ids = data['entries'] - if not line_ids: - return {'type': 'ir.actions.act_window_close'} - - payment = self.pool['payment.order'].browse( - cr, uid, context['active_id'], context=context) - # Populate the current payment with new lines: - for line in self.pool['account.move.line'].browse( - cr, uid, line_ids, context=context): - vals = self._prepare_payment_line( - cr, uid, payment, line, context=context) - self.pool['payment.line'].create(cr, uid, vals, context=context) - # Force reload of payment order view as a workaround for lp:1155525 - return { - 'name': _('Payment Orders'), - 'context': context, - 'view_type': 'form', - 'view_mode': 'form,tree', - 'res_model': 'payment.order', - 'res_id': context['active_id'], - 'type': 'ir.actions.act_window', - } diff --git a/__unported__/account_banking_sepa_credit_transfer/account_banking_sepa.py b/__unported__/account_banking_sepa_credit_transfer/account_banking_sepa.py deleted file mode 100644 index 99d5b022b..000000000 --- a/__unported__/account_banking_sepa_credit_transfer/account_banking_sepa.py +++ /dev/null @@ -1,90 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# SEPA Credit Transfer module for OpenERP -# Copyright (C) 2010-2013 Akretion (http://www.akretion.com) -# @author: Alexis de Lattre -# -# 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 . -# -############################################################################## - -from openerp.osv import orm, fields -from openerp.addons.decimal_precision import decimal_precision as dp -from unidecode import unidecode - - -class banking_export_sepa(orm.Model): - '''SEPA export''' - _name = 'banking.export.sepa' - _description = __doc__ - _rec_name = 'filename' - - def _generate_filename(self, cr, uid, ids, name, arg, context=None): - res = {} - for sepa_file in self.browse(cr, uid, ids, context=context): - ref = sepa_file.payment_order_ids[0].reference - if ref: - label = unidecode(ref.replace('/', '-')) - else: - label = 'error' - res[sepa_file.id] = 'sct_%s.xml' % label - return res - - _columns = { - 'payment_order_ids': fields.many2many( - 'payment.order', - 'account_payment_order_sepa_rel', - 'banking_export_sepa_id', 'account_order_id', - 'Payment Orders', - readonly=True), - 'nb_transactions': fields.integer( - 'Number of Transactions', readonly=True), - 'total_amount': fields.float( - 'Total Amount', digits_compute=dp.get_precision('Account'), - readonly=True), - 'batch_booking': fields.boolean( - 'Batch Booking', readonly=True, - help="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."), - 'charge_bearer': fields.selection([ - ('SLEV', 'Following Service Level'), - ('SHAR', 'Shared'), - ('CRED', 'Borne by Creditor'), - ('DEBT', 'Borne by Debtor'), - ], 'Charge Bearer', readonly=True, - help="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."), - 'create_date': fields.datetime('Generation Date', readonly=True), - 'file': fields.binary('SEPA XML File', readonly=True), - 'filename': fields.function( - _generate_filename, type='char', size=256, string='Filename', - readonly=True), - 'state': fields.selection([ - ('draft', 'Draft'), - ('sent', 'Sent'), - ], 'State', readonly=True), - } - - _defaults = { - 'state': 'draft', - } diff --git a/__unported__/account_banking_sepa_credit_transfer/static/src/img/icon.png b/__unported__/account_banking_sepa_credit_transfer/static/src/img/icon.png deleted file mode 100644 index 12ecf91ce..000000000 Binary files a/__unported__/account_banking_sepa_credit_transfer/static/src/img/icon.png and /dev/null differ diff --git a/__unported__/account_banking_sepa_direct_debit/account_banking_sdd.py b/__unported__/account_banking_sepa_direct_debit/account_banking_sdd.py deleted file mode 100644 index 87e50111b..000000000 --- a/__unported__/account_banking_sepa_direct_debit/account_banking_sdd.py +++ /dev/null @@ -1,440 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# SEPA Direct Debit module for OpenERP -# Copyright (C) 2013 Akretion (http://www.akretion.com) -# @author: Alexis de Lattre -# -# 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 . -# -############################################################################## - -from openerp.osv import orm, fields -from openerp.tools.translate import _ -from openerp.addons.decimal_precision import decimal_precision as dp -from unidecode import unidecode -from datetime import datetime -from dateutil.relativedelta import relativedelta -import logging - -NUMBER_OF_UNUSED_MONTHS_BEFORE_EXPIRY = 36 - -logger = logging.getLogger(__name__) - - -class banking_export_sdd(orm.Model): - '''SEPA Direct Debit export''' - _name = 'banking.export.sdd' - _description = __doc__ - _rec_name = 'filename' - - def _generate_filename(self, cr, uid, ids, name, arg, context=None): - res = {} - for sepa_file in self.browse(cr, uid, ids, context=context): - ref = sepa_file.payment_order_ids[0].reference - if ref: - label = unidecode(ref.replace('/', '-')) - else: - label = 'error' - res[sepa_file.id] = 'sdd_%s.xml' % label - return res - - _columns = { - 'payment_order_ids': fields.many2many( - 'payment.order', - 'account_payment_order_sdd_rel', - 'banking_export_sepa_id', 'account_order_id', - 'Payment Orders', - readonly=True), - 'nb_transactions': fields.integer( - 'Number of Transactions', readonly=True), - 'total_amount': fields.float( - 'Total Amount', digits_compute=dp.get_precision('Account'), - readonly=True), - 'batch_booking': fields.boolean( - 'Batch Booking', readonly=True, - help="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."), - 'charge_bearer': fields.selection([ - ('SLEV', 'Following Service Level'), - ('SHAR', 'Shared'), - ('CRED', 'Borne by Creditor'), - ('DEBT', 'Borne by Debtor'), - ], 'Charge Bearer', readonly=True, - help="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."), - 'create_date': fields.datetime('Generation Date', readonly=True), - 'file': fields.binary('SEPA File', readonly=True), - 'filename': fields.function( - _generate_filename, type='char', size=256, - string='Filename', readonly=True, store=True), - 'state': fields.selection([ - ('draft', 'Draft'), - ('sent', 'Sent'), - ], 'State', readonly=True), - } - - _defaults = { - 'state': 'draft', - } - - -class sdd_mandate(orm.Model): - '''SEPA Direct Debit Mandate''' - _name = 'sdd.mandate' - _description = __doc__ - _rec_name = 'unique_mandate_reference' - _inherit = ['mail.thread'] - _order = 'signature_date desc' - _track = { - 'state': { - 'account_banking_sepa_direct_debit.mandate_valid': - lambda self, cr, uid, obj, ctx=None: - obj['state'] == 'valid', - 'account_banking_sepa_direct_debit.mandate_expired': - lambda self, cr, uid, obj, ctx=None: - obj['state'] == 'expired', - 'account_banking_sepa_direct_debit.mandate_cancel': - lambda self, cr, uid, obj, ctx=None: - obj['state'] == 'cancel', - }, - 'recurrent_sequence_type': { - 'account_banking_sepa_direct_debit.recurrent_sequence_type_first': - lambda self, cr, uid, obj, ctx=None: - obj['recurrent_sequence_type'] == 'first', - 'account_banking_sepa_direct_debit.' - 'recurrent_sequence_type_recurring': - lambda self, cr, uid, obj, ctx=None: - obj['recurrent_sequence_type'] == 'recurring', - 'account_banking_sepa_direct_debit.recurrent_sequence_type_final': - lambda self, cr, uid, obj, ctx=None: - obj['recurrent_sequence_type'] == 'final', - } - } - - _columns = { - 'partner_bank_id': fields.many2one( - 'res.partner.bank', 'Bank Account', track_visibility='onchange'), - 'partner_id': fields.related( - 'partner_bank_id', 'partner_id', type='many2one', - relation='res.partner', string='Partner', readonly=True), - 'company_id': fields.many2one('res.company', 'Company', required=True), - 'unique_mandate_reference': fields.char( - 'Unique Mandate Reference', size=35, readonly=True, - track_visibility='always'), - 'type': fields.selection([ - ('recurrent', 'Recurrent'), - ('oneoff', 'One-Off'), - ], 'Type of Mandate', required=True, track_visibility='always'), - 'recurrent_sequence_type': fields.selection([ - ('first', 'First'), - ('recurring', 'Recurring'), - ('final', 'Final'), - ], 'Sequence Type for Next Debit', track_visibility='onchange', - help="This field is only used for Recurrent mandates, not for " - "One-Off mandates."), - 'signature_date': fields.date( - 'Date of Signature of the Mandate', track_visibility='onchange'), - 'scan': fields.binary('Scan of the Mandate'), - 'last_debit_date': fields.date( - 'Date of the Last Debit', readonly=True), - 'state': fields.selection([ - ('draft', 'Draft'), - ('valid', 'Valid'), - ('expired', 'Expired'), - ('cancel', 'Cancelled'), - ], 'Status', - help="Only valid mandates can be used in a payment line. A " - "cancelled mandate is a mandate that has been cancelled by " - "the customer. A one-off mandate expires after its first use. " - "A recurrent mandate expires after it's final use or if it " - "hasn't been used for 36 months."), - 'payment_line_ids': fields.one2many( - 'payment.line', 'sdd_mandate_id', "Related Payment Lines"), - 'sepa_migrated': fields.boolean( - 'Migrated to SEPA', track_visibility='onchange', - help="If this field is not active, the mandate section of the " - "next direct debit file that include this mandate will contain " - "the 'Original Mandate Identification' and the 'Original " - "Creditor Scheme Identification'. This is required in a few " - "countries (Belgium for instance), but not in all countries. " - "If this is not required in your country, you should keep this " - "field always active."), - 'original_mandate_identification': fields.char( - 'Original Mandate Identification', size=35, - track_visibility='onchange', - help="When the field 'Migrated to SEPA' is not active, this " - "field will be used as the Original Mandate Identification in " - "the Direct Debit file."), - } - - _defaults = { - 'company_id': lambda self, cr, uid, context: - self.pool['res.company']._company_default_get( - cr, uid, 'sdd.mandate', context=context), - 'unique_mandate_reference': '/', - 'state': 'draft', - 'sepa_migrated': True, - } - - _sql_constraints = [( - 'mandate_ref_company_uniq', - 'unique(unique_mandate_reference, company_id)', - 'A Mandate with the same reference already exists for this company !' - )] - - def create(self, cr, uid, vals, context=None): - if vals.get('unique_mandate_reference', '/') == '/': - vals['unique_mandate_reference'] = \ - self.pool['ir.sequence'].next_by_code( - cr, uid, 'sdd.mandate.reference', context=context) - return super(sdd_mandate, self).create(cr, uid, vals, context=context) - - def _check_sdd_mandate(self, cr, uid, ids): - for mandate in self.browse(cr, uid, ids): - if (mandate.signature_date and - mandate.signature_date > - datetime.today().strftime('%Y-%m-%d')): - raise orm.except_orm( - _('Error:'), - _("The date of signature of mandate '%s' is in the " - "future !") - % mandate.unique_mandate_reference) - if mandate.state == 'valid' and not mandate.signature_date: - raise orm.except_orm( - _('Error:'), - _("Cannot validate the mandate '%s' without a date of " - "signature.") - % mandate.unique_mandate_reference) - if mandate.state == 'valid' and not mandate.partner_bank_id: - raise orm.except_orm( - _('Error:'), - _("Cannot validate the mandate '%s' because it is not " - "attached to a bank account.") - % mandate.unique_mandate_reference) - - if (mandate.signature_date and mandate.last_debit_date and - mandate.signature_date > mandate.last_debit_date): - raise orm.except_orm( - _('Error:'), - _("The mandate '%s' can't have a date of last debit " - "before the date of signature.") - % mandate.unique_mandate_reference) - if (mandate.type == 'recurrent' - and not mandate.recurrent_sequence_type): - raise orm.except_orm( - _('Error:'), - _("The recurrent mandate '%s' must have a sequence type.") - % mandate.unique_mandate_reference) - if (mandate.type == 'recurrent' and not mandate.sepa_migrated - and mandate.recurrent_sequence_type != 'first'): - raise orm.except_orm( - _('Error:'), - _("The recurrent mandate '%s' which is not marked as " - "'Migrated to SEPA' must have its recurrent sequence " - "type set to 'First'.") - % mandate.unique_mandate_reference) - if (mandate.type == 'recurrent' and not mandate.sepa_migrated - and not mandate.original_mandate_identification): - raise orm.except_orm( - _('Error:'), - _("You must set the 'Original Mandate Identification' " - "on the recurrent mandate '%s' which is not marked " - "as 'Migrated to SEPA'.") - % mandate.unique_mandate_reference) - return True - - _constraints = [ - (_check_sdd_mandate, "Error msg in raise", [ - 'last_debit_date', 'signature_date', 'state', 'partner_bank_id', - 'type', 'recurrent_sequence_type', 'sepa_migrated', - 'original_mandate_identification', - ]), - ] - - def mandate_type_change(self, cr, uid, ids, type): - if type == 'recurrent': - recurrent_sequence_type = 'first' - else: - recurrent_sequence_type = False - res = {'value': {'recurrent_sequence_type': recurrent_sequence_type}} - return res - - def mandate_partner_bank_change( - self, cr, uid, ids, partner_bank_id, type, recurrent_sequence_type, - last_debit_date, state): - res = {'value': {}} - if partner_bank_id: - partner_bank_read = self.pool['res.partner.bank'].read( - cr, uid, partner_bank_id, ['partner_id'])['partner_id'] - if partner_bank_read: - res['value']['partner_id'] = partner_bank_read[0] - if (state == 'valid' and partner_bank_id - and type == 'recurrent' - and recurrent_sequence_type != 'first'): - res['value']['recurrent_sequence_type'] = 'first' - res['warning'] = { - 'title': _('Mandate update'), - 'message': _( - "As you changed the bank account attached to this " - "mandate, the 'Sequence Type' has been set back to " - "'First'."), - } - return res - - def validate(self, cr, uid, ids, context=None): - to_validate_ids = [] - for mandate in self.browse(cr, uid, ids, context=context): - assert mandate.state == 'draft', 'Mandate should be in draft state' - to_validate_ids.append(mandate.id) - self.write( - cr, uid, to_validate_ids, {'state': 'valid'}, context=context) - return True - - def cancel(self, cr, uid, ids, context=None): - to_cancel_ids = [] - for mandate in self.browse(cr, uid, ids, context=context): - assert mandate.state in ('draft', 'valid'),\ - 'Mandate should be in draft or valid state' - to_cancel_ids.append(mandate.id) - self.write( - cr, uid, to_cancel_ids, {'state': 'cancel'}, context=context) - return True - - def back2draft(self, cr, uid, ids, context=None): - to_draft_ids = [] - for mandate in self.browse(cr, uid, ids, context=context): - assert mandate.state == 'cancel',\ - 'Mandate should be in cancel state' - to_draft_ids.append(mandate.id) - self.write( - cr, uid, to_draft_ids, {'state': 'draft'}, context=context) - return True - - def _sdd_mandate_set_state_to_expired(self, cr, uid, context=None): - logger.info('Searching for SDD Mandates that must be set to Expired') - expire_limit_date = datetime.today() + \ - relativedelta(months=-NUMBER_OF_UNUSED_MONTHS_BEFORE_EXPIRY) - expire_limit_date_str = expire_limit_date.strftime('%Y-%m-%d') - expired_mandate_ids = self.search(cr, uid, [ - '|', - ('last_debit_date', '=', False), - ('last_debit_date', '<=', expire_limit_date_str), - ('state', '=', 'valid'), - ('signature_date', '<=', expire_limit_date_str), - ], context=context) - if expired_mandate_ids: - self.write( - cr, uid, expired_mandate_ids, {'state': 'expired'}, - context=context) - logger.info( - 'The following SDD Mandate IDs has been set to expired: %s' - % expired_mandate_ids) - else: - logger.info('0 SDD Mandates must be set to Expired') - return True - - -class res_partner_bank(orm.Model): - _inherit = 'res.partner.bank' - - _columns = { - 'sdd_mandate_ids': fields.one2many( - 'sdd.mandate', 'partner_bank_id', 'SEPA Direct Debit Mandates'), - } - - -class payment_line(orm.Model): - _inherit = 'payment.line' - - _columns = { - 'sdd_mandate_id': fields.many2one( - 'sdd.mandate', 'SEPA Direct Debit Mandate', - domain=[('state', '=', 'valid')]), - } - - def create(self, cr, uid, vals, context=None): - '''If the customer invoice has a mandate, take it - otherwise, take the first valid mandate of the bank account''' - if context is None: - context = {} - if not vals: - vals = {} - partner_bank_id = vals.get('bank_id') - move_line_id = vals.get('move_line_id') - if (context.get('default_payment_order_type') == 'debit' - and 'sdd_mandate_id' not in vals): - if move_line_id: - line = self.pool['account.move.line'].browse( - cr, uid, move_line_id, context=context) - if (line.invoice and line.invoice.type == 'out_invoice' - and line.invoice.sdd_mandate_id): - vals.update({ - 'sdd_mandate_id': line.invoice.sdd_mandate_id.id, - 'bank_id': - line.invoice.sdd_mandate_id.partner_bank_id.id, - }) - if partner_bank_id and 'sdd_mandate_id' not in vals: - mandate_ids = self.pool['sdd.mandate'].search(cr, uid, [ - ('partner_bank_id', '=', partner_bank_id), - ('state', '=', 'valid'), - ], context=context) - if mandate_ids: - vals['sdd_mandate_id'] = mandate_ids[0] - return super(payment_line, self).create(cr, uid, vals, context=context) - - def _check_mandate_bank_link(self, cr, uid, ids): - for payline in self.browse(cr, uid, ids): - if (payline.sdd_mandate_id and payline.bank_id - and payline.sdd_mandate_id.partner_bank_id.id != - payline.bank_id.id): - raise orm.except_orm( - _('Error:'), - _("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').") % ( - payline.name, - self.pool['res.partner.bank'].name_get( - cr, uid, [payline.bank_id.id])[0][1], - payline.sdd_mandate_id.unique_mandate_reference, - self.pool['res.partner.bank'].name_get( - cr, uid, - [payline.sdd_mandate_id.partner_bank_id.id])[0][1], - )) - return True - - _constraints = [ - (_check_mandate_bank_link, 'Error msg in raise', - ['sdd_mandate_id', 'bank_id']), - ] - - -class account_invoice(orm.Model): - _inherit = 'account.invoice' - - _columns = { - 'sdd_mandate_id': fields.many2one( - 'sdd.mandate', 'SEPA Direct Debit Mandate', - domain=[('state', '=', 'valid')], readonly=True, - states={'draft': [('readonly', False)]}) - } diff --git a/__unported__/account_banking_sepa_direct_debit/data/mandate_reference_sequence.xml b/__unported__/account_banking_sepa_direct_debit/data/mandate_reference_sequence.xml deleted file mode 100644 index 68075d526..000000000 --- a/__unported__/account_banking_sepa_direct_debit/data/mandate_reference_sequence.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - SDD Mandate Reference - sdd.mandate.reference - - - - SDD Mandate Reference - sdd.mandate.reference - RUM - - - - - - - diff --git a/__unported__/account_banking_sepa_direct_debit/mandate_expire_cron.xml b/__unported__/account_banking_sepa_direct_debit/mandate_expire_cron.xml deleted file mode 100644 index 4cb0693d2..000000000 --- a/__unported__/account_banking_sepa_direct_debit/mandate_expire_cron.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - Set SEPA Direct Debit Mandates to Expired - - - 1 - days - -1 - - - - - - - - diff --git a/__unported__/account_banking_sepa_direct_debit/sdd_mandate_view.xml b/__unported__/account_banking_sepa_direct_debit/sdd_mandate_view.xml deleted file mode 100644 index bd1dd6e79..000000000 --- a/__unported__/account_banking_sepa_direct_debit/sdd_mandate_view.xml +++ /dev/null @@ -1,152 +0,0 @@ - - - - - - - sdd.mandate.form - sdd.mandate - -
-
-
- -
-

- -

-
- - - - - - - - - - - - - - - -
-
- - -
-
-
-
- - - sdd.mandate.tree - sdd.mandate - - - - - - - - - - - - - - - sdd.mandate.search - sdd.mandate - - - - - - - - - - - - - - - SEPA Direct Debit Mandates - sdd.mandate - form - tree,form - -

- Click to create a new SEPA Direct Debit Mandate. -

- 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. -

-
-
- - - - - - Mandate Validated - sdd.mandate - - SEPA Direct Debit Mandate Validated - - - - Mandate Expired - sdd.mandate - - SEPA Direct Debit Mandate has Expired - - - - Mandate Cancelled - sdd.mandate - - SEPA Direct Debit Mandate Cancelled - - - - Sequence Type set to First - sdd.mandate - - Sequence Type set to First - - - - Sequence Type set to Recurring - sdd.mandate - - Sequence Type set to Recurring - - - - Sequence Type set to Final - sdd.mandate - - Sequence Type set to Final - - -
-
diff --git a/__unported__/account_banking_sepa_direct_debit/static/src/img/icon.png b/__unported__/account_banking_sepa_direct_debit/static/src/img/icon.png deleted file mode 100644 index 6d1d923b6..000000000 Binary files a/__unported__/account_banking_sepa_direct_debit/static/src/img/icon.png and /dev/null differ diff --git a/__unported__/account_direct_debit/__init__.py b/__unported__/account_direct_debit/__init__.py deleted file mode 100644 index 16e8b082f..000000000 --- a/__unported__/account_direct_debit/__init__.py +++ /dev/null @@ -1 +0,0 @@ -import model diff --git a/__unported__/account_direct_debit/migrations/7.0.2/pre-migration.py b/__unported__/account_direct_debit/migrations/7.0.2/pre-migration.py deleted file mode 100644 index 49c0db52f..000000000 --- a/__unported__/account_direct_debit/migrations/7.0.2/pre-migration.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (C) 2013 Therp BV (). -# -# 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 . -# -############################################################################## - -import logging -logger = logging.getLogger() - - -def rename_columns(cr, column_spec): - """ - Rename table columns. Taken from OpenUpgrade. - - :param column_spec: a hash with table keys, with lists of tuples as \ - values. Tuples consist of (old_name, new_name). - - """ - for table in column_spec.keys(): - for (old, new) in column_spec[table]: - logger.info("table %s, column %s: renaming to %s", table, old, new) - cr.execute('ALTER TABLE %s RENAME %s TO %s', (table, old, new,)) - cr.execute('DROP INDEX IF EXISTS "%s_%s_index"' % (table, old)) - - -def migrate(cr, version): - if not version: - return - - # rename field debit_move_line_id - rename_columns(cr, { - 'payment_line': [ - ('debit_move_line_id', 'banking_addons_61_debit_move_line_id'), - ] - }) diff --git a/__unported__/account_direct_debit/model/__init__.py b/__unported__/account_direct_debit/model/__init__.py deleted file mode 100644 index b3558c40e..000000000 --- a/__unported__/account_direct_debit/model/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -import account_payment -import payment_line -import account_move_line -import account_invoice -import payment_order_create diff --git a/__unported__/account_payment_partner/view/account_invoice.xml b/__unported__/account_payment_partner/view/account_invoice.xml deleted file mode 100644 index 0bfd2d1f5..000000000 --- a/__unported__/account_payment_partner/view/account_invoice.xml +++ /dev/null @@ -1,38 +0,0 @@ - - - - - - - - - - account_payment_partner.invoice_form - account.invoice - - - - - - - - - - - account_payment_partner.invoice_supplier_form - account.invoice - - - - - - - - - - - diff --git a/__unported__/account_payment_purchase/model/purchase.py b/__unported__/account_payment_purchase/model/purchase.py deleted file mode 100644 index f397a6a61..000000000 --- a/__unported__/account_payment_purchase/model/purchase.py +++ /dev/null @@ -1,82 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Account Payment Purchase module for OpenERP -# Copyright (C) 2014 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# 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 . -# -############################################################################## - -from openerp.osv import orm, fields - - -class purchase_order(orm.Model): - _inherit = "purchase.order" - - _columns = { - 'supplier_partner_bank_id': fields.many2one( - 'res.partner.bank', 'Supplier Bank Account', - help="Select the bank account of your supplier on which " - "your company should send the payment. This field is copied " - "from the partner and will be copied to the supplier invoice."), - 'payment_mode_id': fields.many2one( - 'payment.mode', 'Payment Mode'), - } - - def _get_default_supplier_partner_bank( - self, cr, uid, partner, context=None): - '''This function is designed to be inherited''' - if partner.bank_ids: - return partner.bank_ids[0].id - else: - return False - - def onchange_partner_id(self, cr, uid, ids, partner_id): - res = super(purchase_order, self).onchange_partner_id( - cr, uid, ids, partner_id) - if partner_id: - partner = self.pool['res.partner'].browse( - cr, uid, partner_id) - res['value'].update({ - 'supplier_partner_bank_id': - self._get_default_supplier_partner_bank( - cr, uid, partner), - 'payment_mode_id': - partner.supplier_payment_mode.id or False, - }) - else: - res['value'].update({ - 'supplier_partner_bank_id': False, - 'payment_mode_id': False, - }) - return res - - def action_invoice_create(self, cr, uid, ids, context=None): - """Copy bank partner + payment type from PO to invoice""" - # as of OpenERP 7.0, there is no _prepare function for - # the invoice (the _prepare function only exists for invoice lines) - res = super(purchase_order, self).action_invoice_create( - cr, uid, ids, context=context) - for order in self.browse(cr, uid, ids, context=context): - for invoice in order.invoice_ids: - if invoice.state == 'draft': - invoice.write({ - 'partner_bank_id': - order.supplier_partner_bank_id.id or False, - 'payment_mode_id': - order.payment_mode_id.id or False, - }, context=context) - return res diff --git a/__unported__/account_payment_sale_stock/model/stock.py b/__unported__/account_payment_sale_stock/model/stock.py deleted file mode 100644 index 5ed4fbd4f..000000000 --- a/__unported__/account_payment_sale_stock/model/stock.py +++ /dev/null @@ -1,43 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Account Payment Sale Stock module for OpenERP -# Copyright (C) 2014 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# 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 . -# -############################################################################## - -from openerp.osv import orm - - -class stock_picking(orm.Model): - _inherit = "stock.picking" - - def _prepare_invoice( - self, cr, uid, picking, partner, inv_type, journal_id, - context=None): - """Copy payment mode from sale order to invoice""" - invoice_vals = super(stock_picking, self)._prepare_invoice( - cr, uid, picking, partner, inv_type, journal_id, context=context) - if picking.sale_id: - invoice_vals.update({ - 'partner_bank_id': - picking.sale_id.payment_mode_id and - picking.sale_id.payment_mode_id.bank_id.id or False, - 'payment_mode_id': - picking.sale_id.payment_mode_id.id or False, - }) - return invoice_vals diff --git a/__unported__/account_payment_shortcut/__init__.py b/__unported__/account_payment_shortcut/__init__.py deleted file mode 100644 index c9dbb3cf6..000000000 --- a/__unported__/account_payment_shortcut/__init__.py +++ /dev/null @@ -1,2 +0,0 @@ -# -*- coding: utf-8 -*- -from . import payment_order diff --git a/__unported__/account_payment_shortcut/__openerp__.py b/__unported__/account_payment_shortcut/__openerp__.py deleted file mode 100644 index 7f35ab096..000000000 --- a/__unported__/account_payment_shortcut/__openerp__.py +++ /dev/null @@ -1,34 +0,0 @@ -############################################################################## -# -# Copyright (C) 2011 Therp BV (). -# 2011 Smile BV (). -# 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 . -# -############################################################################## -{ - 'name': 'Account Payment Invoice Selection Shortcut', - 'version': '1.134', - 'license': 'AGPL-3', - 'author': 'Smile / Therp BV', - 'website': 'https://launchpad.net/banking-addons', - 'category': 'Banking addons', - 'depends': ['account_payment'], - 'description': ''' -When composing a payment order, select all candidates by default -(in the second step of the "Select invoices to pay" wizard). - ''', - 'installable': False, -} diff --git a/__unported__/account_payment_shortcut/payment_order.py b/__unported__/account_payment_shortcut/payment_order.py deleted file mode 100644 index b44c6b8da..000000000 --- a/__unported__/account_payment_shortcut/payment_order.py +++ /dev/null @@ -1,54 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (C) 2011 - 2013 Therp BV (). -# -# 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 . -# -############################################################################## - -from openerp.osv import orm - - -class payment_order_create(orm.TransientModel): - _inherit = 'payment.order.create' - - def default_get(self, cr, uid, fields_list, context=None): - """ - Automatically add the candidate move lines to - the payment order, instead of only applying them - to the domain. - - We make use of the fact that the search_entries - method passes an action without a res_id so that a - new instance is created. Inject the line_ids, which have - been placed in the context at object - creation time. - """ - if context is None: - context = {} - res = super(payment_order_create, self).default_get( - cr, uid, fields_list, context=context) - - if (fields_list - and 'entries' in fields_list - and 'entries' not in res - and context.get('line_ids', False)): - res['entries'] = context['line_ids'] - - return res diff --git a/account_banking_mandate/__init__.py b/account_banking_mandate/__init__.py new file mode 100644 index 000000000..1feaa8f2d --- /dev/null +++ b/account_banking_mandate/__init__.py @@ -0,0 +1,22 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Mandate module for openERP +# Copyright (C) 2014 Compassion CH (http://www.compassion.ch) +# @author: Cyril Sester +# +# 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 . +# +############################################################################## +from . import models diff --git a/account_banking_mandate/__openerp__.py b/account_banking_mandate/__openerp__.py new file mode 100644 index 000000000..5f825eaa9 --- /dev/null +++ b/account_banking_mandate/__openerp__.py @@ -0,0 +1,57 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Mandate module for openERP +# Copyright (C) 2014 Compassion CH (http://www.compassion.ch) +# @author: Cyril Sester , +# Alexis de Lattre +# +# 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 . +# +############################################################################## +{ + 'name': 'Account Banking Mandate', + 'summary': 'Banking mandates', + 'version': '0.1', + 'license': 'AGPL-3', + 'author': 'Compassion CH', + 'website': 'http://www.compassion.ch', + 'contributors': ['Pedro M. Baeza '], + 'category': 'Banking addons', + 'depends': [ + 'account_payment', + ], + 'data': [ + 'views/account_banking_mandate_view.xml', + 'views/account_invoice_view.xml', + 'views/account_payment_view.xml', + 'views/res_partner_bank_view.xml', + 'data/mandate_reference_sequence.xml', + 'security/ir.model.access.csv', + ], + 'demo': [], + 'test': ['test/banking_mandate.yml'], + 'description': ''' + This module adds a generic model for banking mandates. + These mandates can be specialized to fit any banking mandates (such as + sepa or lsv). + + A 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). + You can setup mandates from the accounting menu or directly from a bank + account. + ''', + 'installable': True, +} diff --git a/account_banking_mandate/data/mandate_reference_sequence.xml b/account_banking_mandate/data/mandate_reference_sequence.xml new file mode 100644 index 000000000..9a51db944 --- /dev/null +++ b/account_banking_mandate/data/mandate_reference_sequence.xml @@ -0,0 +1,20 @@ + + + + + + + DD Mandate Reference + account.banking.mandate + + + + DD Mandate Reference + account.banking.mandate + BM + + + + + + diff --git a/account_banking_mandate/i18n/account_banking_mandate.pot b/account_banking_mandate/i18n/account_banking_mandate.pot new file mode 100644 index 000000000..6be1594d5 --- /dev/null +++ b/account_banking_mandate/i18n/account_banking_mandate.pot @@ -0,0 +1,355 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_banking_mandate +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-10-31 23:00+0000\n" +"PO-Revision-Date: 2014-10-31 23:00+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_mandate +#: model:ir.actions.act_window,help:account_banking_mandate.mandate_action +msgid "

\n" +" Click to create a new Banking Mandate.\n" +"

\n" +" A Banking Mandate is a document signed by your customer that gives you the autorization to do one or several operations on his bank account.\n" +"

\n" +" " +msgstr "" + +#. module: account_banking_mandate +#: sql_constraint:account.banking.mandate:0 +msgid "A Mandate with the same reference already exists for this company !" +msgstr "" + +#. module: account_banking_mandate +#: model:ir.model,name:account_banking_mandate.model_account_banking_mandate +msgid "A generic banking mandate" +msgstr "" + +#. module: account_banking_mandate +#: view:account.banking.mandate:account_banking_mandate.view_mandate_form +msgid "Back to Draft" +msgstr "" + +#. module: account_banking_mandate +#: field:account.banking.mandate,partner_bank_id:0 +msgid "Bank Account" +msgstr "" + +#. module: account_banking_mandate +#: model:ir.model,name:account_banking_mandate.model_res_partner_bank +msgid "Bank Accounts" +msgstr "" + +#. module: account_banking_mandate +#: view:account.banking.mandate:account_banking_mandate.view_mandate_form +#: view:account.banking.mandate:account_banking_mandate.view_mandate_tree +msgid "Banking Mandate" +msgstr "" + +#. module: account_banking_mandate +#: model:mail.message.subtype,description:account_banking_mandate.mandate_cancel +msgid "Banking Mandate Cancelled" +msgstr "" + +#. module: account_banking_mandate +#: model:mail.message.subtype,description:account_banking_mandate.mandate_valid +msgid "Banking Mandate Validated" +msgstr "" + +#. module: account_banking_mandate +#: model:mail.message.subtype,description:account_banking_mandate.mandate_expired +msgid "Banking Mandate has Expired" +msgstr "" + +#. module: account_banking_mandate +#: model:ir.actions.act_window,name:account_banking_mandate.mandate_action +msgid "Banking Mandates" +msgstr "" + +#. module: account_banking_mandate +#: help:res.partner.bank,mandate_ids:0 +msgid "Banking mandates represents an authorization that the bank account owner gives to a company for a specific operation" +msgstr "" + +#. module: account_banking_mandate +#: view:account.banking.mandate:account_banking_mandate.view_mandate_form +msgid "Cancel" +msgstr "" + +#. module: account_banking_mandate +#: view:account.banking.mandate:account_banking_mandate.view_mandate_search +msgid "Cancelled" +msgstr "" + +#. module: account_banking_mandate +#: code:addons/account_banking_mandate/models/account_banking_mandate.py:110 +#, python-format +msgid "Cannot validate the mandate '%s' because it is not attached to a bank account." +msgstr "" + +#. module: account_banking_mandate +#: code:addons/account_banking_mandate/models/account_banking_mandate.py:106 +#, python-format +msgid "Cannot validate the mandate '%s' without a date of signature." +msgstr "" + +#. module: account_banking_mandate +#: field:account.banking.mandate,company_id:0 +msgid "Company" +msgstr "" + +#. module: account_banking_mandate +#: field:account.banking.mandate,create_uid:0 +msgid "Created by" +msgstr "" + +#. module: account_banking_mandate +#: field:account.banking.mandate,create_date:0 +msgid "Created on" +msgstr "" + +#. module: account_banking_mandate +#: view:payment.order:account_banking_mandate.view_mandate_payment_order_form +msgid "DD Mandate" +msgstr "" + +#. module: account_banking_mandate +#: view:res.partner:account_banking_mandate.mandate_partner_form +#: view:res.partner.bank:account_banking_mandate.mandate_partner_bank_tree +msgid "DD Mandates" +msgstr "" + +#. module: account_banking_mandate +#: field:account.banking.mandate,signature_date:0 +msgid "Date of Signature of the Mandate" +msgstr "" + +#. module: account_banking_mandate +#: field:account.banking.mandate,last_debit_date:0 +msgid "Date of the Last Debit" +msgstr "" + +#. module: account_banking_mandate +#: help:account.banking.mandate,message_last_post:0 +msgid "Date of the last message posted on the record." +msgstr "" + +#. module: account_banking_mandate +#: field:account.invoice,mandate_id:0 +#: field:payment.line,mandate_id:0 +msgid "Direct Debit Mandate" +msgstr "" + +#. module: account_banking_mandate +#: view:res.partner.bank:account_banking_mandate.mandate_partner_bank_form +#: field:res.partner.bank,mandate_ids:0 +msgid "Direct Debit Mandates" +msgstr "" + +#. module: account_banking_mandate +#: view:account.banking.mandate:account_banking_mandate.view_mandate_search +msgid "Draft" +msgstr "" + +#. module: account_banking_mandate +#: view:account.banking.mandate:account_banking_mandate.view_mandate_search +msgid "Expired" +msgstr "" + +#. module: account_banking_mandate +#: field:account.banking.mandate,message_follower_ids:0 +msgid "Followers" +msgstr "" + +#. module: account_banking_mandate +#: help:account.banking.mandate,message_summary:0 +msgid "Holds the Chatter summary (number of messages, ...). This summary is directly in html format in order to be inserted in kanban views." +msgstr "" + +#. module: account_banking_mandate +#: field:account.banking.mandate,id:0 +msgid "ID" +msgstr "" + +#. module: account_banking_mandate +#: help:account.banking.mandate,message_unread:0 +msgid "If checked new messages require your attention." +msgstr "" + +#. module: account_banking_mandate +#: model:ir.model,name:account_banking_mandate.model_account_invoice +msgid "Invoice" +msgstr "" + +#. module: account_banking_mandate +#: field:account.banking.mandate,message_is_follower:0 +msgid "Is a Follower" +msgstr "" + +#. module: account_banking_mandate +#: field:account.banking.mandate,message_last_post:0 +msgid "Last Message Date" +msgstr "" + +#. module: account_banking_mandate +#: field:account.banking.mandate,write_uid:0 +msgid "Last Updated by" +msgstr "" + +#. module: account_banking_mandate +#: field:account.banking.mandate,write_date:0 +msgid "Last Updated on" +msgstr "" + +#. module: account_banking_mandate +#: model:mail.message.subtype,name:account_banking_mandate.mandate_cancel +msgid "Mandate Cancelled" +msgstr "" + +#. module: account_banking_mandate +#: model:mail.message.subtype,name:account_banking_mandate.mandate_expired +msgid "Mandate Expired" +msgstr "" + +#. module: account_banking_mandate +#: model:mail.message.subtype,name:account_banking_mandate.mandate_valid +msgid "Mandate Validated" +msgstr "" + +#. module: account_banking_mandate +#: code:addons/account_banking_mandate/models/account_banking_mandate.py:152 +#, python-format +msgid "Mandate should be in cancel state" +msgstr "" + +#. module: account_banking_mandate +#: code:addons/account_banking_mandate/models/account_banking_mandate.py:140 +#, python-format +msgid "Mandate should be in draft or valid state" +msgstr "" + +#. module: account_banking_mandate +#: code:addons/account_banking_mandate/models/account_banking_mandate.py:131 +#, python-format +msgid "Mandate should be in draft state" +msgstr "" + +#. module: account_banking_mandate +#: field:account.banking.mandate,message_ids:0 +msgid "Messages" +msgstr "" + +#. module: account_banking_mandate +#: help:account.banking.mandate,message_ids:0 +msgid "Messages and communication history" +msgstr "" + +#. module: account_banking_mandate +#: help:account.banking.mandate,state:0 +msgid "Only valid mandates can be used in a payment line. A cancelled mandate is a mandate that has been cancelled by the customer." +msgstr "" + +#. module: account_banking_mandate +#: field:account.banking.mandate,partner_id:0 +msgid "Partner" +msgstr "" + +#. module: account_banking_mandate +#: model:ir.model,name:account_banking_mandate.model_payment_line +msgid "Payment Line" +msgstr "" + +#. module: account_banking_mandate +#: view:account.banking.mandate:account_banking_mandate.view_mandate_tree +msgid "Reference" +msgstr "" + +#. module: account_banking_mandate +#: view:account.banking.mandate:account_banking_mandate.view_mandate_form +#: field:account.banking.mandate,payment_line_ids:0 +msgid "Related Payment Lines" +msgstr "" + +#. module: account_banking_mandate +#: model:ir.ui.menu,name:account_banking_mandate.mandate_menu +msgid "SEPA Direct Debit Mandates" +msgstr "" + +#. module: account_banking_mandate +#: field:account.banking.mandate,scan:0 +msgid "Scan of the Mandate" +msgstr "" + +#. module: account_banking_mandate +#: view:account.banking.mandate:account_banking_mandate.view_mandate_search +msgid "Search Banking Mandates" +msgstr "" + +#. module: account_banking_mandate +#: view:account.banking.mandate:account_banking_mandate.view_mandate_tree +msgid "Signature Date" +msgstr "" + +#. module: account_banking_mandate +#: field:account.banking.mandate,state:0 +msgid "Status" +msgstr "" + +#. module: account_banking_mandate +#: field:account.banking.mandate,message_summary:0 +msgid "Summary" +msgstr "" + +#. module: account_banking_mandate +#: code:addons/account_banking_mandate/models/account_banking_mandate.py:92 +#, python-format +msgid "The date of signature of mandate '%s' is in the future !" +msgstr "" + +#. module: account_banking_mandate +#: code:addons/account_banking_mandate/models/account_banking_mandate.py:97 +#, python-format +msgid "The mandate '%s' can't have a date of last debit before the date of signature." +msgstr "" + +#. module: account_banking_mandate +#: code:addons/account_banking_mandate/models/payment_line.py:68 +#, 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 "" + +#. module: account_banking_mandate +#: field:account.banking.mandate,unique_mandate_reference:0 +msgid "Unique Mandate Reference" +msgstr "" + +#. module: account_banking_mandate +#: field:account.banking.mandate,message_unread:0 +msgid "Unread Messages" +msgstr "" + +#. module: account_banking_mandate +#: view:account.banking.mandate:account_banking_mandate.view_mandate_search +msgid "Valid" +msgstr "" + +#. module: account_banking_mandate +#: view:account.banking.mandate:account_banking_mandate.view_mandate_form +msgid "Validate" +msgstr "" + +#. module: account_banking_mandate +#: view:account.banking.mandate:account_banking_mandate.view_mandate_form +msgid "You should set a mandate back to draft only if you cancelled it by mistake. Do you want to continue?" +msgstr "" + diff --git a/account_banking_mandate/i18n/es.po b/account_banking_mandate/i18n/es.po new file mode 100644 index 000000000..567f167bd --- /dev/null +++ b/account_banking_mandate/i18n/es.po @@ -0,0 +1,360 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_banking_mandate +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-10-31 23:00+0000\n" +"PO-Revision-Date: 2014-10-31 23:00+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_mandate +#: model:ir.actions.act_window,help:account_banking_mandate.mandate_action +msgid "

\n" +" Click to create a new Banking Mandate.\n" +"

\n" +" A Banking Mandate is a document signed by your customer that gives you the autorization to do one or several operations on his bank account.\n" +"

\n" +" " +msgstr "

\n" +" Pulse para crear un nuevo mandato bancario.\n" +"

\n" +" Un mandato bancario es un documento firmado por su cliente que le da autorización a hacer una o varias operaciones en su cuenta bancaria.\n" +"

\n" +" " + +#. module: account_banking_mandate +#: sql_constraint:account.banking.mandate:0 +msgid "A Mandate with the same reference already exists for this company !" +msgstr "Ya existe un mandato con la misma referencia para esta compañía" + +#. module: account_banking_mandate +#: model:ir.model,name:account_banking_mandate.model_account_banking_mandate +msgid "A generic banking mandate" +msgstr "Un mandato bancario genérico" + +#. module: account_banking_mandate +#: view:account.banking.mandate:account_banking_mandate.view_mandate_form +msgid "Back to Draft" +msgstr "Volver a borrador" + +#. module: account_banking_mandate +#: field:account.banking.mandate,partner_bank_id:0 +msgid "Bank Account" +msgstr "Cuenta bancaria" + +#. module: account_banking_mandate +#: model:ir.model,name:account_banking_mandate.model_res_partner_bank +msgid "Bank Accounts" +msgstr "Cuentas bancarias" + +#. module: account_banking_mandate +#: view:account.banking.mandate:account_banking_mandate.view_mandate_form +#: view:account.banking.mandate:account_banking_mandate.view_mandate_tree +msgid "Banking Mandate" +msgstr "Mandato bancario" + +#. module: account_banking_mandate +#: model:mail.message.subtype,description:account_banking_mandate.mandate_cancel +msgid "Banking Mandate Cancelled" +msgstr "Mandato bancario cancelado" + +#. module: account_banking_mandate +#: model:mail.message.subtype,description:account_banking_mandate.mandate_valid +msgid "Banking Mandate Validated" +msgstr "Mandato bancario validado" + +#. module: account_banking_mandate +#: model:mail.message.subtype,description:account_banking_mandate.mandate_expired +msgid "Banking Mandate has Expired" +msgstr "El mandato bancario ha expirado" + +#. module: account_banking_mandate +#: model:ir.actions.act_window,name:account_banking_mandate.mandate_action +msgid "Banking Mandates" +msgstr "Mandatos bancarios" + +#. module: account_banking_mandate +#: help:res.partner.bank,mandate_ids:0 +msgid "Banking mandates represents an authorization that the bank account owner gives to a company for a specific operation" +msgstr "Los mandatos bancarios representan una autorización que el propietario de la cuenta bancaria da a la compañía para un operación específica" + +#. module: account_banking_mandate +#: view:account.banking.mandate:account_banking_mandate.view_mandate_form +msgid "Cancel" +msgstr "Cancelar" + +#. module: account_banking_mandate +#: view:account.banking.mandate:account_banking_mandate.view_mandate_search +msgid "Cancelled" +msgstr "Cancelado" + +#. module: account_banking_mandate +#: code:addons/account_banking_mandate/models/account_banking_mandate.py:110 +#, 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 +#, 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." + +#. module: account_banking_mandate +#: field:account.banking.mandate,company_id:0 +msgid "Company" +msgstr "Compañía" + +#. module: account_banking_mandate +#: field:account.banking.mandate,create_uid:0 +msgid "Created by" +msgstr "Creado por" + +#. module: account_banking_mandate +#: field:account.banking.mandate,create_date:0 +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 +msgid "DD Mandates" +msgstr "Mandatos bancarios" + +#. module: account_banking_mandate +#: field:account.banking.mandate,signature_date:0 +msgid "Date of Signature of the Mandate" +msgstr "Fecha de la firma del mandato" + +#. module: account_banking_mandate +#: field:account.banking.mandate,last_debit_date:0 +msgid "Date of the Last Debit" +msgstr "Fecha del último cobro" + +#. module: account_banking_mandate +#: help:account.banking.mandate,message_last_post:0 +msgid "Date of the last message posted on the record." +msgstr "Fecha del último mensaje publicado en el registro." + +#. module: account_banking_mandate +#: field:account.invoice,mandate_id:0 +#: field:payment.line,mandate_id:0 +msgid "Direct Debit Mandate" +msgstr "Mandato de adeudo directo" + +#. module: account_banking_mandate +#: view:res.partner.bank:account_banking_mandate.mandate_partner_bank_form +#: field:res.partner.bank,mandate_ids:0 +msgid "Direct Debit Mandates" +msgstr "Mandatos de adeudo directo" + +#. module: account_banking_mandate +#: view:account.banking.mandate:account_banking_mandate.view_mandate_search +msgid "Draft" +msgstr "Borrador" + +#. module: account_banking_mandate +#: view:account.banking.mandate:account_banking_mandate.view_mandate_search +msgid "Expired" +msgstr "Expirado" + +#. module: account_banking_mandate +#: field:account.banking.mandate,message_follower_ids:0 +msgid "Followers" +msgstr "Seguidores" + +#. module: account_banking_mandate +#: help:account.banking.mandate,message_summary:0 +msgid "Holds the Chatter summary (number of messages, ...). This summary is directly in html format in order to be inserted in kanban views." +msgstr "Contiene el resumen del chatter (nº de mensajes, ...). Este resumen está directamente en formato html para ser insertado en vistas kanban." + +#. module: account_banking_mandate +#: field:account.banking.mandate,id:0 +msgid "ID" +msgstr "ID" + +#. module: account_banking_mandate +#: help:account.banking.mandate,message_unread:0 +msgid "If checked new messages require your attention." +msgstr "Si está marcado, hay nuevos mensajes que requieren su atención" + +#. module: account_banking_mandate +#: model:ir.model,name:account_banking_mandate.model_account_invoice +msgid "Invoice" +msgstr "Factura" + +#. module: account_banking_mandate +#: field:account.banking.mandate,message_is_follower:0 +msgid "Is a Follower" +msgstr "Es un seguidor" + +#. module: account_banking_mandate +#: field:account.banking.mandate,message_last_post:0 +msgid "Last Message Date" +msgstr "Fecha del último mensaje" + +#. module: account_banking_mandate +#: field:account.banking.mandate,write_uid:0 +msgid "Last Updated by" +msgstr "Última actualización por" + +#. module: account_banking_mandate +#: field:account.banking.mandate,write_date:0 +msgid "Last Updated on" +msgstr "Última actualización en" + +#. module: account_banking_mandate +#: model:mail.message.subtype,name:account_banking_mandate.mandate_cancel +msgid "Mandate Cancelled" +msgstr "Mandato cancelado" + +#. module: account_banking_mandate +#: model:mail.message.subtype,name:account_banking_mandate.mandate_expired +msgid "Mandate Expired" +msgstr "Mandato expirado" + +#. module: account_banking_mandate +#: model:mail.message.subtype,name:account_banking_mandate.mandate_valid +msgid "Mandate Validated" +msgstr "Mandato validado" + +#. module: account_banking_mandate +#: code:addons/account_banking_mandate/models/account_banking_mandate.py:152 +#, 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 +#, 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 +#, python-format +msgid "Mandate should be in draft state" +msgstr "El mandato debe estar en estado borrador" + +#. module: account_banking_mandate +#: field:account.banking.mandate,message_ids:0 +msgid "Messages" +msgstr "Mensajes" + +#. module: account_banking_mandate +#: help:account.banking.mandate,message_ids:0 +msgid "Messages and communication history" +msgstr "Mensajes e historial de comunicación" + +#. module: account_banking_mandate +#: help:account.banking.mandate,state:0 +msgid "Only valid mandates can be used in a payment line. A cancelled mandate is a mandate that has been cancelled by the customer." +msgstr "Sólo se pueden usar mandatos validados en una línea de pago. Un mandato cancelado en un mandato que ha sido invalidado por el cliente." + +#. module: account_banking_mandate +#: field:account.banking.mandate,partner_id:0 +msgid "Partner" +msgstr "Empresa" + +#. module: account_banking_mandate +#: model:ir.model,name:account_banking_mandate.model_payment_line +msgid "Payment Line" +msgstr "Línea de pago" + +#. module: account_banking_mandate +#: view:account.banking.mandate:account_banking_mandate.view_mandate_tree +msgid "Reference" +msgstr "Referencia" + +#. module: account_banking_mandate +#: view:account.banking.mandate:account_banking_mandate.view_mandate_form +#: field:account.banking.mandate,payment_line_ids:0 +msgid "Related Payment Lines" +msgstr "Líneas de pago relacionadas" + +#. module: account_banking_mandate +#: model:ir.ui.menu,name:account_banking_mandate.mandate_menu +msgid "SEPA Direct Debit Mandates" +msgstr "Mandatos de adeudo directo SEPA" + +#. module: account_banking_mandate +#: field:account.banking.mandate,scan:0 +msgid "Scan of the Mandate" +msgstr "Escaneado del mandato" + +#. module: account_banking_mandate +#: view:account.banking.mandate:account_banking_mandate.view_mandate_search +msgid "Search Banking Mandates" +msgstr "Buscar mandatos bancarios" + +#. module: account_banking_mandate +#: view:account.banking.mandate:account_banking_mandate.view_mandate_tree +msgid "Signature Date" +msgstr "Fecha de firma" + +#. module: account_banking_mandate +#: field:account.banking.mandate,state:0 +msgid "Status" +msgstr "Estado" + +#. module: account_banking_mandate +#: field:account.banking.mandate,message_summary:0 +msgid "Summary" +msgstr "Resumen" + +#. module: account_banking_mandate +#: code:addons/account_banking_mandate/models/account_banking_mandate.py:92 +#, 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 +#, 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 +#, 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')." + +#. module: account_banking_mandate +#: field:account.banking.mandate,unique_mandate_reference:0 +msgid "Unique Mandate Reference" +msgstr "Referencia única del mandato" + +#. module: account_banking_mandate +#: field:account.banking.mandate,message_unread:0 +msgid "Unread Messages" +msgstr "Mensajes sin leer" + +#. module: account_banking_mandate +#: view:account.banking.mandate:account_banking_mandate.view_mandate_search +msgid "Valid" +msgstr "Válido" + +#. module: account_banking_mandate +#: view:account.banking.mandate:account_banking_mandate.view_mandate_form +msgid "Validate" +msgstr "Validar" + +#. module: account_banking_mandate +#: view:account.banking.mandate:account_banking_mandate.view_mandate_form +msgid "You should set a mandate back to draft only if you cancelled it by mistake. Do you want to continue?" +msgstr "Debe establecer un mandato de vuelta a borrador sólo si lo cancelo por error. ¿Desea continuar?" + diff --git a/account_banking_mandate/models/__init__.py b/account_banking_mandate/models/__init__.py new file mode 100644 index 000000000..480270819 --- /dev/null +++ b/account_banking_mandate/models/__init__.py @@ -0,0 +1,26 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Mandate module for openERP +# Copyright (C) 2014 Compassion CH (http://www.compassion.ch) +# @author: Cyril Sester , +# Alexis de Lattre +# +# 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 . +# +############################################################################## +from . import account_banking_mandate +from . import account_invoice +from . import res_partner_bank +from . import payment_line diff --git a/account_banking_mandate/models/account_banking_mandate.py b/account_banking_mandate/models/account_banking_mandate.py new file mode 100644 index 000000000..e8aaa89d9 --- /dev/null +++ b/account_banking_mandate/models/account_banking_mandate.py @@ -0,0 +1,154 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Mandate module for openERP +# Copyright (C) 2014 Compassion CH (http://www.compassion.ch) +# @author: Cyril Sester , +# Alexis de Lattre +# +# 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 . +# +############################################################################## + +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) + ''' + _name = 'account.banking.mandate' + _description = "A generic banking mandate" + _rec_name = 'unique_mandate_reference' + _inherit = ['mail.thread'] + _order = 'signature_date desc' + _track = { + 'state': { + 'account_banking_mandate.mandate_valid': ( + lambda self, cr, uid, obj, ctx=None: obj['state'] == 'valid'), + 'account_banking_mandate.mandate_expired': ( + lambda self, cr, uid, obj, ctx=None: + obj['state'] == 'expired'), + 'account_banking_mandate.mandate_cancel': ( + lambda self, cr, uid, obj, ctx=None: obj['state'] == 'cancel'), + }, + } + + def _get_states(self): + return [('draft', 'Draft'), + ('valid', 'Valid'), + ('expired', 'Expired'), + ('cancel', 'Cancelled')] + + partner_bank_id = fields.Many2one( + comodel_name='res.partner.bank', string='Bank Account', + track_visibility='onchange') + partner_id = fields.Many2one( + comodel_name='res.partner', related='partner_bank_id.partner_id', + string='Partner', store=True) + company_id = fields.Many2one( + comodel_name='res.company', string='Company', required=True, + default=lambda self: self.env['res.company']._company_default_get( + 'account.banking.mandate')) + unique_mandate_reference = fields.Char( + string='Unique Mandate Reference', track_visibility='always', + default='/') + signature_date = fields.Date(string='Date of Signature of the Mandate', + track_visibility='onchange') + scan = fields.Binary(string='Scan of the Mandate') + last_debit_date = fields.Date(string='Date of the Last Debit', + readonly=True) + state = fields.Selection( + _get_states, string='Status', default='draft', + help="Only valid mandates can be used in a payment line. A cancelled " + "mandate is a mandate that has been cancelled by the customer.") + payment_line_ids = fields.One2many( + comodel_name='payment.line', inverse_name='mandate_id', + string="Related Payment Lines") + + _sql_constraints = [( + 'mandate_ref_company_uniq', + 'unique(unique_mandate_reference, company_id)', + 'A Mandate with the same reference already exists for this company !')] + + @api.one + @api.constrains('signature_date', 'last_debit_date') + def _check_dates(self): + if (self.signature_date and + self.signature_date > fields.Date.context_today(self)): + raise exceptions.Warning( + _("The date of signature of mandate '%s' is in the future !") + % self.unique_mandate_reference) + if (self.signature_date and self.last_debit_date and + self.signature_date > self.last_debit_date): + raise exceptions.Warning( + _("The mandate '%s' can't have a date of last debit before " + "the date of signature.") % self.unique_mandate_reference) + + @api.one + @api.constrains('state', 'partner_bank_id') + def _check_valid_state(self): + if self.state == 'valid': + if not self.signature_date: + raise exceptions.Warning( + _("Cannot validate the mandate '%s' without a date of " + "signature.") % self.unique_mandate_reference) + if not self.partner_bank_id: + raise exceptions.Warning( + _("Cannot validate the mandate '%s' because it is not " + "attached to a bank account.") % + self.unique_mandate_reference) + + @api.model + def create(self, vals=None): + if vals.get('unique_mandate_reference', '/') == '/': + vals['unique_mandate_reference'] = \ + self.env['ir.sequence'].next_by_code('account.banking.mandate') + return super(AccountBankingMandate, self).create(vals) + + @api.one + @api.onchange('partner_bank_id') + def mandate_partner_bank_change(self): + self.partner_id = self.partner_bank_id.partner_id + + @api.multi + def validate(self): + for mandate in self: + if mandate.state != 'draft': + raise exceptions.Warning( + _('Mandate should be in draft state')) + self.write({'state': 'valid'}) + return True + + @api.multi + def cancel(self): + for mandate in self: + if mandate.state not in ('draft', 'valid'): + raise exceptions.Warning( + _('Mandate should be in draft or valid state')) + self.write({'state': 'cancel'}) + return True + + @api.multi + def back2draft(self): + """Allows to set the mandate back to the draft state. + This is for mandates cancelled by mistake. + """ + for mandate in self: + if mandate.state != 'cancel': + raise exceptions.Warning( + _('Mandate should be in cancel state')) + self.write({'state': 'draft'}) + return True diff --git a/account_banking_mandate/models/account_invoice.py b/account_banking_mandate/models/account_invoice.py new file mode 100644 index 000000000..a4e43eba6 --- /dev/null +++ b/account_banking_mandate/models/account_invoice.py @@ -0,0 +1,33 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Mandate module for openERP +# Copyright (C) 2014 Compassion CH (http://www.compassion.ch) +# @author: Cyril Sester , +# Alexis de Lattre +# +# 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 . +# +############################################################################## + +from openerp import models, fields + + +class AccountInvoice(models.Model): + _inherit = 'account.invoice' + + mandate_id = fields.Many2one( + 'account.banking.mandate', string='Direct Debit Mandate', + domain=[('state', '=', 'valid')], readonly=True, + states={'draft': [('readonly', False)]}) diff --git a/account_banking_mandate/models/payment_line.py b/account_banking_mandate/models/payment_line.py new file mode 100644 index 000000000..5a975869f --- /dev/null +++ b/account_banking_mandate/models/payment_line.py @@ -0,0 +1,76 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Mandate module for openERP +# Copyright (C) 2014 Compassion CH (http://www.compassion.ch) +# @author: Cyril Sester , +# Alexis de Lattre +# +# 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 . +# +############################################################################## + +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.multi + 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])) diff --git a/account_banking_mandate/models/res_partner_bank.py b/account_banking_mandate/models/res_partner_bank.py new file mode 100644 index 000000000..ecb1e944c --- /dev/null +++ b/account_banking_mandate/models/res_partner_bank.py @@ -0,0 +1,34 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Mandate module for openERP +# Copyright (C) 2014 Compassion CH (http://www.compassion.ch) +# @author: Cyril Sester , +# Alexis de Lattre +# +# 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 . +# +############################################################################## + +from openerp import models, fields + + +class ResPartnerBank(models.Model): + _inherit = 'res.partner.bank' + + mandate_ids = fields.One2many( + comodel_name='account.banking.mandate', inverse_name='partner_bank_id', + string='Direct Debit Mandates', + help='Banking mandates represents an authorization that the bank ' + 'account owner gives to a company for a specific operation') diff --git a/account_banking_mandate/security/ir.model.access.csv b/account_banking_mandate/security/ir.model.access.csv new file mode 100644 index 000000000..f89130b3f --- /dev/null +++ b/account_banking_mandate/security/ir.model.access.csv @@ -0,0 +1,3 @@ +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_account_banking_mandate","Full access on account.banking.mandate","model_account_banking_mandate","account_payment.group_account_payment",1,1,1,1 +"access_account_banking_mandate_read","Read access on account.banking.mandate","model_account_banking_mandate","base.group_user",1,0,0,0 \ No newline at end of file diff --git a/account_banking_mandate/test/banking_mandate.yml b/account_banking_mandate/test/banking_mandate.yml new file mode 100644 index 000000000..d7291cc99 --- /dev/null +++ b/account_banking_mandate/test/banking_mandate.yml @@ -0,0 +1,36 @@ +- + In order to test mandate, I create a partner with a bank account. + Then, I create a mandate, validate it, cancel it and the set it back to draft + + I create a partner +- + !record {model: res.partner, id: mandate_partner, view: False}: + name: "Mandate test" +- + I create a partner bank account +- + !record {model: res.partner.bank, id: mandate_partner_bank, view: False}: + state: 'bank' + acc_number: '1234' + partner_id: mandate_partner +- + I create a mandate on 1st January +- + !record {model: account.banking.mandate, id: test_mandate, view: False}: + partner_bank_id: mandate_partner_bank + signature_date: "2014-01-01" + +- + I check that the state field is automatically set by default +- + !assert {model: account.banking.mandate, id: test_mandate}: + - state == 'draft' +- + I go through all states by clicking on buttons and check that cancel state is reached +- + !python {model: account.banking.mandate}: | + self.validate(cr, uid, [ref('test_mandate')]) + self.cancel(cr, uid, [ref('test_mandate')]) + mandate = self.browse(cr, uid, ref('test_mandate')) + assert mandate.state == 'cancel', 'Mandate is not in cancel state' + self.back2draft(cr, uid, [ref('test_mandate')]) diff --git a/account_banking_mandate/views/account_banking_mandate_view.xml b/account_banking_mandate/views/account_banking_mandate_view.xml new file mode 100644 index 000000000..6435da6b0 --- /dev/null +++ b/account_banking_mandate/views/account_banking_mandate_view.xml @@ -0,0 +1,122 @@ + + + + + + view.mandate.form + account.banking.mandate + +
+
+
+ +
+

+ +

+
+ + + + + + + + + + + +
+
+ + +
+
+
+
+ + + view.mandate.tree + account.banking.mandate + + + + + + + + + + + + + + view.mandate.search + account.banking.mandate + + + + + + + + + + + + + Banking Mandates + account.banking.mandate + form + tree,form + +

+ Click to create a new Banking Mandate. +

+ A Banking Mandate is a document signed by your customer that gives you the autorization to do one or several operations on his bank account. +

+
+
+ + + + + + Mandate Validated + account.banking.mandate + + Banking Mandate Validated + + + + Mandate Expired + account.banking.mandate + + Banking Mandate has Expired + + + + Mandate Cancelled + account.banking.mandate + + Banking Mandate Cancelled + +
+
diff --git a/__unported__/account_banking_sepa_direct_debit/account_invoice_view.xml b/account_banking_mandate/views/account_invoice_view.xml similarity index 69% rename from __unported__/account_banking_sepa_direct_debit/account_invoice_view.xml rename to account_banking_mandate/views/account_invoice_view.xml index 2ca480e54..a21e83857 100644 --- a/__unported__/account_banking_sepa_direct_debit/account_invoice_view.xml +++ b/account_banking_mandate/views/account_invoice_view.xml @@ -8,12 +8,12 @@ - add.sdd.mandate.on.customer.invoice.form + add.mandate.on.customer.invoice.form account.invoice - + diff --git a/__unported__/account_banking_sepa_direct_debit/account_payment_view.xml b/account_banking_mandate/views/account_payment_view.xml similarity index 59% rename from __unported__/account_banking_sepa_direct_debit/account_payment_view.xml rename to account_banking_mandate/views/account_payment_view.xml index 74098c44e..39ec86953 100644 --- a/__unported__/account_banking_sepa_direct_debit/account_payment_view.xml +++ b/account_banking_mandate/views/account_payment_view.xml @@ -7,17 +7,17 @@ - - sdd.payment.order.form + + mandate.payment.order.form payment.order - + - + diff --git a/__unported__/account_banking_sepa_direct_debit/res_partner_bank_view.xml b/account_banking_mandate/views/res_partner_bank_view.xml similarity index 60% rename from __unported__/account_banking_sepa_direct_debit/res_partner_bank_view.xml rename to account_banking_mandate/views/res_partner_bank_view.xml index 0b32e9f1c..572fa766e 100644 --- a/__unported__/account_banking_sepa_direct_debit/res_partner_bank_view.xml +++ b/account_banking_mandate/views/res_partner_bank_view.xml @@ -7,39 +7,39 @@ - - sdd.mandate.res.partner.bank.form + + mandate.res.partner.bank.form res.partner.bank - - + + - - sdd.mandate.res.partner.bank.tree + + mandate.res.partner.bank.tree res.partner.bank - + - - sdd.mandate.partner.form + + mandate.partner.form res.partner - + diff --git a/__unported__/account_payment_sale/model/__init__.py b/account_banking_pain_base/__init__.py similarity index 82% rename from __unported__/account_payment_sale/model/__init__.py rename to account_banking_pain_base/__init__.py index 079ae1b71..b69a01a1b 100644 --- a/__unported__/account_payment_sale/model/__init__.py +++ b/account_banking_pain_base/__init__.py @@ -1,9 +1,9 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Account Payment Sale module for OpenERP -# Copyright (C) 2014 Akretion (http://www.akretion.com) -# @author Alexis de Lattre +# PAIN Base module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -20,4 +20,4 @@ # ############################################################################## -from . import sale +from . import models diff --git a/__unported__/account_banking_pain_base/__openerp__.py b/account_banking_pain_base/__openerp__.py similarity index 85% rename from __unported__/account_banking_pain_base/__openerp__.py rename to account_banking_pain_base/__openerp__.py index 23e345e85..0d8030dc6 100644 --- a/__unported__/account_banking_pain_base/__openerp__.py +++ b/account_banking_pain_base/__openerp__.py @@ -26,15 +26,16 @@ 'license': 'AGPL-3', 'author': 'Akretion, Noviat', 'website': 'http://openerp-community-association.org/', + 'contributors': ['Pedro M. Baeza '], 'category': 'Hidden', 'depends': ['account_banking_payment_export'], 'external_dependencies': { 'python': ['unidecode', 'lxml'], - }, + }, 'data': [ - 'payment_line_view.xml', - 'payment_mode_view.xml', - 'company_view.xml', + 'views/payment_line_view.xml', + 'views/payment_mode_view.xml', + 'views/res_company_view.xml', ], 'description': ''' Base module for PAIN file generation @@ -43,14 +44,10 @@ Base module for PAIN file generation This module contains fields and functions that are used by the module for SEPA Credit Transfer (account_banking_sepa_credit_transfer) and SEPA Direct Debit (account_banking_sepa_direct_debit). This module doesn't provide any -functionnality by itself. +functionality by itself. -This module is part of the banking addons: - https://www.github.com/OCA/banking-addons - -This module was started during the Akretion-Noviat code sprint of -November 21st 2013 in Epiais les Louvres (France). +This module was started during the Akretion-Noviat code sprint of November +21st 2013 in Epiais les Louvres (France). ''', - 'active': False, - 'installable': False, + 'installable': True, } diff --git a/__unported__/account_banking_pain_base/i18n/account_banking_pain_base.pot b/account_banking_pain_base/i18n/account_banking_pain_base.pot similarity index 63% rename from __unported__/account_banking_pain_base/i18n/account_banking_pain_base.pot rename to account_banking_pain_base/i18n/account_banking_pain_base.pot index d4a7dbac5..3430bda2b 100644 --- a/__unported__/account_banking_pain_base/i18n/account_banking_pain_base.pot +++ b/account_banking_pain_base/i18n/account_banking_pain_base.pot @@ -1,13 +1,13 @@ -# Translation of OpenERP Server. +# Translation of Odoo Server. # This file contains the translation of the following modules: # * account_banking_pain_base # msgid "" msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" +"Project-Id-Version: Odoo Server 8.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-12-23 21:26+0000\n" -"PO-Revision-Date: 2013-12-23 21:26+0000\n" +"POT-Creation-Date: 2014-10-31 22:52+0000\n" +"PO-Revision-Date: 2014-10-31 22:52+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -15,20 +15,80 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:74 +#, python-format +msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:80 +#, python-format +msgid "Cannot compute the '%s'." +msgstr "" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_res_company +msgid "Companies" +msgstr "" + +#. module: account_banking_pain_base +#: field:payment.mode,convert_to_ascii:0 +msgid "Convert to ASCII" +msgstr "" + +#. 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 +#, python-format +msgid "Error:" +msgstr "" + +#. 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" +msgstr "" + +#. module: account_banking_pain_base +#: field:banking.export.pain,id:0 +msgid "ID" +msgstr "" + +#. module: account_banking_pain_base +#: help:payment.mode,convert_to_ascii:0 +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 "" + #. module: account_banking_pain_base #: field:res.company,initiating_party_issuer:0 msgid "Initiating Party Issuer" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:122 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:386 #, 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" +msgid "Missing 'Structured Communication Type' on payment line with reference '%s'." msgstr "" #. module: account_banking_pain_base -#: field:payment.line,priority:0 -msgid "Priority" +#: selection:payment.line,priority:0 +msgid "Normal" +msgstr "" + +#. module: account_banking_pain_base +#: view:res.company:account_banking_pain_base.view_company_form +msgid "Payment Initiation" msgstr "" #. module: account_banking_pain_base @@ -42,65 +102,8 @@ msgid "Payment Mode" msgstr "" #. 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 OpenERP." -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:351 -#, python-format -msgid "Missing 'Structured Communication Type' on payment line with reference '%s'." -msgstr "" - -#. module: account_banking_pain_base -#: selection:payment.line,priority:0 -msgid "Normal" -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:70 -#, python-format -msgid "Cannot compute the '%s' of the Payment Line with reference '%s'." -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:77 -#, python-format -msgid "Cannot compute the '%s'." -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:81 -#, python-format -msgid "The type of the field '%s' is %s. It should be a string or unicode." -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:47 -#: code:addons/account_banking_pain_base/banking_export_pain.py:69 -#: code:addons/account_banking_pain_base/banking_export_pain.py:76 -#: code:addons/account_banking_pain_base/banking_export_pain.py:86 -#: code:addons/account_banking_pain_base/banking_export_pain.py:121 -#: code:addons/account_banking_pain_base/banking_export_pain.py:350 -#, python-format -msgid "Error:" -msgstr "" - -#. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_res_company -msgid "Companies" -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:47 -#, python-format -msgid "This IBAN is not valid : %s" -msgstr "" - -#. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:80 -#, python-format -msgid "Field type error:" +#: field:payment.line,priority:0 +msgid "Priority" msgstr "" #. module: account_banking_pain_base @@ -109,19 +112,33 @@ msgid "Structured Communication Type" msgstr "" #. module: account_banking_pain_base -#: code:addons/account_banking_pain_base/banking_export_pain.py:87 +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:90 #, python-format msgid "The '%s' is empty or 0. It should have a non-null value." msgstr "" #. module: account_banking_pain_base -#: model:ir.model,name:account_banking_pain_base.model_banking_export_pain -msgid "banking.export.pain" +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:304 +#, 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 "" #. module: account_banking_pain_base -#: help:payment.mode,convert_to_ascii:0 -msgid "If active, OpenERP will convert each accented caracter to the corresponding unaccented caracter, so that only ASCII caracters are used in the generated PAIN file." +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:125 +#, 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 "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:84 +#, python-format +msgid "The type of the field '%s' is %s. It should be a string or unicode." +msgstr "" + +#. module: account_banking_pain_base +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:47 +#, python-format +msgid "This IBAN is not valid : %s" msgstr "" #. module: account_banking_pain_base @@ -130,17 +147,7 @@ msgid "This field will be used as the 'Instruction Priority' in the generated PA msgstr "" #. module: account_banking_pain_base -#: view:res.company:0 -msgid "Payment Initiation" -msgstr "" - -#. module: account_banking_pain_base -#: selection:payment.line,priority:0 -msgid "High" -msgstr "" - -#. module: account_banking_pain_base -#: field:payment.mode,convert_to_ascii:0 -msgid "Convert to ASCII" +#: help:res.company,initiating_party_issuer:0 +msgid "This will be used as the 'Initiating Party Issuer' in the PAIN files generated by Odoo." msgstr "" diff --git a/account_banking_pain_base/i18n/es.po b/account_banking_pain_base/i18n/es.po new file mode 100644 index 000000000..61fa1e0ba --- /dev/null +++ b/account_banking_pain_base/i18n/es.po @@ -0,0 +1,153 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_banking_pain_base +# +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" +"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_pain_base +#: code:addons/account_banking_pain_base/models/banking_export_pain.py:74 +#, 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 +#, python-format +msgid "Cannot compute the '%s'." +msgstr "No se puede procesar el campo '%s'." + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_res_company +msgid "Companies" +msgstr "Compañías" + +#. module: account_banking_pain_base +#: field:payment.mode,convert_to_ascii:0 +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 +#, 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" +msgstr "Alta" + +#. module: account_banking_pain_base +#: field:banking.export.pain,id:0 +msgid "ID" +msgstr "ID" + +#. module: account_banking_pain_base +#: help:payment.mode,convert_to_ascii:0 +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_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 +#, 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'." + +#. module: account_banking_pain_base +#: selection:payment.line,priority:0 +msgid "Normal" +msgstr "Normal" + +#. module: account_banking_pain_base +#: view:res.company:account_banking_pain_base.view_company_form +msgid "Payment Initiation" +msgstr "Iniciación del pago" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_payment_line +msgid "Payment Line" +msgstr "Línea de pago" + +#. module: account_banking_pain_base +#: model:ir.model,name:account_banking_pain_base.model_payment_mode +msgid "Payment Mode" +msgstr "Modo de pago" + +#. module: account_banking_pain_base +#: field:payment.line,priority:0 +msgid "Priority" +msgstr "Prioridad" + +#. 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 +#, 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 +#, 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 +#, 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 +#, 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 +#, python-format +msgid "This IBAN is not valid : %s" +msgstr "Este IBAN no es válido: %s" + +#. module: account_banking_pain_base +#: help:payment.line,priority:0 +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_issuer:0 +msgid "This will be used as the 'Initiating Party Issuer' in the PAIN files generated by Odoo." +msgstr "Este campo se usará como 'Emisor de la transacción' en los archivos PAIN generados por Odoo." + diff --git a/__unported__/account_banking_pain_base/i18n/fr.po b/account_banking_pain_base/i18n/fr.po similarity index 100% rename from __unported__/account_banking_pain_base/i18n/fr.po rename to account_banking_pain_base/i18n/fr.po diff --git a/__unported__/account_banking_pain_base/i18n/nl.po b/account_banking_pain_base/i18n/nl.po similarity index 100% rename from __unported__/account_banking_pain_base/i18n/nl.po rename to account_banking_pain_base/i18n/nl.po diff --git a/__unported__/account_banking_pain_base/__init__.py b/account_banking_pain_base/models/__init__.py similarity index 97% rename from __unported__/account_banking_pain_base/__init__.py rename to account_banking_pain_base/models/__init__.py index 6662843e6..f1e6551bf 100644 --- a/__unported__/account_banking_pain_base/__init__.py +++ b/account_banking_pain_base/models/__init__.py @@ -22,5 +22,5 @@ from . import payment_line from . import payment_mode -from . import company +from . import res_company from . import banking_export_pain diff --git a/__unported__/account_banking_pain_base/banking_export_pain.py b/account_banking_pain_base/models/banking_export_pain.py similarity index 96% rename from __unported__/account_banking_pain_base/banking_export_pain.py rename to account_banking_pain_base/models/banking_export_pain.py index 279dc5f5a..0a9e3713a 100644 --- a/__unported__/account_banking_pain_base/banking_export_pain.py +++ b/account_banking_pain_base/models/banking_export_pain.py @@ -33,12 +33,12 @@ import base64 logger = logging.getLogger(__name__) -class banking_export_pain(orm.AbstractModel): +class BankingExportPain(orm.AbstractModel): _name = 'banking.export.pain' def _validate_iban(self, cr, uid, iban, context=None): - '''if IBAN is valid, returns IBAN - if IBAN is NOT valid, raises an error message''' + """if IBAN is valid, returns IBAN + if IBAN is NOT valid, raises an error message""" partner_bank_obj = self.pool.get('res.partner.bank') if partner_bank_obj.is_iban_valid(cr, uid, iban, context=context): return iban.replace(' ', '') @@ -46,10 +46,9 @@ class banking_export_pain(orm.AbstractModel): raise orm.except_orm( _('Error:'), _("This IBAN is not valid : %s") % iban) - def _prepare_field( - self, cr, uid, field_name, field_value, eval_ctx, max_size=0, - gen_args=None, context=None): - '''This function is designed to be inherited !''' + def _prepare_field(self, cr, uid, field_name, field_value, eval_ctx, + max_size=0, gen_args=None, context=None): + """This function is designed to be inherited !""" if gen_args is None: gen_args = {} assert isinstance(eval_ctx, dict), 'eval_ctx must contain a dict' @@ -163,7 +162,7 @@ class banking_export_pain(orm.AbstractModel): 'res_model': self._name, 'res_id': ids[0], 'target': 'new', - } + } return action def generate_group_header_block( @@ -210,6 +209,8 @@ class banking_export_pain(orm.AbstractModel): gen_args=gen_args, context=context) payment_method_2_2 = etree.SubElement(payment_info_2_0, 'PmtMtd') payment_method_2_2.text = gen_args['payment_method'] + nb_of_transactions_2_4 = False + control_sum_2_5 = False if gen_args.get('pain_flavor') != 'pain.001.001.02': batch_booking_2_3 = etree.SubElement(payment_info_2_0, 'BtchBookg') batch_booking_2_3.text = \ @@ -282,8 +283,8 @@ class banking_export_pain(orm.AbstractModel): def generate_party_agent( self, cr, uid, parent_node, party_type, party_type_label, order, party_name, iban, bic, eval_ctx, gen_args, context=None): - '''Generate the piece of the XML file corresponding to BIC - This code is mutualized between TRF and DD''' + """Generate the piece of the XML file corresponding to BIC + This code is mutualized between TRF and DD""" assert order in ('B', 'C'), "Order can be 'B' or 'C'" try: bic = self._prepare_field( @@ -323,8 +324,8 @@ class banking_export_pain(orm.AbstractModel): def generate_party_block( self, cr, uid, parent_node, party_type, order, name, iban, bic, eval_ctx, gen_args, context=None): - '''Generate the piece of the XML file corresponding to Name+IBAN+BIC - This code is mutualized between TRF and DD''' + """Generate the piece of the XML file corresponding to Name+IBAN+BIC + This code is mutualized between TRF and DD""" assert order in ('B', 'C'), "Order can be 'B' or 'C'" if party_type == 'Cdtr': party_type_label = 'Creditor' @@ -384,7 +385,7 @@ class banking_export_pain(orm.AbstractModel): _('Error:'), _("Missing 'Structured Communication Type' on payment " "line with reference '%s'.") - % (line.name)) + % line.name) remittance_info_structured_2_100 = etree.SubElement( remittance_info_2_91, 'Strd') creditor_ref_information_2_120 = etree.SubElement( @@ -424,9 +425,8 @@ class banking_export_pain(orm.AbstractModel): def generate_creditor_scheme_identification( self, cr, uid, parent_node, identification, identification_label, eval_ctx, scheme_name_proprietary, gen_args, context=None): - csi_id = etree.SubElement( - parent_node, 'Id') - csi_privateid = csi_id = etree.SubElement(csi_id, 'PrvtId') + csi_id = etree.SubElement(parent_node, 'Id') + csi_privateid = etree.SubElement(csi_id, 'PrvtId') csi_other = etree.SubElement(csi_privateid, 'Othr') csi_other_id = etree.SubElement(csi_other, 'Id') csi_other_id.text = self._prepare_field( diff --git a/__unported__/account_banking_pain_base/payment_line.py b/account_banking_pain_base/models/payment_line.py similarity index 90% rename from __unported__/account_banking_pain_base/payment_line.py rename to account_banking_pain_base/models/payment_line.py index 0dffbcf42..0598710e1 100644 --- a/__unported__/account_banking_pain_base/payment_line.py +++ b/account_banking_pain_base/models/payment_line.py @@ -23,19 +23,18 @@ from openerp.osv import orm, fields -class payment_line(orm.Model): +class PaymentLine(orm.Model): _inherit = 'payment.line' def _get_struct_communication_types(self, cr, uid, context=None): return [('ISO', 'ISO')] _columns = { - 'priority': fields.selection([ - ('NORM', 'Normal'), - ('HIGH', 'High'), - ], 'Priority', + 'priority': fields.selection( + [('NORM', 'Normal'), + ('HIGH', 'High')], 'Priority', help="This field will be used as the 'Instruction Priority' in " - "the generated PAIN file."), + "the generated PAIN file."), # Update size from 64 to 140, because PAIN allows 140 caracters 'communication': fields.char( 'Communication', size=140, required=True, diff --git a/__unported__/account_banking_pain_base/payment_mode.py b/account_banking_pain_base/models/payment_mode.py similarity index 94% rename from __unported__/account_banking_pain_base/payment_mode.py rename to account_banking_pain_base/models/payment_mode.py index 540d01b67..ff9254ca0 100644 --- a/__unported__/account_banking_pain_base/payment_mode.py +++ b/account_banking_pain_base/models/payment_mode.py @@ -29,7 +29,7 @@ class payment_mode(orm.Model): _columns = { 'convert_to_ascii': fields.boolean( 'Convert to ASCII', - help="If active, OpenERP will convert each accented caracter to " + help="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."), } diff --git a/__unported__/account_banking_pain_base/company.py b/account_banking_pain_base/models/res_company.py similarity index 92% rename from __unported__/account_banking_pain_base/company.py rename to account_banking_pain_base/models/res_company.py index 222786c27..182327f8a 100644 --- a/__unported__/account_banking_pain_base/company.py +++ b/account_banking_pain_base/models/res_company.py @@ -25,22 +25,22 @@ from openerp.osv import orm, fields -class res_company(orm.Model): +class ResCompany(orm.Model): _inherit = 'res.company' _columns = { 'initiating_party_issuer': fields.char( 'Initiating Party Issuer', size=35, help="This will be used as the 'Initiating Party Issuer' in the " - "PAIN files generated by OpenERP."), + "PAIN files generated by Odoo."), } def _get_initiating_party_identifier( self, cr, uid, company_id, context=None): - '''The code here may be different from one country to another. + """The code here may be different from one country to another. If you need to add support for an additionnal country, you can contribute your code here or inherit this function in the - localization modules for your country''' + localization modules for your country""" assert isinstance(company_id, int), 'Only one company ID' company = self.browse(cr, uid, company_id, context=context) company_vat = company.vat @@ -54,10 +54,10 @@ class res_company(orm.Model): return party_identifier def _initiating_party_issuer_default(self, cr, uid, context=None): - '''If you need to add support for an additionnal country, you can + """If you need to add support for an additionnal country, you can add an entry in the dict "party_issuer_per_country" here or inherit this function in the localization modules for - your country''' + your country""" initiating_party_issuer = '' # If your country require the 'Initiating Party Issuer', you should # contribute the entry for your country in the dict below diff --git a/__unported__/account_banking_pain_base/payment_line_view.xml b/account_banking_pain_base/views/payment_line_view.xml similarity index 100% rename from __unported__/account_banking_pain_base/payment_line_view.xml rename to account_banking_pain_base/views/payment_line_view.xml diff --git a/__unported__/account_banking_pain_base/payment_mode_view.xml b/account_banking_pain_base/views/payment_mode_view.xml similarity index 100% rename from __unported__/account_banking_pain_base/payment_mode_view.xml rename to account_banking_pain_base/views/payment_mode_view.xml diff --git a/__unported__/account_banking_pain_base/company_view.xml b/account_banking_pain_base/views/res_company_view.xml similarity index 100% rename from __unported__/account_banking_pain_base/company_view.xml rename to account_banking_pain_base/views/res_company_view.xml diff --git a/account_banking_payment_export/__init__.py b/account_banking_payment_export/__init__.py new file mode 100644 index 000000000..408a6001b --- /dev/null +++ b/account_banking_payment_export/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- +from . import models +from . import wizard diff --git a/__unported__/account_banking_payment_export/__openerp__.py b/account_banking_payment_export/__openerp__.py similarity index 56% rename from __unported__/account_banking_payment_export/__openerp__.py rename to account_banking_payment_export/__openerp__.py index 9a4317b59..8b8369136 100644 --- a/__unported__/account_banking_payment_export/__openerp__.py +++ b/account_banking_payment_export/__openerp__.py @@ -34,7 +34,7 @@ 'depends': [ 'account_payment', 'base_iban', # for manual_bank_tranfer - ], + ], 'conflicts': [ # lp:account-payment/account_payment_extension also adds # a type field to payment.mode, with a very similar purpose. @@ -44,46 +44,44 @@ # Proposal to resolve: make account_payment_extension depend # on the present account_banking_payment_export module. 'account_payment_extension', - ], + ], 'data': [ - 'view/account_payment.xml', - 'view/bank_payment_manual.xml', - 'view/payment_mode.xml', - 'view/payment_mode_type.xml', - 'view/payment_order_create_view.xml', + 'views/account_payment.xml', + 'views/payment_mode.xml', + 'views/payment_mode_type.xml', + 'wizard/bank_payment_manual.xml', + 'wizard/payment_order_create_view.xml', 'data/payment_mode_type.xml', 'security/ir.model.access.csv', ], 'demo': ['demo/banking_demo.xml'], 'description': ''' - Infrastructure to export payment orders - plus some bug fixes and obvious enhancements to payment orders - that will hopefully land in offical addons one day. +Infrastructure to export payment orders plus some bug fixes and obvious +enhancements to payment orders that will hopefully land in offical addons one +day. - This technical module provides the base infrastructure to export - payment orders for electronic banking. It provides the following - technical features: - * a new payment.mode.type model - * payment.mode now has a mandatory type - * a better implementation of payment_mode.suitable_bank_types() based - on payment.mode.type - * the "make payment" button launches a wizard depending on the - payment.mode.type - * a manual payment mode type is provided as an example, with a default - "do nothing" wizard +This technical module provides the base infrastructure to export payment orders +for electronic banking. It provides the following technical features: - To enable the use of payment order to collect money for customers, - it adds a payment_order_type (payment|debit) as a basis of direct debit - support (this field becomes visible when account_direct_debit is - installed). - Refactoring note: this field should ideally go in account_direct_debit, - but account_banking_payment currently depends on it. +* a new payment.mode.type model +* payment.mode now has a mandatory type +* a better implementation of payment_mode.suitable_bank_types() based on + payment.mode.type +* the "make payment" button launches a wizard depending on the + payment.mode.type +* a manual payment mode type is provided as an example, with a default "do + nothing" wizard - Bug fixes and enhancement that should land in official addons: - * make the search function of the payment export wizard extensible - * fix lp:1275478: allow payment of customer refunds - * display the maturity date of the move lines when you are in - the wizard to select the lines to pay -''', - 'installable': False, +To enable the use of payment order to collect money for customers, +it adds a payment_order_type (payment|debit) as a basis of direct debit support +(this field becomes visible when account_direct_debit is installed). +Refactoring note: this field should ideally go in account_direct_debit, +but account_banking_payment currently depends on it. + +Bug fixes and enhancement that should land in official addons: + +* make the search function of the payment export wizard extensible +* fix lp:1275478: allow payment of customer refunds + ''', + 'installable': True, } diff --git a/__unported__/account_banking_payment_export/data/payment_mode_type.xml b/account_banking_payment_export/data/payment_mode_type.xml similarity index 90% rename from __unported__/account_banking_payment_export/data/payment_mode_type.xml rename to account_banking_payment_export/data/payment_mode_type.xml index c1e4a4abd..876778e62 100644 --- a/__unported__/account_banking_payment_export/data/payment_mode_type.xml +++ b/account_banking_payment_export/data/payment_mode_type.xml @@ -9,6 +9,7 @@ eval="[(6,0,[ref('base.bank_normal'),ref('base_iban.bank_iban'),])]" /> + payment diff --git a/__unported__/account_banking_payment_export/demo/banking_demo.xml b/account_banking_payment_export/demo/banking_demo.xml similarity index 94% rename from __unported__/account_banking_payment_export/demo/banking_demo.xml rename to account_banking_payment_export/demo/banking_demo.xml index fd29e4c51..b11367bb8 100644 --- a/__unported__/account_banking_payment_export/demo/banking_demo.xml +++ b/account_banking_payment_export/demo/banking_demo.xml @@ -57,6 +57,10 @@ FTNOFRP1XXX + + + + Credit Trf Banque Postale diff --git a/account_banking_payment_export/i18n/account_banking_payment_export.pot b/account_banking_payment_export/i18n/account_banking_payment_export.pot new file mode 100644 index 000000000..a51bcd871 --- /dev/null +++ b/account_banking_payment_export/i18n/account_banking_payment_export.pot @@ -0,0 +1,236 @@ +# 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: 2014-10-31 22:52+0000\n" +"PO-Revision-Date: 2014-10-31 22:52+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 +#: field:payment.mode,sale_ok:0 +msgid "Selectable on sale operations" +msgstr "" + +#. module: account_banking_payment_export +#: field:payment.mode,purchase_ok:0 +msgid "Selectable on purchase operations" +msgstr "" + +#. module: account_banking_payment_export +#: field:account.move.line,amount_to_pay:0 +msgid "Amount to pay" +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:77 +#, 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_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 +#: 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:169 +#, 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 +#: 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 +#: 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 +#: 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 "" diff --git a/account_banking_payment_export/i18n/es.po b/account_banking_payment_export/i18n/es.po new file mode 100644 index 000000000..e5e0afdbe --- /dev/null +++ b/account_banking_payment_export/i18n/es.po @@ -0,0 +1,236 @@ +# 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: 2014-10-31 22:52+0000\n" +"PO-Revision-Date: 2014-10-31 22:52+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 "Activo" + +#. module: account_banking_payment_export +#: field:payment.mode,sale_ok:0 +msgid "Selectable on sale operations" +msgstr "Seleccionable en operaciones de venta" + +#. module: account_banking_payment_export +#: field:payment.mode,purchase_ok:0 +msgid "Selectable on purchase operations" +msgstr "Seleccionable en operaciones de compra" + +#. module: account_banking_payment_export +#: field:account.move.line,amount_to_pay:0 +msgid "Amount to pay" +msgstr "Importe a pagar" + +#. module: account_banking_payment_export +#: view:payment.manual:account_banking_payment_export.view_payment_manual_form +msgid "Cancel" +msgstr "Cancelar" + +#. module: account_banking_payment_export +#: field:payment.mode.type,code:0 +msgid "Code" +msgstr "Código" + +#. module: account_banking_payment_export +#: 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:payment.manual,create_date:0 +#: field:payment.mode.type,create_date:0 +msgid "Created on" +msgstr "Creado en" + +#. module: account_banking_payment_export +#: selection:payment.mode.type,payment_order_type:0 +msgid "Debit" +msgstr "Cobro" + +#. module: account_banking_payment_export +#: selection:payment.order,payment_order_type:0 +msgid "Direct debit" +msgstr "Adeudo directo (cobro)" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/wizard/payment_order_create.py:77 +#, 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 +#, python-format +msgid "Error" +msgstr "Error" + +#. module: account_banking_payment_export +#: field:payment.mode,type:0 +msgid "Export type" +msgstr "Tipo de exportación" + +#. module: account_banking_payment_export +#: field:payment.manual,id:0 +#: field:payment.mode.type,id:0 +msgid "ID" +msgstr "ID" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_account_move_line +msgid "Journal Items" +msgstr "Asientos contables" + +#. module: account_banking_payment_export +#: 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: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 +#: view:payment.manual:account_banking_payment_export.view_payment_manual_form +msgid "Manual payment" +msgstr "Pago manual" + +#. module: account_banking_payment_export +#: field:payment.mode.type,name:0 +msgid "Name" +msgstr "Nombre" + +#. 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 +#: selection:payment.mode.type,payment_order_type:0 +#: selection:payment.order,payment_order_type:0 +msgid "Payment" +msgstr "Pago" + +#. 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 "Tipos de exportación de pagos" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_mode +msgid "Payment Mode" +msgstr "Modo de pago" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_mode_type +msgid "Payment Mode Type" +msgstr "Tipo del modo de pago" + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_order +msgid "Payment Order" +msgstr "Orden de pago" + +#. module: account_banking_payment_export +#: code:addons/account_banking_payment_export/models/account_payment.py:53 +#, 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:169 +#, python-format +msgid "Payment Orders" +msgstr "Órdenes de pago" + +#. 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 "Tipo de pago" + +#. module: account_banking_payment_export +#: view:payment.mode.type:account_banking_payment_export.view_payment_mode_type_tree +msgid "Payment Types" +msgstr "Tipos de pago" + +#. module: account_banking_payment_export +#: field:payment.order,payment_order_type:0 +msgid "Payment order type" +msgstr "Tipo de la orden de pago" + +#. module: account_banking_payment_export +#: field:payment.mode.type,ir_model_id:0 +msgid "Payment wizard" +msgstr "Asistente de pago" + +#. 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 "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.order.create,populate_results:0 +msgid "Populate results directly" +msgstr "Incluir directamente los resultados" + +#. module: account_banking_payment_export +#: help:payment.mode,type:0 +msgid "Select the Export Payment Type for the Payment Mode." +msgstr "Seleccione el tipo de exportación de pago para el modo de pago." + +#. 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 "Seleccione el asistente de pago para los pagos de este tipo. Déjelo vacío para un procesado manual." + +#. module: account_banking_payment_export +#: model:ir.model,name:account_banking_payment_export.model_payment_manual +msgid "Send payment order(s) manually" +msgstr "Enviar la(s) orden(es) de pago manualmente" + +#. module: account_banking_payment_export +#: help:payment.mode.type,code:0 +msgid "Specify the Code for Payment Type" +msgstr "Especifica el código para el tipo de pago" + +#. 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 "Tipos de cuentas bancarias adecuadas" + +#. 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 +#: 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 "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 +msgid "launch_wizard" +msgstr "Asistente" diff --git a/__unported__/account_banking_payment_export/i18n/nl.po b/account_banking_payment_export/i18n/nl.po similarity index 100% rename from __unported__/account_banking_payment_export/i18n/nl.po rename to account_banking_payment_export/i18n/nl.po diff --git a/__unported__/account_banking_payment_export/model/__init__.py b/account_banking_payment_export/models/__init__.py similarity index 67% rename from __unported__/account_banking_payment_export/model/__init__.py rename to account_banking_payment_export/models/__init__.py index 74ab85c8d..2f044680a 100644 --- a/__unported__/account_banking_payment_export/model/__init__.py +++ b/account_banking_payment_export/models/__init__.py @@ -1,7 +1,5 @@ # -*- coding: utf-8 -*- -from . import account_move_line from . import account_payment -from . import bank_payment_manual from . import payment_mode from . import payment_mode_type -from . import payment_order_create +from . import account_move_line diff --git a/__unported__/account_banking_payment_export/model/account_move_line.py b/account_banking_payment_export/models/account_move_line.py similarity index 90% rename from __unported__/account_banking_payment_export/model/account_move_line.py rename to account_banking_payment_export/models/account_move_line.py index 6d7fad550..74bb47f81 100644 --- a/__unported__/account_banking_payment_export/model/account_move_line.py +++ b/account_banking_payment_export/models/account_move_line.py @@ -32,10 +32,10 @@ from operator import itemgetter # https://bugs.launchpad.net/openobject-addons/+bug/1275478 # is integrated in addons/account_payment, then we will be able to remove this # file. -- Alexis de Lattre -class account_move_line(orm.Model): +class AccountMoveLine(orm.Model): _inherit = 'account.move.line' - def amount_to_pay(self, cr, uid, ids, name, arg=None, context=None): + def _amount_to_pay(self, cr, uid, ids, name, arg=None, context=None): """ Return the amount still to pay regarding all the payemnt orders (excepting cancelled orders)""" if not ids: @@ -72,24 +72,20 @@ class account_move_line(orm.Model): AND po.state != 'cancel' ) %(operator)s %%s ''' % {'operator': x[1]}, args)) sql_args = tuple(map(itemgetter(2), args)) - cr.execute( - ('''\ - SELECT id + '''SELECT id FROM account_move_line l WHERE account_id IN (select id FROM account_account WHERE type in %s AND active) AND reconcile_id IS null AND credit > 0 - AND ''' + where + ' and ' + query - ), (('payable', 'receivable'), ) + sql_args - ) + AND ''' + where + ' and ' + query, + (('payable', 'receivable'),) + sql_args) # The patch we have compared to the original function in # addons/account_payment is just above : # original code : type = 'payable' # fixed code : type in ('payable', 'receivable') - res = cr.fetchall() if not res: return [('id', '=', '0')] @@ -97,9 +93,6 @@ class account_move_line(orm.Model): _columns = { 'amount_to_pay': fields.function( - amount_to_pay, - type='float', - string='Amount to pay', - fnct_search=_to_pay_search - ), + _amount_to_pay, type='float', string='Amount to pay', + fnct_search=_to_pay_search), } diff --git a/__unported__/account_banking_payment_export/model/account_payment.py b/account_banking_payment_export/models/account_payment.py similarity index 58% rename from __unported__/account_banking_payment_export/model/account_payment.py rename to account_banking_payment_export/models/account_payment.py index bc720771a..3ab44b586 100644 --- a/__unported__/account_banking_payment_export/model/account_payment.py +++ b/account_banking_payment_export/models/account_payment.py @@ -23,47 +23,33 @@ # ############################################################################## -from openerp.osv import orm, fields -from openerp.tools.translate import _ -from openerp import netsvc +from openerp import models, fields, api, exceptions, workflow, _ -class payment_order(orm.Model): +class PaymentOrder(models.Model): _inherit = 'payment.order' - _columns = { - 'payment_order_type': fields.selection( - [('payment', 'Payment'), ('debit', 'Direct debit')], - 'Payment order type', required=True, - readonly=True, states={'draft': [('readonly', False)]}, - ), - 'mode_type': fields.related( - 'mode', 'type', type='many2one', relation='payment.mode.type', - string='Payment Type'), - } + payment_order_type = fields.Selection( + [('payment', 'Payment'), ('debit', 'Direct debit')], + 'Payment order type', required=True, default='payment', + readonly=True, states={'draft': [('readonly', False)]}) + mode_type = fields.Many2one('payment.mode.type', related='mode.type', + string='Payment Type') - _defaults = { - 'payment_order_type': 'payment', - } - - def launch_wizard(self, cr, uid, ids, context=None): - """ - Search for a wizard to launch according to the type. + @api.multi + def launch_wizard(self): + """Search for a wizard to launch according to the type. If type is manual. just confirm the order. Previously (pre-v6) in account_payment/wizard/wizard_pay.py """ - if context is None: - context = {} - result = {} - orders = self.browse(cr, uid, ids, context) - order = orders[0] + context = self.env.context.copy() + order = self[0] # check if a wizard is defined for the first order if order.mode.type and order.mode.type.ir_model_id: - context['active_ids'] = ids + context['active_ids'] = self.ids wizard_model = order.mode.type.ir_model_id.model - wizard_obj = self.pool.get(wizard_model) - wizard_id = wizard_obj.create(cr, uid, {}, context) - result = { + wizard_obj = self.env[wizard_model] + return { 'name': wizard_obj._description or _('Payment Order Export'), 'view_type': 'form', 'view_mode': 'form', @@ -72,22 +58,18 @@ class payment_order(orm.Model): 'context': context, 'type': 'ir.actions.act_window', 'target': 'new', - 'res_id': wizard_id, 'nodestroy': True, - } + } else: # should all be manual orders without type or wizard model - for order in orders[1:]: + for order in self[1:]: if order.mode.type and order.mode.type.ir_model_id: - raise orm.except_orm( + raise exceptions.Warning( _('Error'), _('You can only combine payment orders of the same ' - 'type') - ) + 'type')) # process manual payments - wf_service = netsvc.LocalService('workflow') - for order_id in ids: - wf_service.trg_validate( - uid, 'payment.order', order_id, 'done', cr - ) - return result + for order_id in self.ids: + workflow.trg_validate(self.env.uid, 'payment.order', + order_id, 'done', self.env.cr) + return {} diff --git a/__unported__/account_banking_payment_export/model/payment_mode.py b/account_banking_payment_export/models/payment_mode.py similarity index 56% rename from __unported__/account_banking_payment_export/model/payment_mode.py rename to account_banking_payment_export/models/payment_mode.py index e5cf3b452..df59d37c7 100644 --- a/__unported__/account_banking_payment_export/model/payment_mode.py +++ b/account_banking_payment_export/models/payment_mode.py @@ -23,12 +23,13 @@ # ############################################################################## -from openerp.osv import orm, fields +from openerp import models, fields -class payment_mode(orm.Model): - ''' Restoring the payment type from version 5, - used to select the export wizard (if any) ''' +class PaymentMode(models.Model): + """Restoring the payment type from version 5, + used to select the export wizard (if any) + """ _inherit = "payment.mode" def suitable_bank_types(self, cr, uid, payment_mode_id=None, context=None): @@ -36,27 +37,22 @@ class payment_mode(orm.Model): Current code in account_payment is disfunctional. """ res = [] - payment_mode = self.browse( - cr, uid, payment_mode_id, context) - if (payment_mode - and payment_mode.type - and payment_mode.type.suitable_bank_types): + payment_mode = self.browse(cr, uid, payment_mode_id, context=context) + if (payment_mode and payment_mode.type and + payment_mode.type.suitable_bank_types): res = [t.code for t in payment_mode.type.suitable_bank_types] return res - _columns = { - 'type': fields.many2one( - 'payment.mode.type', 'Payment type', - required=True, - help='Select the Payment Type for the Payment Mode.' - ), - 'payment_order_type': fields.related( - 'type', 'payment_order_type', readonly=True, type='selection', - selection=[('payment', 'Payment'), ('debit', 'Direct debit')], - string="Payment Order Type"), - 'active': fields.boolean('Active'), - } - - _defaults = { - 'active': True, - } + type = fields.Many2one( + 'payment.mode.type', string='Export type', required=True, + 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) + sale_ok = fields.Boolean(string='Selectable on sale operations', + default=True) + purchase_ok = fields.Boolean(string='Selectable on purchase operations', + default=True) diff --git a/account_banking_payment_export/models/payment_mode_type.py b/account_banking_payment_export/models/payment_mode_type.py new file mode 100644 index 000000000..341fe1063 --- /dev/null +++ b/account_banking_payment_export/models/payment_mode_type.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2009 EduSense BV (). +# (C) 2011 - 2013 Therp BV (). +# +# 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 . +# +############################################################################## + +from openerp import models, fields + + +class PaymentModeType(models.Model): + _name = 'payment.mode.type' + _description = 'Payment Mode Type' + + name = fields.Char('Name', size=64, required=True, help='Payment Type') + code = fields.Char('Code', size=64, required=True, + help='Specify the Code for Payment Type') + suitable_bank_types = fields.Many2many( + comodel_name='res.partner.bank.type', + relation='bank_type_payment_type_rel', column1='pay_type_id', + column2='bank_type_id', string='Suitable bank types', required=True) + ir_model_id = fields.Many2one( + 'ir.model', string='Payment wizard', + help='Select the Payment Wizard for payments of this type. Leave ' + 'empty for manual processing', + domain=[('osv_memory', '=', True)]) + payment_order_type = fields.Selection( + [('payment', 'Payment'), + ('debit', 'Debit')], + string='Order type', required=True, default='payment', + help="This field determines if this type applies to customers " + "(Debit) or suppliers (Payment)") + active = fields.Boolean(string='Active', default=True) + + def _auto_init(self, cr, context=None): + res = super(PaymentModeType, self)._auto_init(cr, context=context) + # migrate xmlid from manual_bank_transfer to avoid dependency on + # account_banking + cr.execute( + """UPDATE ir_model_data + SET module='account_banking_payment_export' + WHERE module='account_banking' AND + name='manual_bank_tranfer' AND + model='payment.mode.type'""") + return res diff --git a/__unported__/account_banking_payment_export/security/ir.model.access.csv b/account_banking_payment_export/security/ir.model.access.csv similarity index 100% rename from __unported__/account_banking_payment_export/security/ir.model.access.csv rename to account_banking_payment_export/security/ir.model.access.csv diff --git a/__unported__/account_banking_payment_export/view/account_payment.xml b/account_banking_payment_export/views/account_payment.xml similarity index 100% rename from __unported__/account_banking_payment_export/view/account_payment.xml rename to account_banking_payment_export/views/account_payment.xml diff --git a/__unported__/account_banking_payment_export/view/bank_payment_manual.xml b/account_banking_payment_export/views/bank_payment_manual.xml similarity index 100% rename from __unported__/account_banking_payment_export/view/bank_payment_manual.xml rename to account_banking_payment_export/views/bank_payment_manual.xml diff --git a/__unported__/account_banking_payment_export/view/payment_mode.xml b/account_banking_payment_export/views/payment_mode.xml similarity index 86% rename from __unported__/account_banking_payment_export/view/payment_mode.xml rename to account_banking_payment_export/views/payment_mode.xml index 611b233e8..273317bc5 100644 --- a/__unported__/account_banking_payment_export/view/payment_mode.xml +++ b/account_banking_payment_export/views/payment_mode.xml @@ -2,7 +2,7 @@ - @@ -13,6 +13,8 @@ + + diff --git a/__unported__/account_banking_payment_export/view/payment_mode_type.xml b/account_banking_payment_export/views/payment_mode_type.xml similarity index 77% rename from __unported__/account_banking_payment_export/view/payment_mode_type.xml rename to account_banking_payment_export/views/payment_mode_type.xml index a3bd21c25..4ca3acac7 100644 --- a/__unported__/account_banking_payment_export/view/payment_mode_type.xml +++ b/account_banking_payment_export/views/payment_mode_type.xml @@ -20,11 +20,18 @@
- - - - - + + + + + + + + + + +
@@ -44,7 +51,7 @@
- Payment Type + Payment Export Types payment.mode.type form tree,form diff --git a/__unported__/account_banking_payment_export/view/payment_order_create_view.xml b/account_banking_payment_export/views/payment_order_create_view.xml similarity index 100% rename from __unported__/account_banking_payment_export/view/payment_order_create_view.xml rename to account_banking_payment_export/views/payment_order_create_view.xml diff --git a/account_banking_payment_export/wizard/__init__.py b/account_banking_payment_export/wizard/__init__.py new file mode 100644 index 000000000..f30ac09dd --- /dev/null +++ b/account_banking_payment_export/wizard/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- +from . import payment_order_create +from . import bank_payment_manual diff --git a/__unported__/account_direct_debit/migrations/7.0.2/post-migration.py b/account_banking_payment_export/wizard/bank_payment_manual.py similarity index 59% rename from __unported__/account_direct_debit/migrations/7.0.2/post-migration.py rename to account_banking_payment_export/wizard/bank_payment_manual.py index f5c72c672..c2ca42573 100644 --- a/__unported__/account_direct_debit/migrations/7.0.2/post-migration.py +++ b/account_banking_payment_export/wizard/bank_payment_manual.py @@ -1,7 +1,8 @@ # -*- coding: utf-8 -*- ############################################################################## # -# Copyright (C) 2013 Therp BV (). +# Copyright (C) 2009 EduSense BV (). +# (C) 2011 - 2013 Therp BV (). # # All other contributions are (C) by their respective contributors # @@ -22,18 +23,20 @@ # ############################################################################## +"""This module contains a single "wizard" for confirming manual +bank transfers. +""" -def migrate(cr, version): - if not version: - return - cr.execute( - """ - UPDATE payment_line - SET transit_move_line_id = banking_addons_61_debit_move_line_id - """) - cr.execute( - """ - ALTER TABLE "payment_line" - DROP COLUMN "banking_addons_61_debit_move_line_id" - """ - ) +from openerp import models, api, workflow + + +class PaymentManual(models.TransientModel): + _name = 'payment.manual' + _description = 'Send payment order(s) manually' + + @api.multi + def button_ok(self): + for order_id in self.env.context.get('active_ids', []): + workflow.trg_validate(self.env.uid, 'payment.order', order_id, + 'done', self.env.cr) + return {'type': 'ir.actions.act_window_close'} diff --git a/account_banking_payment_export/wizard/bank_payment_manual.xml b/account_banking_payment_export/wizard/bank_payment_manual.xml new file mode 100644 index 000000000..e350c9b6f --- /dev/null +++ b/account_banking_payment_export/wizard/bank_payment_manual.xml @@ -0,0 +1,18 @@ + + + + + Form for manual payment wizard + payment.manual + +
+
+
+
+
diff --git a/account_banking_payment_export/wizard/payment_order_create.py b/account_banking_payment_export/wizard/payment_order_create.py new file mode 100644 index 000000000..52d7112e5 --- /dev/null +++ b/account_banking_payment_export/wizard/payment_order_create.py @@ -0,0 +1,175 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Copyright (C) 2009 EduSense BV (). +# (C) 2011 - 2013 Therp BV (). +# +# 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 . +# +############################################################################## + +from openerp import models, fields, api, _ + + +class PaymentOrderCreate(models.TransientModel): + _inherit = 'payment.order.create' + + populate_results = fields.Boolean(string="Populate results directly", + default=True) + + @api.model + def default_get(self, field_list): + res = super(PaymentOrderCreate, self).default_get(field_list) + context = self.env.context + if ('entries' in field_list and context.get('line_ids') and + context.get('populate_results')): + res.update({'entries': context['line_ids']}) + return res + + @api.model + def extend_payment_order_domain(self, payment_order, domain): + if payment_order.payment_order_type == 'payment': + domain += [('account_id.type', 'in', ('payable', 'receivable')), + ('amount_to_pay', '>', 0)] + return True + + @api.multi + def search_entries(self): + """This method taken from account_payment module. + We adapt the domain based on the payment_order_type + """ + line_obj = self.env['account.move.line'] + model_data_obj = self.env['ir.model.data'] + # -- start account_banking_payment -- + payment = self.env['payment.order'].browse( + self.env.context['active_id']) + # Search for move line to pay: + domain = [('move_id.state', '=', 'posted'), + ('reconcile_id', '=', False), + ('company_id', '=', payment.mode.company_id.id)] + self.extend_payment_order_domain(payment, domain) + # -- end account_direct_debit -- + domain += ['|', + ('date_maturity', '<=', self.duedate), + ('date_maturity', '=', False)] + lines = line_obj.search(domain) + context = self.env.context.copy() + context['line_ids'] = lines.ids + context['populate_results'] = self.populate_results + model_datas = model_data_obj.search( + [('model', '=', 'ir.ui.view'), + ('name', '=', 'view_create_payment_order_lines')]) + return {'name': _('Entry Lines'), + 'context': context, + 'view_type': 'form', + 'view_mode': 'form', + 'res_model': 'payment.order.create', + 'views': [(model_datas[0].res_id, 'form')], + 'type': 'ir.actions.act_window', + 'target': 'new', + } + + @api.model + def _prepare_payment_line(self, payment, line): + """This function is designed to be inherited + The resulting dict is passed to the create method of payment.line""" + _today = fields.Date.context_today(self) + date_to_pay = False # no payment date => immediate payment + if payment.date_prefered == 'due': + # -- account_banking + # date_to_pay = line.date_maturity + date_to_pay = ( + line.date_maturity + if line.date_maturity and line.date_maturity > _today + else False) + # -- end account banking + elif payment.date_prefered == 'fixed': + # -- account_banking + # date_to_pay = payment.date_scheduled + date_to_pay = ( + payment.date_scheduled + if payment.date_scheduled and payment.date_scheduled > _today + else False) + # -- end account banking + # -- account_banking + state = 'normal' + communication = line.ref or '-' + if line.invoice: + if line.invoice.type in ('in_invoice', 'in_refund'): + if line.invoice.reference_type == 'structured': + state = 'structured' + communication = line.invoice.reference + else: + if line.invoice.reference: + communication = line.invoice.reference + elif line.invoice.supplier_invoice_number: + communication = line.invoice.supplier_invoice_number + else: + # Make sure that the communication includes the + # customer invoice number (in the case of debit order) + communication = line.invoice.number.replace('/', '') + state = 'structured' + # support debit orders when enabled + if (payment.payment_order_type == 'debit' and + 'amount_to_receive' in line): + amount_currency = line.amount_to_receive + else: + amount_currency = line.amount_to_pay + line2bank = line.line2bank(payment.mode.id) + # -- end account banking + res = {'move_line_id': line.id, + 'amount_currency': amount_currency, + 'bank_id': line2bank.get(line.id), + 'order_id': payment.id, + 'partner_id': line.partner_id and line.partner_id.id or False, + # account banking + 'communication': communication, + 'state': state, + # end account banking + 'date': date_to_pay, + 'currency': (line.invoice and line.invoice.currency_id.id + or line.journal_id.currency.id + or line.journal_id.company_id.currency_id.id)} + return res + + @api.multi + def create_payment(self): + """This method is a slightly modified version of the existing method on + this model in account_payment. + - pass the payment mode to line2bank() + - allow invoices to create influence on the payment process: not only + 'Free' references are allowed, but others as well + - check date_to_pay is not in the past. + """ + if not self.entries: + return {'type': 'ir.actions.act_window_close'} + context = self.env.context + payment_line_obj = self.env['payment.line'] + payment = self.env['payment.order'].browse(context['active_id']) + # Populate the current payment with new lines: + for line in self.entries: + vals = self._prepare_payment_line(payment, line) + payment_line_obj.create(vals) + # Force reload of payment order view as a workaround for lp:1155525 + return {'name': _('Payment Orders'), + 'context': context, + 'view_type': 'form', + 'view_mode': 'form,tree', + 'res_model': 'payment.order', + 'res_id': context['active_id'], + 'type': 'ir.actions.act_window'} diff --git a/account_banking_payment_export/wizard/payment_order_create_view.xml b/account_banking_payment_export/wizard/payment_order_create_view.xml new file mode 100644 index 000000000..d70135343 --- /dev/null +++ b/account_banking_payment_export/wizard/payment_order_create_view.xml @@ -0,0 +1,34 @@ + + + + + + + payment.order.create.form.export + payment.order.create + + + + + + + + + + add.context.to.display.maturity.date + payment.order.create + + + + {'journal_type': 'sale'} + 1 + + + + + + diff --git a/account_banking_sepa_credit_transfer/__init__.py b/account_banking_sepa_credit_transfer/__init__.py new file mode 100644 index 000000000..c30bd487e --- /dev/null +++ b/account_banking_sepa_credit_transfer/__init__.py @@ -0,0 +1,24 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# SEPA Credit Transfer module for OpenERP +# Copyright (C) 2010-2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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 . +# +############################################################################## + +from . import wizard +from . import models diff --git a/__unported__/account_banking_sepa_credit_transfer/__openerp__.py b/account_banking_sepa_credit_transfer/__openerp__.py similarity index 72% rename from __unported__/account_banking_sepa_credit_transfer/__openerp__.py rename to account_banking_sepa_credit_transfer/__openerp__.py index 230e10e2d..9a4f4b0af 100644 --- a/__unported__/account_banking_sepa_credit_transfer/__openerp__.py +++ b/account_banking_sepa_credit_transfer/__openerp__.py @@ -26,39 +26,34 @@ 'license': 'AGPL-3', 'author': 'Akretion', 'website': 'http://www.akretion.com', + 'contributors': ['Pedro M. Baeza '], 'category': 'Banking addons', 'depends': ['account_banking_pain_base'], 'external_dependencies': { 'python': ['unidecode', 'lxml'], }, 'data': [ - 'account_banking_sepa_view.xml', + 'views/account_banking_sepa_view.xml', 'wizard/export_sepa_view.xml', 'data/payment_type_sepa_sct.xml', 'security/ir.model.access.csv', ], - 'demo': ['sepa_credit_transfer_demo.xml'], + 'demo': [ + 'demo/sepa_credit_transfer_demo.xml' + ], 'description': ''' Module to export payment orders in SEPA XML file format. SEPA PAIN (PAyment INitiation) is the new european standard for -Customer-to-Bank payment instructions. - -This module implements SEPA Credit Transfer (SCT), more specifically PAIN -versions 001.001.02, 001.001.03, 001.001.04 and 001.001.05. -It is part of the ISO 20022 standard, available on http://www.iso20022.org. +Customer-to-Bank payment instructions. This module implements SEPA Credit +Transfer (SCT), more specifically PAIN versions 001.001.02, 001.001.03, +001.001.04 and 001.001.05. It is part of the ISO 20022 standard, available on +http://www.iso20022.org. The Implementation Guidelines for SEPA Credit Transfer published by the -European Payments Council (http://http://www.europeanpaymentscouncil.eu) -use PAIN version 001.001.03, so it's probably the version of PAIN that you -should try first. - -This module uses the framework provided by the banking addons, -cf https://www.github.com/OCA/banking-addons - -Please contact Alexis de Lattre from Akretion -for any help or question about this module. +European Payments Council (http://http://www.europeanpaymentscouncil.eu) use +PAIN version 001.001.03, so it's probably the version of PAIN that you should +try first. ''', - 'active': False, - 'installable': False, + 'installable': True, } diff --git a/__unported__/account_banking_sepa_credit_transfer/data/pain.001.001.02.xsd b/account_banking_sepa_credit_transfer/data/pain.001.001.02.xsd similarity index 100% rename from __unported__/account_banking_sepa_credit_transfer/data/pain.001.001.02.xsd rename to account_banking_sepa_credit_transfer/data/pain.001.001.02.xsd diff --git a/__unported__/account_banking_sepa_credit_transfer/data/pain.001.001.03.xsd b/account_banking_sepa_credit_transfer/data/pain.001.001.03.xsd similarity index 100% rename from __unported__/account_banking_sepa_credit_transfer/data/pain.001.001.03.xsd rename to account_banking_sepa_credit_transfer/data/pain.001.001.03.xsd diff --git a/__unported__/account_banking_sepa_credit_transfer/data/pain.001.001.04.xsd b/account_banking_sepa_credit_transfer/data/pain.001.001.04.xsd similarity index 100% rename from __unported__/account_banking_sepa_credit_transfer/data/pain.001.001.04.xsd rename to account_banking_sepa_credit_transfer/data/pain.001.001.04.xsd diff --git a/__unported__/account_banking_sepa_credit_transfer/data/pain.001.001.05.xsd b/account_banking_sepa_credit_transfer/data/pain.001.001.05.xsd similarity index 100% rename from __unported__/account_banking_sepa_credit_transfer/data/pain.001.001.05.xsd rename to account_banking_sepa_credit_transfer/data/pain.001.001.05.xsd diff --git a/__unported__/account_banking_sepa_credit_transfer/data/payment_type_sepa_sct.xml b/account_banking_sepa_credit_transfer/data/payment_type_sepa_sct.xml similarity index 88% rename from __unported__/account_banking_sepa_credit_transfer/data/payment_type_sepa_sct.xml rename to account_banking_sepa_credit_transfer/data/payment_type_sepa_sct.xml index f07ece146..31d851edb 100644 --- a/__unported__/account_banking_sepa_credit_transfer/data/payment_type_sepa_sct.xml +++ b/account_banking_sepa_credit_transfer/data/payment_type_sepa_sct.xml @@ -7,6 +7,7 @@ SEPA Credit Transfer v05 pain.001.001.05 + payment @@ -15,6 +16,7 @@ SEPA Credit Transfer v04 pain.001.001.04 + payment @@ -23,6 +25,7 @@ SEPA Credit Transfer v03 (recommended) pain.001.001.03 + payment @@ -31,6 +34,7 @@ SEPA Credit Transfer v02 pain.001.001.02 + payment diff --git a/__unported__/account_banking_sepa_credit_transfer/sepa_credit_transfer_demo.xml b/account_banking_sepa_credit_transfer/demo/sepa_credit_transfer_demo.xml similarity index 100% rename from __unported__/account_banking_sepa_credit_transfer/sepa_credit_transfer_demo.xml rename to account_banking_sepa_credit_transfer/demo/sepa_credit_transfer_demo.xml diff --git a/__unported__/account_banking_sepa_credit_transfer/i18n/account_banking_sepa_credit_transfer.pot b/account_banking_sepa_credit_transfer/i18n/account_banking_sepa_credit_transfer.pot similarity index 79% rename from __unported__/account_banking_sepa_credit_transfer/i18n/account_banking_sepa_credit_transfer.pot rename to account_banking_sepa_credit_transfer/i18n/account_banking_sepa_credit_transfer.pot index 38feaadd4..ae9645ceb 100644 --- a/__unported__/account_banking_sepa_credit_transfer/i18n/account_banking_sepa_credit_transfer.pot +++ b/account_banking_sepa_credit_transfer/i18n/account_banking_sepa_credit_transfer.pot @@ -1,13 +1,13 @@ -# Translation of OpenERP Server. +# Translation of Odoo Server. # This file contains the translation of the following modules: # * account_banking_sepa_credit_transfer # msgid "" msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" +"Project-Id-Version: Odoo Server 8.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-12-23 22:49+0000\n" -"PO-Revision-Date: 2013-12-23 22:49+0000\n" +"POT-Creation-Date: 2014-10-31 22:52+0000\n" +"PO-Revision-Date: 2014-10-31 22:52+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -15,98 +15,18 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" -#. module: account_banking_sepa_credit_transfer -#: selection:banking.export.sepa.wizard,state:0 -msgid "Create" -msgstr "" - -#. 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 "" - -#. module: account_banking_sepa_credit_transfer -#: field:banking.export.sepa,filename:0 -#: field:banking.export.sepa.wizard,filename:0 -msgid "Filename" -msgstr "" - -#. module: account_banking_sepa_credit_transfer -#: field:banking.export.sepa,state:0 -#: field:banking.export.sepa.wizard,state:0 -msgid "State" -msgstr "" - -#. module: account_banking_sepa_credit_transfer -#: selection:banking.export.sepa,state:0 -msgid "Draft" -msgstr "" - -#. 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 "" - -#. module: account_banking_sepa_credit_transfer -#: selection:banking.export.sepa,charge_bearer:0 -#: selection:banking.export.sepa.wizard,charge_bearer:0 -msgid "Shared" -msgstr "" - #. module: account_banking_sepa_credit_transfer #: field:banking.export.sepa,batch_booking:0 #: field:banking.export.sepa.wizard,batch_booking:0 msgid "Batch Booking" msgstr "" -#. module: account_banking_sepa_credit_transfer -#: selection:banking.export.sepa,state:0 -msgid "Sent" -msgstr "" - -#. 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" -msgstr "" - -#. module: account_banking_sepa_credit_transfer -#: view:banking.export.sepa:0 -msgid "SEPA Credit Transfer" -msgstr "" - -#. module: account_banking_sepa_credit_transfer -#: selection:banking.export.sepa.wizard,state:0 -msgid "Finish" -msgstr "" - -#. module: account_banking_sepa_credit_transfer -#: selection:banking.export.sepa,state:0 -msgid "Reconciled" -msgstr "" - -#. 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 "" - #. 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 "" -#. module: account_banking_sepa_credit_transfer -#: view:banking.export.sepa.wizard:0 -msgid "Validate" -msgstr "" - -#. module: account_banking_sepa_credit_transfer -#: view:banking.export.sepa.wizard:0 -msgid "Generate" -msgstr "" - #. module: account_banking_sepa_credit_transfer #: selection:banking.export.sepa,charge_bearer:0 #: selection:banking.export.sepa.wizard,charge_bearer:0 @@ -114,16 +34,8 @@ msgid "Borne by Debtor" msgstr "" #. module: account_banking_sepa_credit_transfer -#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:128 -#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:245 -#, python-format -msgid "Error:" -msgstr "" - -#. module: account_banking_sepa_credit_transfer -#: field:banking.export.sepa,total_amount:0 -#: field:banking.export.sepa.wizard,total_amount:0 -msgid "Total Amount" +#: view:banking.export.sepa.wizard:account_banking_sepa_credit_transfer.banking_export_sepa_wizard_view +msgid "Cancel" msgstr "" #. module: account_banking_sepa_credit_transfer @@ -133,25 +45,57 @@ msgid "Charge Bearer" msgstr "" #. module: account_banking_sepa_credit_transfer -#: view:banking.export.sepa.wizard:0 -msgid "SEPA File Generation" +#: selection:banking.export.sepa.wizard,state:0 +msgid "Create" msgstr "" #. module: account_banking_sepa_credit_transfer -#: model:ir.model,name:account_banking_sepa_credit_transfer.model_banking_export_sepa -msgid "SEPA export" +#: field:banking.export.sepa,create_uid:0 +#: field:banking.export.sepa.wizard,create_uid:0 +msgid "Created by" msgstr "" #. module: account_banking_sepa_credit_transfer -#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:246 +#: field:banking.export.sepa.wizard,create_date:0 +msgid "Created on" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: selection:banking.export.sepa,state:0 +msgid "Draft" +msgstr "" + +#. 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 "Missing Bank Account on invoice '%s' (payment order line reference '%s')." +msgid "Error:" msgstr "" #. module: account_banking_sepa_credit_transfer -#: field:banking.export.sepa,file:0 -#: field:banking.export.sepa.wizard,file_id:0 -msgid "SEPA XML File" +#: model:ir.model,name:account_banking_sepa_credit_transfer.model_banking_export_sepa_wizard +msgid "Export SEPA Credit Transfer File" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa.wizard,file:0 +msgid "File" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa.wizard,filename:0 +msgid "Filename" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: selection:banking.export.sepa.wizard,state:0 +msgid "Finish" +msgstr "" + +#. 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 "" #. module: account_banking_sepa_credit_transfer @@ -160,21 +104,78 @@ msgid "Following service level : transaction charges are to be applied following msgstr "" #. module: account_banking_sepa_credit_transfer -#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:129 -#, 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'." +#: 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 "" #. module: account_banking_sepa_credit_transfer -#: view:banking.export.sepa:0 +#: view:banking.export.sepa:account_banking_sepa_credit_transfer.view_banking_export_sepa_form +msgid "General Information" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: view:banking.export.sepa.wizard:account_banking_sepa_credit_transfer.banking_export_sepa_wizard_view +msgid "Generate" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa,create_date:0 +msgid "Generation Date" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa,id:0 +#: field:banking.export.sepa.wizard,id:0 +msgid "ID" +msgstr "" + +#. 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 "" + +#. 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 "" + +#. 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 "" + +#. 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 "" + +#. 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 "" + +#. 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 "" #. module: account_banking_sepa_credit_transfer -#: view:banking.export.sepa:0 -msgid "General Information" +#: code:addons/account_banking_sepa_credit_transfer/wizard/export_sepa.py:125 +#, 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 "" + +#. 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 "" #. module: account_banking_sepa_credit_transfer @@ -185,23 +186,46 @@ msgid "SEPA Credit Transfer Files" msgstr "" #. 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." +#: view:banking.export.sepa.wizard:account_banking_sepa_credit_transfer.banking_export_sepa_wizard_view +msgid "SEPA File Generation" msgstr "" #. module: account_banking_sepa_credit_transfer -#: field:banking.export.sepa.wizard,file:0 -msgid "File" +#: field:banking.export.sepa,file:0 +#: field:banking.export.sepa.wizard,file_id:0 +msgid "SEPA XML File" msgstr "" #. module: account_banking_sepa_credit_transfer -#: view:banking.export.sepa.wizard:0 -msgid "Cancel" +#: model:ir.model,name:account_banking_sepa_credit_transfer.model_banking_export_sepa +msgid "SEPA export" msgstr "" #. module: account_banking_sepa_credit_transfer -#: field:banking.export.sepa,create_date:0 -msgid "Generation Date" +#: selection:banking.export.sepa,state:0 +msgid "Sent" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: selection:banking.export.sepa,charge_bearer:0 +#: selection:banking.export.sepa.wizard,charge_bearer:0 +msgid "Shared" +msgstr "" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa,state:0 +#: field:banking.export.sepa.wizard,state:0 +msgid "State" +msgstr "" + +#. 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 "" + +#. module: account_banking_sepa_credit_transfer +#: view:banking.export.sepa.wizard:account_banking_sepa_credit_transfer.banking_export_sepa_wizard_view +msgid "Validate" msgstr "" diff --git a/account_banking_sepa_credit_transfer/i18n/es.po b/account_banking_sepa_credit_transfer/i18n/es.po new file mode 100644 index 000000000..5d7b1057b --- /dev/null +++ b/account_banking_sepa_credit_transfer/i18n/es.po @@ -0,0 +1,231 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_banking_sepa_credit_transfer +# +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" +"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_sepa_credit_transfer +#: field:banking.export.sepa,batch_booking:0 +#: 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" + +#. module: account_banking_sepa_credit_transfer +#: view:banking.export.sepa.wizard:account_banking_sepa_credit_transfer.banking_export_sepa_wizard_view +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" + +#. module: account_banking_sepa_credit_transfer +#: selection:banking.export.sepa.wizard,state:0 +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" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa.wizard,create_date:0 +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" +msgstr "Exportar archivo de transferencia SEPA" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa.wizard,file:0 +msgid "File" +msgstr "Archivo" + +#. module: account_banking_sepa_credit_transfer +#: field:banking.export.sepa.wizard,filename:0 +msgid "Filename" +msgstr "Nombre de archivo" + +#. module: account_banking_sepa_credit_transfer +#: selection:banking.export.sepa.wizard,state:0 +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 +#, 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" + +#. module: account_banking_sepa_credit_transfer +#: view:banking.export.sepa.wizard:account_banking_sepa_credit_transfer.banking_export_sepa_wizard_view +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" + +#. module: account_banking_sepa_credit_transfer +#: view:banking.export.sepa.wizard:account_banking_sepa_credit_transfer.banking_export_sepa_wizard_view +msgid "Validate" +msgstr "Validar" + diff --git a/__unported__/account_banking_sepa_credit_transfer/i18n/fr.po b/account_banking_sepa_credit_transfer/i18n/fr.po similarity index 100% rename from __unported__/account_banking_sepa_credit_transfer/i18n/fr.po rename to account_banking_sepa_credit_transfer/i18n/fr.po diff --git a/__unported__/account_banking_sepa_credit_transfer/i18n/nl.po b/account_banking_sepa_credit_transfer/i18n/nl.po similarity index 100% rename from __unported__/account_banking_sepa_credit_transfer/i18n/nl.po rename to account_banking_sepa_credit_transfer/i18n/nl.po diff --git a/__unported__/account_banking_sepa_credit_transfer/__init__.py b/account_banking_sepa_credit_transfer/models/__init__.py similarity index 98% rename from __unported__/account_banking_sepa_credit_transfer/__init__.py rename to account_banking_sepa_credit_transfer/models/__init__.py index 207f87a21..90e481210 100644 --- a/__unported__/account_banking_sepa_credit_transfer/__init__.py +++ b/account_banking_sepa_credit_transfer/models/__init__.py @@ -20,5 +20,4 @@ # ############################################################################## -from . import wizard from . import account_banking_sepa diff --git a/account_banking_sepa_credit_transfer/models/account_banking_sepa.py b/account_banking_sepa_credit_transfer/models/account_banking_sepa.py new file mode 100644 index 000000000..69b7d20ae --- /dev/null +++ b/account_banking_sepa_credit_transfer/models/account_banking_sepa.py @@ -0,0 +1,76 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# SEPA Credit Transfer module for OpenERP +# Copyright (C) 2010-2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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 . +# +############################################################################## + +from openerp import models, fields, api +from openerp.addons.decimal_precision import decimal_precision as dp +from unidecode import unidecode + + +class BankingExportSepa(models.Model): + """SEPA export""" + _name = 'banking.export.sepa' + _description = __doc__ + _rec_name = 'filename' + + @api.one + def _generate_filename(self): + ref = self.payment_order_ids[0].reference + if ref: + label = unidecode(ref.replace('/', '-')) + else: + label = 'error' + self.filename = 'sct_%s.xml' % label + + payment_order_ids = fields.Many2many( + comodel_name='payment.order', column1='banking_export_sepa_id', + column2='account_order_id', relation='account_payment_order_sepa_rel', + string='Payment Orders', readonly=True) + nb_transactions = fields.Integer(string='Number of Transactions', + readonly=True) + total_amount = fields.Float(string='Total Amount', + digits_compute=dp.get_precision('Account'), + readonly=True) + batch_booking = fields.Boolean( + 'Batch Booking', readonly=True, + help="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.") + charge_bearer = fields.Selection( + [('SLEV', 'Following Service Level'), + ('SHAR', 'Shared'), + ('CRED', 'Borne by Creditor'), + ('DEBT', 'Borne by Debtor')], string='Charge Bearer', readonly=True, + help="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.") + create_date = fields.Datetime('Generation Date', readonly=True) + file = fields.Binary('SEPA XML File', readonly=True) + filename = fields.Char(string='Filename', size=256, readonly=True, + compute=_generate_filename) + state = fields.Selection([('draft', 'Draft'), ('sent', 'Sent')], + string='State', readonly=True, default='draft') diff --git a/__unported__/account_banking_sepa_credit_transfer/security/ir.model.access.csv b/account_banking_sepa_credit_transfer/security/ir.model.access.csv similarity index 100% rename from __unported__/account_banking_sepa_credit_transfer/security/ir.model.access.csv rename to account_banking_sepa_credit_transfer/security/ir.model.access.csv diff --git a/account_banking_sepa_credit_transfer/static/description/icon.png b/account_banking_sepa_credit_transfer/static/description/icon.png new file mode 100644 index 000000000..e1485aabd Binary files /dev/null and b/account_banking_sepa_credit_transfer/static/description/icon.png differ diff --git a/account_banking_sepa_credit_transfer/static/description/icon.svg b/account_banking_sepa_credit_transfer/static/description/icon.svg new file mode 100644 index 000000000..266ef8442 --- /dev/null +++ b/account_banking_sepa_credit_transfer/static/description/icon.svg @@ -0,0 +1,92 @@ + + + +image/svg+xmlCREDITTRANSFER + \ No newline at end of file diff --git a/__unported__/account_banking_sepa_credit_transfer/account_banking_sepa_view.xml b/account_banking_sepa_credit_transfer/views/account_banking_sepa_view.xml similarity index 100% rename from __unported__/account_banking_sepa_credit_transfer/account_banking_sepa_view.xml rename to account_banking_sepa_credit_transfer/views/account_banking_sepa_view.xml diff --git a/__unported__/account_banking_sepa_credit_transfer/wizard/__init__.py b/account_banking_sepa_credit_transfer/wizard/__init__.py similarity index 100% rename from __unported__/account_banking_sepa_credit_transfer/wizard/__init__.py rename to account_banking_sepa_credit_transfer/wizard/__init__.py diff --git a/__unported__/account_banking_sepa_credit_transfer/wizard/export_sepa.py b/account_banking_sepa_credit_transfer/wizard/export_sepa.py similarity index 86% rename from __unported__/account_banking_sepa_credit_transfer/wizard/export_sepa.py rename to account_banking_sepa_credit_transfer/wizard/export_sepa.py index eb2461ad8..94b2004a3 100644 --- a/__unported__/account_banking_sepa_credit_transfer/wizard/export_sepa.py +++ b/account_banking_sepa_credit_transfer/wizard/export_sepa.py @@ -23,40 +23,39 @@ from openerp.osv import orm, fields from openerp.tools.translate import _ -from openerp import netsvc +from openerp import workflow from lxml import etree -class banking_export_sepa_wizard(orm.TransientModel): +class BankingExportSepaWizard(orm.TransientModel): _name = 'banking.export.sepa.wizard' _inherit = ['banking.export.pain'] _description = 'Export SEPA Credit Transfer File' _columns = { - 'state': fields.selection([ - ('create', 'Create'), - ('finish', 'Finish'), - ], 'State', readonly=True), + 'state': fields.selection([('create', 'Create'), + ('finish', 'Finish')], 'State', + readonly=True), 'batch_booking': fields.boolean( 'Batch Booking', help="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."), - 'charge_bearer': fields.selection([ - ('SLEV', 'Following Service Level'), - ('SHAR', 'Shared'), - ('CRED', 'Borne by Creditor'), - ('DEBT', 'Borne by Debtor'), - ], 'Charge Bearer', required=True, + 'charge_bearer': fields.selection( + [('SLEV', 'Following Service Level'), + ('SHAR', 'Shared'), + ('CRED', 'Borne by Creditor'), + ('DEBT', 'Borne by Debtor')], 'Charge Bearer', required=True, help="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."), + "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."), 'nb_transactions': fields.related( 'file_id', 'nb_transactions', type='integer', string='Number of Transactions', readonly=True), @@ -73,25 +72,23 @@ class banking_export_sepa_wizard(orm.TransientModel): 'payment_order_ids': fields.many2many( 'payment.order', 'wiz_sepa_payorders_rel', 'wizard_id', 'payment_order_id', 'Payment Orders', readonly=True), - } + } _defaults = { 'charge_bearer': 'SLEV', 'state': 'create', - } + } def create(self, cr, uid, vals, context=None): payment_order_ids = context.get('active_ids', []) vals.update({ 'payment_order_ids': [[6, 0, payment_order_ids]], }) - return super(banking_export_sepa_wizard, self).create( + return super(BankingExportSepaWizard, self).create( cr, uid, vals, context=context) def create_sepa(self, cr, uid, ids, context=None): - ''' - Creates the SEPA Credit Transfer file. That's the important code ! - ''' + """Creates the SEPA Credit Transfer file. That's the important code!""" if context is None: context = {} sepa_export = self.browse(cr, uid, ids[0], context=context) @@ -122,16 +119,14 @@ class banking_export_sepa_wizard(orm.TransientModel): bic_xml_tag = 'BICFI' name_maxsize = 140 root_xml_tag = 'CstmrCdtTrfInitn' - else: raise orm.except_orm( _('Error:'), _("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'.") - % pain_flavor) - + "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'.") % + pain_flavor) gen_args = { 'bic_xml_tag': bic_xml_tag, 'name_maxsize': name_maxsize, @@ -144,22 +139,18 @@ class banking_export_sepa_wizard(orm.TransientModel): 'account_banking_sepa_credit_transfer/data/%s.xsd' % pain_flavor, } - pain_ns = { 'xsi': 'http://www.w3.org/2001/XMLSchema-instance', None: 'urn:iso:std:iso:20022:tech:xsd:%s' % pain_flavor, - } - + } xml_root = etree.Element('Document', nsmap=pain_ns) pain_root = etree.SubElement(xml_root, root_xml_tag) pain_03_to_05 = \ ['pain.001.001.03', 'pain.001.001.04', 'pain.001.001.05'] - # A. Group header group_header_1_0, nb_of_transactions_1_6, control_sum_1_7 = \ self.generate_group_header_block( cr, uid, pain_root, gen_args, context=context) - transactions_count_1_6 = 0 total_amount = 0.0 amount_control_sum_1_7 = 0.0 @@ -187,7 +178,6 @@ class banking_export_sepa_wizard(orm.TransientModel): self.pool['payment.line'].write( cr, uid, line.id, {'date': requested_date}, context=context) - 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 = \ @@ -200,7 +190,6 @@ class banking_export_sepa_wizard(orm.TransientModel): 'priority': priority, 'requested_date': requested_date, }, gen_args, context=context) - self.generate_party_block( cr, uid, payment_info_2_0, 'Dbtr', 'B', 'sepa_export.payment_order_ids[0].mode.bank_id.partner_id.' @@ -209,10 +198,8 @@ class banking_export_sepa_wizard(orm.TransientModel): 'sepa_export.payment_order_ids[0].mode.bank_id.bank.bic', {'sepa_export': sepa_export}, gen_args, context=context) - charge_bearer_2_24 = etree.SubElement(payment_info_2_0, 'ChrgBr') charge_bearer_2_24.text = sepa_export.charge_bearer - transactions_count_2_4 = 0 amount_control_sum_2_5 = 0.0 for line in lines: @@ -240,7 +227,6 @@ class banking_export_sepa_wizard(orm.TransientModel): instructed_amount_2_43.text = '%.2f' % line.amount_currency amount_control_sum_1_7 += line.amount_currency amount_control_sum_2_5 += line.amount_currency - if not line.bank_id: raise orm.except_orm( _('Error:'), @@ -252,48 +238,40 @@ class banking_export_sepa_wizard(orm.TransientModel): 'C', 'line.partner_id.name', 'line.bank_id.acc_number', 'line.bank_id.bank.bic', {'line': line}, gen_args, context=context) - self.generate_remittance_info_block( cr, uid, credit_transfer_transaction_info_2_27, line, gen_args, context=context) - if pain_flavor in pain_03_to_05: nb_of_transactions_2_4.text = str(transactions_count_2_4) control_sum_2_5.text = '%.2f' % amount_control_sum_2_5 - if pain_flavor in pain_03_to_05: nb_of_transactions_1_6.text = str(transactions_count_1_6) control_sum_1_7.text = '%.2f' % amount_control_sum_1_7 else: nb_of_transactions_1_6.text = str(transactions_count_1_6) control_sum_1_7.text = '%.2f' % amount_control_sum_1_7 - return self.finalize_sepa_file_creation( cr, uid, ids, xml_root, total_amount, transactions_count_1_6, gen_args, context=context) def cancel_sepa(self, cr, uid, ids, context=None): - ''' - Cancel the SEPA file: just drop the file - ''' + """Cancel the SEPA file: just drop the file""" sepa_export = self.browse(cr, uid, ids[0], context=context) - self.pool.get('banking.export.sepa').unlink( + self.pool['banking.export.sepa'].unlink( cr, uid, sepa_export.file_id.id, context=context) return {'type': 'ir.actions.act_window_close'} def save_sepa(self, cr, uid, ids, context=None): - ''' - Save the SEPA file: send the done signal to all payment + """Save the SEPA file: send the done signal to all payment orders in the file. With the default workflow, they will transition to 'done', while with the advanced workflow in account_banking_payment they will transition to 'sent' waiting reconciliation. - ''' + """ sepa_export = self.browse(cr, uid, ids[0], context=context) - self.pool.get('banking.export.sepa').write( + self.pool['banking.export.sepa'].write( cr, uid, sepa_export.file_id.id, {'state': 'sent'}, context=context) - wf_service = netsvc.LocalService('workflow') for order in sepa_export.payment_order_ids: - wf_service.trg_validate(uid, 'payment.order', order.id, 'done', cr) + workflow.trg_validate(uid, 'payment.order', order.id, 'done', cr) return {'type': 'ir.actions.act_window_close'} diff --git a/__unported__/account_banking_sepa_credit_transfer/wizard/export_sepa_view.xml b/account_banking_sepa_credit_transfer/wizard/export_sepa_view.xml similarity index 100% rename from __unported__/account_banking_sepa_credit_transfer/wizard/export_sepa_view.xml rename to account_banking_sepa_credit_transfer/wizard/export_sepa_view.xml diff --git a/__unported__/account_banking_sepa_direct_debit/__init__.py b/account_banking_sepa_direct_debit/__init__.py similarity index 94% rename from __unported__/account_banking_sepa_direct_debit/__init__.py rename to account_banking_sepa_direct_debit/__init__.py index f852fb7bd..096fe8ad3 100644 --- a/__unported__/account_banking_sepa_direct_debit/__init__.py +++ b/account_banking_sepa_direct_debit/__init__.py @@ -20,6 +20,5 @@ # ############################################################################## -from . import company +from . import models from . import wizard -from . import account_banking_sdd diff --git a/__unported__/account_banking_sepa_direct_debit/__openerp__.py b/account_banking_sepa_direct_debit/__openerp__.py similarity index 66% rename from __unported__/account_banking_sepa_direct_debit/__openerp__.py rename to account_banking_sepa_direct_debit/__openerp__.py index 2e109be26..160e52605 100644 --- a/__unported__/account_banking_sepa_direct_debit/__openerp__.py +++ b/account_banking_sepa_direct_debit/__openerp__.py @@ -26,47 +26,40 @@ 'license': 'AGPL-3', 'author': 'Akretion', 'website': 'http://www.akretion.com', + 'contributors': ['Pedro M. Baeza '], 'category': 'Banking addons', - 'depends': ['account_direct_debit', 'account_banking_pain_base'], + 'depends': [ + 'account_direct_debit', + 'account_banking_pain_base', + 'account_banking_mandate', + ], 'external_dependencies': { 'python': ['unidecode', 'lxml'], }, 'data': [ - 'security/original_mandate_required_security.xml', - 'account_banking_sdd_view.xml', - 'sdd_mandate_view.xml', - 'res_partner_bank_view.xml', - 'account_payment_view.xml', - 'company_view.xml', - 'mandate_expire_cron.xml', - 'account_invoice_view.xml', + 'views/account_banking_sdd_view.xml', + 'views/account_banking_mandate_view.xml', + 'views/res_company_view.xml', 'wizard/export_sdd_view.xml', + 'data/mandate_expire_cron.xml', 'data/payment_type_sdd.xml', - 'data/mandate_reference_sequence.xml', + 'security/original_mandate_required_security.xml', 'security/ir.model.access.csv', ], - 'demo': ['sepa_direct_debit_demo.xml'], + 'demo': ['demo/sepa_direct_debit_demo.xml'], 'description': ''' Module to export direct debit payment orders in SEPA XML file format. SEPA PAIN (PAyment INitiation) is the new european standard for -Customer-to-Bank payment instructions. - -This module implements SEPA Direct Debit (SDD), more specifically PAIN -versions 008.001.02, 008.001.03 and 008.001.04. -It is part of the ISO 20022 standard, available on http://www.iso20022.org. +Customer-to-Bank payment instructions. This module implements SEPA Direct +Debit (SDD), more specifically PAIN versions 008.001.02, 008.001.03 and +008.001.04. It is part of the ISO 20022 standard, available on +http://www.iso20022.org. The Implementation Guidelines for SEPA Direct Debit published by the European Payments Council (http://http://www.europeanpaymentscouncil.eu) use PAIN -version 008.001.02. So if you don't know which version your bank supports, -you should try version 008.001.02 first. - -This module uses the framework provided by the banking addons, -cf https://www.github.com/OCA/banking-addons - -Please contact Alexis de Lattre from Akretion -for any help or question about this module. +version 008.001.02. So if you don't know which version your bank supports, you +should try version 008.001.02 first. ''', - 'active': False, - 'installable': False, + 'installable': True, } diff --git a/account_banking_sepa_direct_debit/data/mandate_expire_cron.xml b/account_banking_sepa_direct_debit/data/mandate_expire_cron.xml new file mode 100644 index 000000000..48fe6fc63 --- /dev/null +++ b/account_banking_sepa_direct_debit/data/mandate_expire_cron.xml @@ -0,0 +1,24 @@ + + + + + + + + Set SEPA Direct Debit Mandates to Expired + + + 1 + days + -1 + + + + + + + diff --git a/__unported__/account_banking_sepa_direct_debit/data/pain.008.001.02.xsd b/account_banking_sepa_direct_debit/data/pain.008.001.02.xsd similarity index 100% rename from __unported__/account_banking_sepa_direct_debit/data/pain.008.001.02.xsd rename to account_banking_sepa_direct_debit/data/pain.008.001.02.xsd diff --git a/__unported__/account_banking_sepa_direct_debit/data/pain.008.001.03.xsd b/account_banking_sepa_direct_debit/data/pain.008.001.03.xsd similarity index 100% rename from __unported__/account_banking_sepa_direct_debit/data/pain.008.001.03.xsd rename to account_banking_sepa_direct_debit/data/pain.008.001.03.xsd diff --git a/__unported__/account_banking_sepa_direct_debit/data/pain.008.001.04.xsd b/account_banking_sepa_direct_debit/data/pain.008.001.04.xsd similarity index 100% rename from __unported__/account_banking_sepa_direct_debit/data/pain.008.001.04.xsd rename to account_banking_sepa_direct_debit/data/pain.008.001.04.xsd diff --git a/__unported__/account_banking_sepa_direct_debit/data/payment_type_sdd.xml b/account_banking_sepa_direct_debit/data/payment_type_sdd.xml similarity index 100% rename from __unported__/account_banking_sepa_direct_debit/data/payment_type_sdd.xml rename to account_banking_sepa_direct_debit/data/payment_type_sdd.xml diff --git a/__unported__/account_banking_sepa_direct_debit/sepa_direct_debit_demo.xml b/account_banking_sepa_direct_debit/demo/sepa_direct_debit_demo.xml similarity index 92% rename from __unported__/account_banking_sepa_direct_debit/sepa_direct_debit_demo.xml rename to account_banking_sepa_direct_debit/demo/sepa_direct_debit_demo.xml index 220261088..041082d76 100644 --- a/__unported__/account_banking_sepa_direct_debit/sepa_direct_debit_demo.xml +++ b/account_banking_sepa_direct_debit/demo/sepa_direct_debit_demo.xml @@ -15,7 +15,7 @@ FR78ZZZ424242 - + recurrent first diff --git a/__unported__/account_banking_sepa_direct_debit/i18n/account_banking_sepa_direct_debit.pot b/account_banking_sepa_direct_debit/i18n/account_banking_sepa_direct_debit.pot similarity index 58% rename from __unported__/account_banking_sepa_direct_debit/i18n/account_banking_sepa_direct_debit.pot rename to account_banking_sepa_direct_debit/i18n/account_banking_sepa_direct_debit.pot index 0db576726..a39fa750a 100644 --- a/__unported__/account_banking_sepa_direct_debit/i18n/account_banking_sepa_direct_debit.pot +++ b/account_banking_sepa_direct_debit/i18n/account_banking_sepa_direct_debit.pot @@ -1,13 +1,13 @@ -# Translation of OpenERP Server. +# Translation of Odoo Server. # This file contains the translation of the following modules: # * account_banking_sepa_direct_debit # msgid "" msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" +"Project-Id-Version: Odoo Server 8.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-12-23 22:24+0000\n" -"PO-Revision-Date: 2013-12-23 22:24+0000\n" +"POT-Creation-Date: 2014-10-31 22:53+0000\n" +"PO-Revision-Date: 2014-10-31 22:53+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -16,58 +16,35 @@ msgstr "" "Plural-Forms: \n" #. module: account_banking_sepa_direct_debit -#: model:mail.message.subtype,description:account_banking_sepa_direct_debit.mandate_valid -msgid "SEPA Direct Debit Mandate Validated" +#: model:ir.actions.act_window,help:account_banking_sepa_direct_debit.mandate_action +msgid "

\n" +" Click to create a new SEPA Direct Debit Mandate.\n" +"

\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" +"

\n" +" " msgstr "" #. module: account_banking_sepa_direct_debit -#: field:banking.export.sdd,filename:0 -#: field:banking.export.sdd.wizard,filename:0 -msgid "Filename" +#: model:ir.model,name:account_banking_sepa_direct_debit.model_account_banking_mandate +msgid "A generic banking mandate" msgstr "" #. module: account_banking_sepa_direct_debit -#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:200 +#: code:addons/account_banking_sepa_direct_debit/models/account_banking_mandate.py:120 #, python-format -msgid "The SEPA Direct Debit mandate with reference '%s' for partner '%s' has expired." +msgid "As you changed the bank account attached to this mandate, the 'Sequence Type' has been set back to 'First'." msgstr "" #. module: account_banking_sepa_direct_debit -#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:219 -#, python-format -msgid "Cannot validate the mandate '%s' without a date of signature." +#: selection:account.banking.mandate,scheme:0 +msgid "Basic (CORE)" msgstr "" #. module: account_banking_sepa_direct_debit -#: selection:sdd.mandate,recurrent_sequence_type:0 -msgid "Final" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: selection:banking.export.sdd.wizard,state:0 -msgid "Finish" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: view:res.partner:0 -#: view:res.partner.bank:0 -msgid "SDD Mandates" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: constraint:payment.line:0 -#: constraint:sdd.mandate:0 -msgid "Error msg in raise" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: selection:banking.export.sdd,state:0 -msgid "Reconciled" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: field:sdd.mandate,recurrent_sequence_type:0 -msgid "Sequence Type for Next Debit" +#: field:banking.export.sdd,batch_booking:0 +#: field:banking.export.sdd.wizard,batch_booking:0 +msgid "Batch Booking" msgstr "" #. module: account_banking_sepa_direct_debit @@ -76,36 +53,6 @@ msgstr "" msgid "Borne by Creditor" msgstr "" -#. module: account_banking_sepa_direct_debit -#: model:ir.actions.act_window,name:account_banking_sepa_direct_debit.sdd_mandate_action -#: model:ir.ui.menu,name:account_banking_sepa_direct_debit.sdd_mandate_menu -#: view:res.partner.bank:0 -#: field:res.partner.bank,sdd_mandate_ids:0 -msgid "SEPA Direct Debit Mandates" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: view:banking.export.sdd.wizard:0 -#: view:sdd.mandate:0 -msgid "Validate" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: model:mail.message.subtype,description:account_banking_sepa_direct_debit.recurrent_sequence_type_recurring -#: model:mail.message.subtype,name:account_banking_sepa_direct_debit.recurrent_sequence_type_recurring -msgid "Sequence Type set to Recurring" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: view:banking.export.sdd.wizard:0 -msgid "Generate" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: model:mail.message.subtype,description:account_banking_sepa_direct_debit.mandate_cancel -msgid "SEPA Direct Debit Mandate Cancelled" -msgstr "" - #. module: account_banking_sepa_direct_debit #: selection:banking.export.sdd,charge_bearer:0 #: selection:banking.export.sdd.wizard,charge_bearer:0 @@ -113,105 +60,19 @@ msgid "Borne by Debtor" msgstr "" #. module: account_banking_sepa_direct_debit -#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:212 -#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:218 -#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:224 -#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:232 -#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:239 -#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:245 -#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:253 -#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:395 -#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:140 -#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:192 -#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:199 -#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:209 -#, python-format -msgid "Error:" +#: view:banking.export.sdd.wizard:account_banking_sepa_direct_debit.banking_export_sdd_wizard_view +msgid "Cancel" msgstr "" #. module: account_banking_sepa_direct_debit -#: field:sdd.mandate,message_ids:0 -msgid "Messages" +#: field:banking.export.sdd,charge_bearer:0 +#: field:banking.export.sdd.wizard,charge_bearer:0 +msgid "Charge Bearer" msgstr "" #. module: account_banking_sepa_direct_debit -#: field:sdd.mandate,unique_mandate_reference:0 -msgid "Unique Mandate Reference" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: view:sdd.mandate:0 -#: selection:sdd.mandate,state:0 -msgid "Cancelled" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:141 -#, 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 "" - -#. module: account_banking_sepa_direct_debit -#: help:sdd.mandate,message_unread:0 -msgid "If checked new messages require your attention." -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: field:banking.export.sdd.wizard,file_id:0 -msgid "SDD File" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: model:mail.message.subtype,description:account_banking_sepa_direct_debit.mandate_expired -msgid "SEPA Direct Debit Mandate has Expired" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:246 -#, 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 "" - -#. 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 "" - -#. module: account_banking_sepa_direct_debit -#: view:sdd.mandate:0 -msgid "Reference" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: view:banking.export.sdd:0 -msgid "SEPA Direct Debit" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: view:banking.export.sdd.wizard:0 -msgid "SEPA Direct Debit XML file generation" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: help:sdd.mandate,message_summary:0 -msgid "Holds the Chatter summary (number of messages, ...). This summary is directly in html format in order to be inserted in kanban views." -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: model:ir.model,name:account_banking_sepa_direct_debit.model_payment_line -msgid "Payment Line" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: field:banking.export.sdd,create_date:0 -msgid "Generation Date" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:396 -#, 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')." +#: model:ir.model,name:account_banking_sepa_direct_debit.model_res_company +msgid "Companies" msgstr "" #. module: account_banking_sepa_direct_debit @@ -220,64 +81,19 @@ msgid "Create" msgstr "" #. 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" +#: field:banking.export.sdd,create_uid:0 +#: field:banking.export.sdd.wizard,create_uid:0 +msgid "Created by" msgstr "" #. module: account_banking_sepa_direct_debit -#: view:sdd.mandate:0 -#: selection:sdd.mandate,type:0 -msgid "One-Off" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: field:banking.export.sdd,state:0 -#: field:banking.export.sdd.wizard,state:0 -msgid "State" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:240 -#, python-format -msgid "The recurrent mandate '%s' must have a sequence type." -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: field:sdd.mandate,message_follower_ids:0 -msgid "Followers" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: field:sdd.mandate,message_unread:0 -msgid "Unread Messages" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: view:banking.export.sdd:0 -#: field:banking.export.sdd,payment_order_ids:0 -#: field:banking.export.sdd.wizard,payment_order_ids:0 -msgid "Payment Orders" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: view:sdd.mandate:0 -msgid "Type" +#: field:banking.export.sdd.wizard,create_date:0 +msgid "Created on" msgstr "" #. module: account_banking_sepa_direct_debit #: selection:banking.export.sdd,state:0 -msgid "Sent" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: field:res.company,original_creditor_identifier:0 -msgid "Original Creditor Identifier" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: selection:sdd.mandate,recurrent_sequence_type:0 -msgid "Recurring" +msgid "Draft" msgstr "" #. module: account_banking_sepa_direct_debit @@ -290,70 +106,23 @@ msgid "Enter the Creditor Identifier that has been attributed to your company to msgstr "" #. module: account_banking_sepa_direct_debit -#: sql_constraint:sdd.mandate:0 -msgid "A Mandate with the same reference already exists for this company !" +#: selection:account.banking.mandate,scheme:0 +msgid "Enterprise (B2B)" msgstr "" #. module: account_banking_sepa_direct_debit -#: help:sdd.mandate,state:0 -msgid "Only valid mandates can be used in a payment line. A cancelled mandate is a mandate that has been cancelled by the customer. A one-off mandate expires after its first use. A recurrent mandate expires after it's final use or if it hasn't been used for 36 months." -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: help:sdd.mandate,recurrent_sequence_type:0 -msgid "This field is only used for Recurrent mandates, not for One-Off mandates." -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:213 +#: code:addons/account_banking_sepa_direct_debit/models/res_company.py:79 #, python-format -msgid "The date of signature of mandate '%s' is in the future !" +msgid "Error" msgstr "" #. module: account_banking_sepa_direct_debit -#: view:sdd.mandate:0 -msgid "Signature Date" -msgstr "" - -#. 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 "" - -#. module: account_banking_sepa_direct_debit -#: field:sdd.mandate,partner_id:0 -msgid "Partner" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: selection:sdd.mandate,recurrent_sequence_type:0 -msgid "First" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: field:sdd.mandate,signature_date:0 -msgid "Date of Signature of the Mandate" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: model:mail.message.subtype,name:account_banking_sepa_direct_debit.mandate_cancel -msgid "Mandate Cancelled" -msgstr "" - -#. 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 "" - -#. module: account_banking_sepa_direct_debit -#: help:sdd.mandate,sepa_migrated:0 -msgid "If this field is not active, the mandate section of the next direct debit file that include this mandate will contain the 'Original Mandate Identification' and the 'Original Creditor Scheme Identification'. This is required in a few countries (Belgium for instance), but not in all countries. If this is not required in your country, you should keep this field always active." -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: field:sdd.mandate,company_id:0 -msgid "Company" +#: 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 "" #. module: account_banking_sepa_direct_debit @@ -362,62 +131,29 @@ msgid "Export SEPA Direct Debit File" msgstr "" #. 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." +#: field:banking.export.sdd.wizard,file:0 +msgid "File" msgstr "" #. module: account_banking_sepa_direct_debit -#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:225 -#, python-format -msgid "Cannot validate the mandate '%s' because it is not attached to a bank account." +#: field:banking.export.sdd,filename:0 +#: field:banking.export.sdd.wizard,filename:0 +msgid "Filename" msgstr "" #. module: account_banking_sepa_direct_debit -#: selection:banking.export.sdd,state:0 -#: view:sdd.mandate:0 -#: selection:sdd.mandate,state:0 -msgid "Draft" +#: selection:account.banking.mandate,recurrent_sequence_type:0 +msgid "Final" msgstr "" #. module: account_banking_sepa_direct_debit -#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:290 -#, python-format -msgid "Mandate update" +#: selection:banking.export.sdd.wizard,state:0 +msgid "Finish" msgstr "" #. module: account_banking_sepa_direct_debit -#: selection:banking.export.sdd,charge_bearer:0 -#: selection:banking.export.sdd.wizard,charge_bearer:0 -msgid "Shared" -msgstr "" - -#. 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 "" - -#. module: account_banking_sepa_direct_debit -#: field:sdd.mandate,sepa_migrated:0 -msgid "Migrated to SEPA" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: field:sdd.mandate,state:0 -msgid "Status" -msgstr "" - -#. 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 "" - -#. 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" +#: selection:account.banking.mandate,recurrent_sequence_type:0 +msgid "First" msgstr "" #. module: account_banking_sepa_direct_debit @@ -427,9 +163,195 @@ msgid "Following Service Level" msgstr "" #. module: account_banking_sepa_direct_debit -#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:233 +#: 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 "" + +#. module: account_banking_sepa_direct_debit +#: view:banking.export.sdd:account_banking_sepa_direct_debit.view_banking_export_sdd_form +msgid "General Information" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: view:banking.export.sdd.wizard:account_banking_sepa_direct_debit.banking_export_sdd_wizard_view +msgid "Generate" +msgstr "" + +#. 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 "" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd,create_date:0 +msgid "Generation Date" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd,id:0 +#: field:banking.export.sdd.wizard,id:0 +msgid "ID" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: help:account.banking.mandate,sepa_migrated:0 +msgid "If this field is not active, the mandate section of the next direct debit file that include this mandate will contain the 'Original Mandate Identification' and the 'Original Creditor Scheme Identification'. This is required in a few countries (Belgium for instance), but not in all countries. If this is not required in your country, you should keep this field always active." +msgstr "" + +#. 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 "" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/models/res_company.py:80 #, python-format -msgid "The mandate '%s' can't have a date of last debit before the date of signature." +msgid "Invalid SEPA Creditor Identifier." +msgstr "" + +#. 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 "" + +#. 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 "" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/models/account_banking_mandate.py:119 +#, python-format +msgid "Mandate update" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:account.banking.mandate,sepa_migrated:0 +msgid "Migrated to SEPA" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:186 +#, python-format +msgid "Missing SEPA Direct Debit mandate on the payment line with partner '%s' and Invoice ref '%s'." +msgstr "" + +#. 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 "" + +#. module: account_banking_sepa_direct_debit +#: view:account.banking.mandate:account_banking_sepa_direct_debit.sdd_mandate_search +#: selection:account.banking.mandate,type:0 +msgid "One-Off" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:res.company,original_creditor_identifier:0 +msgid "Original Creditor Identifier" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:account.banking.mandate,original_mandate_identification:0 +msgid "Original Mandate Identification" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: model:res.groups,name:account_banking_sepa_direct_debit.group_original_mandate_required +msgid "Original Mandate Required (SEPA)" +msgstr "" + +#. 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 "" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:138 +#, 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 "" + +#. module: account_banking_sepa_direct_debit +#: view:account.banking.mandate:account_banking_sepa_direct_debit.sdd_mandate_search +#: selection:account.banking.mandate,type:0 +msgid "Recurrent" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: selection:account.banking.mandate,recurrent_sequence_type:0 +msgid "Recurring" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd.wizard,file_id:0 +msgid "SDD File" +msgstr "" + +#. 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 +msgid "SDD Mandates" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:res.company,sepa_creditor_identifier:0 +msgid "SEPA Creditor Identifier" +msgstr "" + +#. 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 "" + +#. 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 "" + +#. module: account_banking_sepa_direct_debit +#: model:ir.actions.act_window,name:account_banking_sepa_direct_debit.mandate_action +msgid "SEPA Direct Debit Mandates" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: view:banking.export.sdd.wizard:account_banking_sepa_direct_debit.banking_export_sdd_wizard_view +msgid "SEPA Direct Debit XML file generation" +msgstr "" + +#. 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 "" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd,file:0 +msgid "SEPA File" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:account.banking.mandate,scheme:0 +msgid "Scheme" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: selection:banking.export.sdd,state:0 +msgid "Sent" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:account.banking.mandate,recurrent_sequence_type:0 +msgid "Sequence Type for Next Debit" msgstr "" #. module: account_banking_sepa_direct_debit @@ -438,172 +360,6 @@ msgstr "" msgid "Sequence Type set to Final" msgstr "" -#. module: account_banking_sepa_direct_debit -#: field:sdd.mandate,message_is_follower:0 -msgid "Is a Follower" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: help:sdd.mandate,original_mandate_identification:0 -msgid "When the field 'Migrated to SEPA' is not active, this field will be used as the Original Mandate Identification in the Direct Debit file." -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: view:payment.order:0 -msgid "SDD Mandate" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: field:sdd.mandate,original_mandate_identification:0 -msgid "Original Mandate Identification" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: model:ir.model,name:account_banking_sepa_direct_debit.model_res_company -msgid "Companies" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: field:sdd.mandate,message_summary:0 -msgid "Summary" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: model:res.groups,name:account_banking_sepa_direct_debit.group_original_mandate_required -msgid "Original Mandate Required (SEPA)" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: field:account.invoice,sdd_mandate_id:0 -#: model:ir.model,name:account_banking_sepa_direct_debit.model_sdd_mandate -#: field:payment.line,sdd_mandate_id:0 -#: view:sdd.mandate:0 -msgid "SEPA Direct Debit Mandate" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:193 -#, python-format -msgid "Missing SEPA Direct Debit mandate on the payment line with partner '%s' and Invoice ref '%s'." -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:210 -#, 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 "" - -#. module: account_banking_sepa_direct_debit -#: field:sdd.mandate,scan:0 -msgid "Scan of the Mandate" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: field:sdd.mandate,last_debit_date:0 -msgid "Date of the Last Debit" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: model:mail.message.subtype,name:account_banking_sepa_direct_debit.mandate_expired -msgid "Mandate Expired" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: constraint:res.company:0 -msgid "Invalid SEPA Creditor Identifier." -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: model:ir.model,name:account_banking_sepa_direct_debit.model_res_partner_bank -msgid "Bank Accounts" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: model:ir.actions.act_window,help:account_banking_sepa_direct_debit.sdd_mandate_action -msgid "

\n" -" Click to create a new SEPA Direct Debit Mandate.\n" -"

\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" -"

\n" -" " -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: view:banking.export.sdd:0 -msgid "General Information" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: view:sdd.mandate:0 -#: selection:sdd.mandate,state:0 -msgid "Valid" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: model:ir.model,name:account_banking_sepa_direct_debit.model_account_invoice -msgid "Invoice" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: view:banking.export.sdd.wizard:0 -#: view:sdd.mandate:0 -msgid "Cancel" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: view:sdd.mandate:0 -#: field:sdd.mandate,payment_line_ids:0 -msgid "Related Payment Lines" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: view:sdd.mandate:0 -#: selection:sdd.mandate,type:0 -msgid "Recurrent" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: field:sdd.mandate,type:0 -msgid "Type of Mandate" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: model:mail.message.subtype,name:account_banking_sepa_direct_debit.mandate_valid -msgid "Mandate Validated" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: field:banking.export.sdd,file:0 -msgid "SEPA File" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: field:res.company,sepa_creditor_identifier:0 -msgid "SEPA Creditor Identifier" -msgstr "" - -#. 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 "" - -#. module: account_banking_sepa_direct_debit -#: view:sdd.mandate:0 -#: selection:sdd.mandate,state:0 -msgid "Expired" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: field:sdd.mandate,partner_bank_id:0 -msgid "Bank Account" -msgstr "" - -#. module: account_banking_sepa_direct_debit -#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:254 -#, python-format -msgid "You must set the 'Original Mandate Identification' on the recurrent mandate '%s' which is not marked as 'Migrated to SEPA'." -msgstr "" - #. module: account_banking_sepa_direct_debit #: model:mail.message.subtype,description:account_banking_sepa_direct_debit.recurrent_sequence_type_first #: model:mail.message.subtype,name:account_banking_sepa_direct_debit.recurrent_sequence_type_first @@ -611,23 +367,81 @@ msgid "Sequence Type set to First" msgstr "" #. module: account_banking_sepa_direct_debit -#: code:addons/account_banking_sepa_direct_debit/account_banking_sdd.py:291 +#: model:mail.message.subtype,description:account_banking_sepa_direct_debit.recurrent_sequence_type_recurring +#: model:mail.message.subtype,name:account_banking_sepa_direct_debit.recurrent_sequence_type_recurring +msgid "Sequence Type set to Recurring" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: selection:banking.export.sdd,charge_bearer:0 +#: selection:banking.export.sdd.wizard,charge_bearer:0 +msgid "Shared" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd,state:0 +#: field:banking.export.sdd.wizard,state:0 +msgid "State" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:194 #, python-format -msgid "As you changed the bank account attached to this mandate, the 'Sequence Type' has been set back to 'First'." +msgid "The SEPA Direct Debit mandate with reference '%s' for partner '%s' has expired." msgstr "" #. module: account_banking_sepa_direct_debit -#: help:sdd.mandate,message_ids:0 -msgid "Messages and communication history" +#: code:addons/account_banking_sepa_direct_debit/wizard/export_sdd.py:203 +#, 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 "" #. module: account_banking_sepa_direct_debit -#: view:sdd.mandate:0 -msgid "Search SEPA Direct Debit Mandates" +#: code:addons/account_banking_sepa_direct_debit/models/account_banking_mandate.py:86 +#, python-format +msgid "The recurrent mandate '%s' must have a sequence type." msgstr "" #. module: account_banking_sepa_direct_debit -#: field:banking.export.sdd.wizard,file:0 -msgid "File" +#: code:addons/account_banking_sepa_direct_debit/models/account_banking_mandate.py:95 +#, 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 "" + +#. module: account_banking_sepa_direct_debit +#: help:account.banking.mandate,recurrent_sequence_type:0 +msgid "This field is only used for Recurrent mandates, not for One-Off mandates." +msgstr "" + +#. 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 "" + +#. module: account_banking_sepa_direct_debit +#: view:account.banking.mandate:account_banking_sepa_direct_debit.sdd_mandate_tree +msgid "Type" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:account.banking.mandate,type:0 +msgid "Type of Mandate" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: view:banking.export.sdd.wizard:account_banking_sepa_direct_debit.banking_export_sdd_wizard_view +msgid "Validate" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: help:account.banking.mandate,original_mandate_identification:0 +msgid "When the field 'Migrated to SEPA' is not active, this field will be used as the Original Mandate Identification in the Direct Debit file." +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/models/account_banking_mandate.py:105 +#, python-format +msgid "You must set the 'Original Mandate Identification' on the recurrent mandate '%s' which is not marked as 'Migrated to SEPA'." msgstr "" diff --git a/account_banking_sepa_direct_debit/i18n/es.po b/account_banking_sepa_direct_debit/i18n/es.po new file mode 100644 index 000000000..98334c842 --- /dev/null +++ b/account_banking_sepa_direct_debit/i18n/es.po @@ -0,0 +1,456 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_banking_sepa_direct_debit +# +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" +"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_sepa_direct_debit +#: model:ir.actions.act_window,help:account_banking_sepa_direct_debit.mandate_action +msgid "

\n" +" Click to create a new SEPA Direct Debit Mandate.\n" +"

\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" +"

\n" +" " +msgstr "

\n" +" Pulse para crear un nuevo mandato de adeudo directo SEPA.\n" +"

\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" +"

\n" +" " + +#. module: account_banking_sepa_direct_debit +#: model:ir.model,name:account_banking_sepa_direct_debit.model_account_banking_mandate +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 +#, 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'." + +#. module: account_banking_sepa_direct_debit +#: selection:account.banking.mandate,scheme:0 +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" + +#. module: account_banking_sepa_direct_debit +#: view:banking.export.sdd.wizard:account_banking_sepa_direct_debit.banking_export_sdd_wizard_view +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" + +#. module: account_banking_sepa_direct_debit +#: model:ir.model,name:account_banking_sepa_direct_debit.model_res_company +msgid "Companies" +msgstr "Compañías" + +#. module: account_banking_sepa_direct_debit +#: selection:banking.export.sdd.wizard,state:0 +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" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd.wizard,create_date:0 +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" +"- your country ISO code (2 letters)\n" +"- a 2-digits checkum\n" +"- a 3-letters business code\n" +"- a country-specific identifier" +msgstr "Introduzca el identificador de acreedor que se le ha atribuido a su compañía para realizar adeudos directos SEPA. Su banco suele poseer esta información. Este identificador se compone de:\n" +"- el código ISO de 2 letras de su país\n" +"- dos dígitos de comprobación\n" +"- tres letras de código de negocio\n" +"- un identificador específico de país (en España, el NIF)" + +#. module: account_banking_sepa_direct_debit +#: selection:account.banking.mandate,scheme:0 +msgid "Enterprise (B2B)" +msgstr "Empresa (B2B)" + +#. module: account_banking_sepa_direct_debit +#: code:addons/account_banking_sepa_direct_debit/models/res_company.py:79 +#, 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" +msgstr "Exportar archivo de adeudo directo SEPA" + +#. module: account_banking_sepa_direct_debit +#: field:banking.export.sdd.wizard,file:0 +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" + +#. module: account_banking_sepa_direct_debit +#: selection:account.banking.mandate,recurrent_sequence_type:0 +msgid "Final" +msgstr "Final" + +#. module: account_banking_sepa_direct_debit +#: selection:banking.export.sdd.wizard,state:0 +msgid "Finish" +msgstr "Finalizar" + +#. module: account_banking_sepa_direct_debit +#: selection:account.banking.mandate,recurrent_sequence_type:0 +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" + +#. module: account_banking_sepa_direct_debit +#: help:account.banking.mandate,sepa_migrated:0 +msgid "If this field is not active, the mandate section of the next direct debit file that include this mandate will contain the 'Original Mandate Identification' and the 'Original Creditor Scheme Identification'. This is required in a few countries (Belgium for instance), but not in all countries. If this is not required in your country, you should keep this field always active." +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 +#, 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 +#, python-format +msgid "Mandate update" +msgstr "" + +#. module: account_banking_sepa_direct_debit +#: field:account.banking.mandate,sepa_migrated:0 +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 +#, 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'" + +#. 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" + +#. module: account_banking_sepa_direct_debit +#: view:account.banking.mandate:account_banking_sepa_direct_debit.sdd_mandate_search +#: selection:account.banking.mandate,type:0 +msgid "One-Off" +msgstr "Único" + +#. module: account_banking_sepa_direct_debit +#: field:res.company,original_creditor_identifier:0 +msgid "Original Creditor Identifier" +msgstr "Identificador del acreedor original" + +#. module: account_banking_sepa_direct_debit +#: field:account.banking.mandate,original_mandate_identification:0 +msgid "Original Mandate Identification" +msgstr "Identificación del mandato original" + +#. module: account_banking_sepa_direct_debit +#: model:res.groups,name:account_banking_sepa_direct_debit.group_original_mandate_required +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 +#, 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 "" + +#. module: account_banking_sepa_direct_debit +#: view:account.banking.mandate:account_banking_sepa_direct_debit.sdd_mandate_search +#: selection:account.banking.mandate,type:0 +msgid "Recurrent" +msgstr "Recurrente" + +#. module: account_banking_sepa_direct_debit +#: selection:account.banking.mandate,recurrent_sequence_type:0 +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 +msgid "SDD Mandates" +msgstr "Mandatos SDD" + +#. module: account_banking_sepa_direct_debit +#: field:res.company,sepa_creditor_identifier:0 +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" +msgstr "Mandatos de adeudos directos SEPA" + +#. module: account_banking_sepa_direct_debit +#: view:banking.export.sdd.wizard:account_banking_sepa_direct_debit.banking_export_sdd_wizard_view +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 +#: 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" + +#. module: account_banking_sepa_direct_debit +#: field:account.banking.mandate,recurrent_sequence_type:0 +msgid "Sequence Type for Next Debit" +msgstr "Tipo de secuencia para el próximo cobro" + +#. module: account_banking_sepa_direct_debit +#: model:mail.message.subtype,description:account_banking_sepa_direct_debit.recurrent_sequence_type_final +#: model:mail.message.subtype,name:account_banking_sepa_direct_debit.recurrent_sequence_type_final +msgid "Sequence Type set to Final" +msgstr "Tipo de secuencia establecida a 'Final'" + +#. module: account_banking_sepa_direct_debit +#: model:mail.message.subtype,description:account_banking_sepa_direct_debit.recurrent_sequence_type_first +#: model:mail.message.subtype,name:account_banking_sepa_direct_debit.recurrent_sequence_type_first +msgid "Sequence Type set to First" +msgstr "Tipo de secuencia establecida a 'Inicial'" + +#. module: account_banking_sepa_direct_debit +#: model:mail.message.subtype,description:account_banking_sepa_direct_debit.recurrent_sequence_type_recurring +#: model:mail.message.subtype,name:account_banking_sepa_direct_debit.recurrent_sequence_type_recurring +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 +#, 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 +#, 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 +#, 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 +#, 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'." + +#. module: account_banking_sepa_direct_debit +#: help:account.banking.mandate,recurrent_sequence_type:0 +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_tree +msgid "Type" +msgstr "Tipo" + +#. module: account_banking_sepa_direct_debit +#: field:account.banking.mandate,type:0 +msgid "Type of Mandate" +msgstr "Tipo de mandato" + +#. module: account_banking_sepa_direct_debit +#: view:banking.export.sdd.wizard:account_banking_sepa_direct_debit.banking_export_sdd_wizard_view +msgid "Validate" +msgstr "Validar" + +#. module: account_banking_sepa_direct_debit +#: help:account.banking.mandate,original_mandate_identification:0 +msgid "When the field 'Migrated to SEPA' is not active, this field will be used as the Original Mandate Identification in the Direct Debit file." +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 +#, 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'." + diff --git a/__unported__/account_banking_sepa_direct_debit/i18n/fr.po b/account_banking_sepa_direct_debit/i18n/fr.po similarity index 100% rename from __unported__/account_banking_sepa_direct_debit/i18n/fr.po rename to account_banking_sepa_direct_debit/i18n/fr.po diff --git a/__unported__/account_banking_sepa_direct_debit/i18n/nl.po b/account_banking_sepa_direct_debit/i18n/nl.po similarity index 100% rename from __unported__/account_banking_sepa_direct_debit/i18n/nl.po rename to account_banking_sepa_direct_debit/i18n/nl.po diff --git a/account_banking_sepa_direct_debit/models/__init__.py b/account_banking_sepa_direct_debit/models/__init__.py new file mode 100644 index 000000000..274855e14 --- /dev/null +++ b/account_banking_sepa_direct_debit/models/__init__.py @@ -0,0 +1,25 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# SEPA Direct Debit module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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 . +# +############################################################################## + +from . import banking_export_sdd +from . import res_company +from . import account_banking_mandate diff --git a/account_banking_sepa_direct_debit/models/account_banking_mandate.py b/account_banking_sepa_direct_debit/models/account_banking_mandate.py new file mode 100644 index 000000000..4df706378 --- /dev/null +++ b/account_banking_sepa_direct_debit/models/account_banking_mandate.py @@ -0,0 +1,145 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# SEPA Direct Debit module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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 . +# +############################################################################## + +from openerp import models, fields, api, exceptions, _ +from datetime import datetime +from dateutil.relativedelta import relativedelta +import logging + +NUMBER_OF_UNUSED_MONTHS_BEFORE_EXPIRY = 36 + +logger = logging.getLogger(__name__) + + +class AccountBankingMandate(models.Model): + """SEPA Direct Debit Mandate""" + _inherit = 'account.banking.mandate' + _track = { + 'recurrent_sequence_type': { + 'account_banking_sepa_direct_debit.recurrent_sequence_type_first': + lambda self, cr, uid, obj, ctx=None: + obj['recurrent_sequence_type'] == 'first', + 'account_banking_sepa_direct_debit.' + 'recurrent_sequence_type_recurring': + lambda self, cr, uid, obj, ctx=None: + obj['recurrent_sequence_type'] == 'recurring', + 'account_banking_sepa_direct_debit.recurrent_sequence_type_final': + lambda self, cr, uid, obj, ctx=None: + obj['recurrent_sequence_type'] == 'final', + } + } + + type = fields.Selection([('recurrent', 'Recurrent'), + ('oneoff', 'One-Off')], + string='Type of Mandate', required=True, + track_visibility='always') + recurrent_sequence_type = fields.Selection( + [('first', 'First'), + ('recurring', 'Recurring'), + ('final', 'Final')], + string='Sequence Type for Next Debit', track_visibility='onchange', + help="This field is only used for Recurrent mandates, not for " + "One-Off mandates.", default="first") + sepa_migrated = fields.Boolean( + string='Migrated to SEPA', track_visibility='onchange', + help="If this field is not active, the mandate section of the next " + "direct debit file that include this mandate will contain the " + "'Original Mandate Identification' and the 'Original Creditor " + "Scheme Identification'. This is required in a few countries " + "(Belgium for instance), but not in all countries. If this is " + "not required in your country, you should keep this field always " + "active.", default=True) + original_mandate_identification = fields.Char( + string='Original Mandate Identification', track_visibility='onchange', + help="When the field 'Migrated to SEPA' is not active, this field " + "will be used as the Original Mandate Identification in the " + "Direct Debit file.") + scheme = fields.Selection([('CORE', 'Basic (CORE)'), + ('B2B', 'Enterprise (B2B)')], + string='Scheme', required=True, default="CORE") + + @api.one + @api.constrains('type', 'recurrent_sequence_type') + def _check_recurring_type(self): + if (self.type == 'recurrent' + and not self.recurrent_sequence_type): + raise exceptions.Warning( + _("The recurrent mandate '%s' must have a sequence type.") + % self.unique_mandate_reference) + + @api.one + @api.constrains('type', 'recurrent_sequence_type', 'sepa_migrated') + def _check_migrated_to_sepa(self): + if (self.type == 'recurrent' and not self.sepa_migrated + and self.recurrent_sequence_type != 'first'): + raise exceptions.Warning( + _("The recurrent mandate '%s' which is not marked as " + "'Migrated to SEPA' must have its recurrent sequence type " + "set to 'First'.") % self.unique_mandate_reference) + + @api.one + @api.constrains('type', 'original_mandate_identification', 'sepa_migrated') + def _check_original_mandate_identification(self): + if (self.type == 'recurrent' and not self.sepa_migrated + and not self.original_mandate_identification): + raise exceptions.Warning( + _("You must set the 'Original Mandate Identification' on the " + "recurrent mandate '%s' which is not marked as 'Migrated to " + "SEPA'.") % self.unique_mandate_reference) + + @api.one + @api.onchange('partner_bank_id') + def mandate_partner_bank_change(self): + super(AccountBankingMandate, self).mandate_partner_bank_change() + res = {} + if (self.state == 'valid' and self.partner_bank_id + and self.type == 'recurrent' + and self.recurrent_sequence_type != 'first'): + self.recurrent_sequence_type = 'first' + res['warning'] = { + 'title': _('Mandate update'), + 'message': _("As you changed the bank account attached to " + "this mandate, the 'Sequence Type' has been set " + "back to 'First'."), + } + return res + + @api.multi + def _sdd_mandate_set_state_to_expired(self): + logger.info('Searching for SDD Mandates that must be set to Expired') + expire_limit_date = datetime.today() + \ + relativedelta(months=-NUMBER_OF_UNUSED_MONTHS_BEFORE_EXPIRY) + expire_limit_date_str = expire_limit_date.strftime('%Y-%m-%d') + expired_mandates = self.search( + ['|', + ('last_debit_date', '=', False), + ('last_debit_date', '<=', expire_limit_date_str), + ('state', '=', 'valid'), + ('signature_date', '<=', expire_limit_date_str)]) + if expired_mandates: + expired_mandates.write({'state': 'expired'}) + logger.info( + 'The following SDD Mandate IDs has been set to expired: %s' + % expired_mandates.ids) + else: + logger.info('0 SDD Mandates must be set to Expired') + return True diff --git a/account_banking_sepa_direct_debit/models/banking_export_sdd.py b/account_banking_sepa_direct_debit/models/banking_export_sdd.py new file mode 100644 index 000000000..c80cebf6e --- /dev/null +++ b/account_banking_sepa_direct_debit/models/banking_export_sdd.py @@ -0,0 +1,80 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# SEPA Direct Debit module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# +# 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 . +# +############################################################################## + +from openerp import models, fields, api +from openerp.addons.decimal_precision import decimal_precision as dp +from unidecode import unidecode + + +class BankingExportSdd(models.Model): + """SEPA Direct Debit export""" + _name = 'banking.export.sdd' + _description = __doc__ + _rec_name = 'filename' + + @api.one + @api.depends('payment_order_ids', 'payment_order_ids.reference') + def _generate_filename(self): + if self.payment_order_ids: + ref = self.payment_order_ids[0].reference + label = unidecode(ref.replace('/', '-')) if ref else 'error' + filename = 'sdd_%s.xml' % label + else: + filename = 'sdd.xml' + self.filename = filename + + payment_order_ids = fields.Many2many( + comodel_name='payment.order', + relation='account_payment_order_sdd_rel', + column1='banking_export_sepa_id', column2='account_order_id', + string='Payment Orders', + readonly=True) + nb_transactions = fields.Integer( + string='Number of Transactions', readonly=True) + total_amount = fields.Float( + string='Total Amount', digits_compute=dp.get_precision('Account'), + readonly=True) + batch_booking = fields.Boolean( + 'Batch Booking', readonly=True, + help="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.") + charge_bearer = fields.Selection( + [('SLEV', 'Following Service Level'), + ('SHAR', 'Shared'), + ('CRED', 'Borne by Creditor'), + ('DEBT', 'Borne by Debtor')], 'Charge Bearer', readonly=True, + help="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.") + create_date = fields.Datetime(string='Generation Date', readonly=True) + file = fields.Binary(string='SEPA File', readonly=True) + filename = fields.Char(compute=_generate_filename, size=256, + string='Filename', readonly=True, store=True) + state = fields.Selection([('draft', 'Draft'), ('sent', 'Sent')], + string='State', readonly=True, default='draft') diff --git a/__unported__/account_banking_sepa_direct_debit/company.py b/account_banking_sepa_direct_debit/models/res_company.py similarity index 58% rename from __unported__/account_banking_sepa_direct_debit/company.py rename to account_banking_sepa_direct_debit/models/res_company.py index 6d54ba8e6..46f98bbc2 100644 --- a/__unported__/account_banking_sepa_direct_debit/company.py +++ b/account_banking_sepa_direct_debit/models/res_company.py @@ -20,29 +20,27 @@ # ############################################################################## -from openerp.osv import orm, fields +from openerp import models, fields, api, exceptions, _ import logging logger = logging.getLogger(__name__) -class res_company(orm.Model): +class ResCompany(models.Model): _inherit = 'res.company' - _columns = { - 'sepa_creditor_identifier': fields.char( - 'SEPA Creditor Identifier', size=35, - help="Enter the Creditor Identifier that has been attributed " - "to your company to make SEPA Direct Debits. This identifier " - "is composed of :\n- your country ISO code (2 letters)\n- a " - "2-digits checkum\n- a 3-letters business code\n- a " - "country-specific identifier"), - 'original_creditor_identifier': fields.char( - 'Original Creditor Identifier', size=70), - } + sepa_creditor_identifier = fields.Char( + string='SEPA Creditor Identifier', size=35, + help="Enter the Creditor Identifier that has been attributed to your " + "company to make SEPA Direct Debits. This identifier is composed " + "of :\n- your country ISO code (2 letters)\n- a 2-digits " + "checkum\n- a 3-letters business code\n- a country-specific " + "identifier") + original_creditor_identifier = fields.Char( + string='Original Creditor Identifier', size=70) def is_sepa_creditor_identifier_valid( - self, cr, uid, sepa_creditor_identifier, context=None): + self, sepa_creditor_identifier): """Check if SEPA Creditor Identifier is valid @param sepa_creditor_identifier: SEPA Creditor Identifier as str or unicode @@ -51,12 +49,11 @@ class res_company(orm.Model): if not isinstance(sepa_creditor_identifier, (str, unicode)): return False try: - sci_str = str(sepa_creditor_identifier) + sci = str(sepa_creditor_identifier).lower() except: logger.warning( "SEPA Creditor ID should contain only ASCII caracters.") return False - sci = sci_str.lower() if len(sci) < 9: return False before_replacement = sci[7:] + sci[0:2] + '00' @@ -65,26 +62,19 @@ class res_company(orm.Model): after_replacement = '' for char in before_replacement: if char.isalpha(): - after_replacement += str(ord(char)-87) + after_replacement += str(ord(char) - 87) else: after_replacement += char logger.debug( "SEPA ID check after_replacement = %s" % after_replacement) - if int(sci[2:4]) == (98 - (int(after_replacement) % 97)): - return True - else: - return False + return int(sci[2:4]) == (98 - (int(after_replacement) % 97)) - def _check_sepa_creditor_identifier(self, cr, uid, ids): - for company in self.browse(cr, uid, ids): - if company.sepa_creditor_identifier: - if not self.is_sepa_creditor_identifier_valid( - cr, uid, company.sepa_creditor_identifier): - return False - return True - - _constraints = [ - (_check_sepa_creditor_identifier, - "Invalid SEPA Creditor Identifier.", - ['sepa_creditor_identifier']), - ] + @api.one + @api.constrains('sepa_creditor_identifier') + def _check_sepa_creditor_identifier(self): + if self.sepa_creditor_identifier: + if not self.is_sepa_creditor_identifier_valid( + self.sepa_creditor_identifier): + raise exceptions.Warning( + _('Error'), + _("Invalid SEPA Creditor Identifier.")) diff --git a/__unported__/account_banking_sepa_direct_debit/security/ir.model.access.csv b/account_banking_sepa_direct_debit/security/ir.model.access.csv similarity index 51% rename from __unported__/account_banking_sepa_direct_debit/security/ir.model.access.csv rename to account_banking_sepa_direct_debit/security/ir.model.access.csv index cf78ffb59..0cd579511 100644 --- a/__unported__/account_banking_sepa_direct_debit/security/ir.model.access.csv +++ b/account_banking_sepa_direct_debit/security/ir.model.access.csv @@ -1,4 +1,2 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" "access_banking_export_sdd","Full access on banking.export.sdd","model_banking_export_sdd","account_payment.group_account_payment",1,1,1,1 -"access_sdd_mandate","Full access on sdd.mandate","model_sdd_mandate","account_payment.group_account_payment",1,1,1,1 -"access_sdd_mandate_read","Read access on sdd.mandate","model_sdd_mandate","base.group_user",1,0,0,0 diff --git a/__unported__/account_banking_sepa_direct_debit/security/original_mandate_required_security.xml b/account_banking_sepa_direct_debit/security/original_mandate_required_security.xml similarity index 100% rename from __unported__/account_banking_sepa_direct_debit/security/original_mandate_required_security.xml rename to account_banking_sepa_direct_debit/security/original_mandate_required_security.xml diff --git a/account_banking_sepa_direct_debit/static/description/icon.png b/account_banking_sepa_direct_debit/static/description/icon.png new file mode 100644 index 000000000..dca4d23f2 Binary files /dev/null and b/account_banking_sepa_direct_debit/static/description/icon.png differ diff --git a/account_banking_sepa_direct_debit/static/description/icon.svg b/account_banking_sepa_direct_debit/static/description/icon.svg new file mode 100644 index 000000000..c3bc242a4 --- /dev/null +++ b/account_banking_sepa_direct_debit/static/description/icon.svg @@ -0,0 +1,92 @@ + + + +image/svg+xmlDIRECTDEBIT + \ No newline at end of file diff --git a/account_banking_sepa_direct_debit/views/account_banking_mandate_view.xml b/account_banking_sepa_direct_debit/views/account_banking_mandate_view.xml new file mode 100644 index 000000000..a2065dc75 --- /dev/null +++ b/account_banking_sepa_direct_debit/views/account_banking_mandate_view.xml @@ -0,0 +1,118 @@ + + + + + + + sdd.mandate.form + account.banking.mandate + + + + + + + + + + + + + + + + + + sdd.mandate.tree + account.banking.mandate + + + + + + + + + + sdd.mandate.search + account.banking.mandate + + + + + + + + + + + SEPA Direct Debit Mandates + account.banking.mandate + form + tree,form + +

+ Click to create a new SEPA Direct Debit Mandate. +

+ 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. +

+
+
+ + + + + sdd.mandate.res.partner.bank.tree + res.partner.bank + + + + SDD Mandates + + + + + + sdd.mandate.partner.form + res.partner + + + + SDD Mandates + + + + + + Sequence Type set to First + account.banking.mandate + + Sequence Type set to First + + + + Sequence Type set to Recurring + account.banking.mandate + + Sequence Type set to Recurring + + + + Sequence Type set to Final + account.banking.mandate + + Sequence Type set to Final + + +
+
diff --git a/__unported__/account_banking_sepa_direct_debit/account_banking_sdd_view.xml b/account_banking_sepa_direct_debit/views/account_banking_sdd_view.xml similarity index 100% rename from __unported__/account_banking_sepa_direct_debit/account_banking_sdd_view.xml rename to account_banking_sepa_direct_debit/views/account_banking_sdd_view.xml diff --git a/__unported__/account_banking_sepa_direct_debit/company_view.xml b/account_banking_sepa_direct_debit/views/res_company_view.xml similarity index 100% rename from __unported__/account_banking_sepa_direct_debit/company_view.xml rename to account_banking_sepa_direct_debit/views/res_company_view.xml diff --git a/__unported__/account_banking_sepa_direct_debit/wizard/__init__.py b/account_banking_sepa_direct_debit/wizard/__init__.py similarity index 100% rename from __unported__/account_banking_sepa_direct_debit/wizard/__init__.py rename to account_banking_sepa_direct_debit/wizard/__init__.py diff --git a/__unported__/account_banking_sepa_direct_debit/wizard/export_sdd.py b/account_banking_sepa_direct_debit/wizard/export_sdd.py similarity index 81% rename from __unported__/account_banking_sepa_direct_debit/wizard/export_sdd.py rename to account_banking_sepa_direct_debit/wizard/export_sdd.py index 19520d318..aa46ff8b1 100644 --- a/__unported__/account_banking_sepa_direct_debit/wizard/export_sdd.py +++ b/account_banking_sepa_direct_debit/wizard/export_sdd.py @@ -23,40 +23,39 @@ from openerp.osv import orm, fields from openerp.tools.translate import _ -from openerp import netsvc +from openerp import workflow from datetime import datetime from lxml import etree -class banking_export_sdd_wizard(orm.TransientModel): +class BankingExportSddWizard(orm.TransientModel): _name = 'banking.export.sdd.wizard' _inherit = ['banking.export.pain'] _description = 'Export SEPA Direct Debit File' _columns = { - 'state': fields.selection([ - ('create', 'Create'), - ('finish', 'Finish'), - ], 'State', readonly=True), + 'state': fields.selection( + [('create', 'Create'), + ('finish', 'Finish')], 'State', readonly=True), 'batch_booking': fields.boolean( 'Batch Booking', help="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."), - 'charge_bearer': fields.selection([ - ('SLEV', 'Following Service Level'), - ('SHAR', 'Shared'), - ('CRED', 'Borne by Creditor'), - ('DEBT', 'Borne by Debtor'), - ], 'Charge Bearer', required=True, + 'charge_bearer': fields.selection( + [('SLEV', 'Following Service Level'), + ('SHAR', 'Shared'), + ('CRED', 'Borne by Creditor'), + ('DEBT', 'Borne by Debtor')], 'Charge Bearer', required=True, help="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."), + "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."), 'nb_transactions': fields.related( 'file_id', 'nb_transactions', type='integer', string='Number of Transactions', readonly=True), @@ -73,19 +72,19 @@ class banking_export_sdd_wizard(orm.TransientModel): 'payment_order_ids': fields.many2many( 'payment.order', 'wiz_sdd_payorders_rel', 'wizard_id', 'payment_order_id', 'Payment Orders', readonly=True), - } + } _defaults = { 'charge_bearer': 'SLEV', 'state': 'create', - } + } def create(self, cr, uid, vals, context=None): payment_order_ids = context.get('active_ids', []) vals.update({ 'payment_order_ids': [[6, 0, payment_order_ids]], }) - return super(banking_export_sdd_wizard, self).create( + return super(BankingExportSddWizard, self).create( cr, uid, vals, context=context) def _get_previous_bank(self, cr, uid, payline, context=None): @@ -93,7 +92,7 @@ class banking_export_sdd_wizard(orm.TransientModel): previous_bank = False payline_ids = payline_obj.search( cr, uid, [ - ('sdd_mandate_id', '=', payline.sdd_mandate_id.id), + ('mandate_id', '=', payline.mandate_id.id), ('bank_id', '!=', payline.bank_id.id), ], context=context) @@ -115,9 +114,7 @@ class banking_export_sdd_wizard(orm.TransientModel): return previous_bank def create_sepa(self, cr, uid, ids, context=None): - ''' - Creates the SEPA Direct Debit file. That's the important code ! - ''' + """Creates the SEPA Direct Debit file. That's the important code !""" sepa_export = self.browse(cr, uid, ids[0], context=context) pain_flavor = sepa_export.payment_order_ids[0].mode.type.code @@ -139,10 +136,9 @@ class banking_export_sdd_wizard(orm.TransientModel): raise orm.except_orm( _('Error:'), _("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'.") % pain_flavor) - + "Payment Type Code supported for SEPA Direct Debit are " + "'pain.008.001.02', 'pain.008.001.03' and " + "'pain.008.001.04'.") % pain_flavor) gen_args = { 'bic_xml_tag': bic_xml_tag, 'name_maxsize': name_maxsize, @@ -154,20 +150,16 @@ class banking_export_sdd_wizard(orm.TransientModel): 'pain_xsd_file': 'account_banking_sepa_direct_debit/data/%s.xsd' % pain_flavor, } - pain_ns = { 'xsi': 'http://www.w3.org/2001/XMLSchema-instance', None: 'urn:iso:std:iso:20022:tech:xsd:%s' % pain_flavor, - } - + } xml_root = etree.Element('Document', nsmap=pain_ns) pain_root = etree.SubElement(xml_root, root_xml_tag) - # A. Group header group_header_1_0, nb_of_transactions_1_6, control_sum_1_7 = \ self.generate_group_header_block( cr, uid, pain_root, gen_args, context=context) - transactions_count_1_6 = 0 total_amount = 0.0 amount_control_sum_1_7 = 0.0 @@ -188,45 +180,44 @@ class banking_export_sdd_wizard(orm.TransientModel): requested_date = payment_order.date_scheduled or today else: requested_date = today - if not line.sdd_mandate_id: + if not line.mandate_id: raise orm.except_orm( _('Error:'), _("Missing SEPA Direct Debit mandate on the payment " - "line with partner '%s' and Invoice ref '%s'.") + "line with partner '%s' and Invoice ref '%s'.") % (line.partner_id.name, - line.ml_inv_ref.number)) - if line.sdd_mandate_id.state != 'valid': + line.ml_inv_ref.number)) + scheme = line.mandate_id.scheme + if line.mandate_id.state != 'valid': raise orm.except_orm( _('Error:'), _("The SEPA Direct Debit mandate with reference '%s' " - "for partner '%s' has expired.") - % (line.sdd_mandate_id.unique_mandate_reference, - line.sdd_mandate_id.partner_id.name)) - if line.sdd_mandate_id.type == 'oneoff': - if not line.sdd_mandate_id.last_debit_date: - seq_type = 'OOFF' - else: + "for partner '%s' has expired.") + % (line.mandate_id.unique_mandate_reference, + line.mandate_id.partner_id.name)) + if line.mandate_id.type == 'oneoff': + seq_type = 'OOFF' + if line.mandate_id.last_debit_date: raise orm.except_orm( _('Error:'), _("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.") - % (line.sdd_mandate_id.unique_mandate_reference, - line.sdd_mandate_id.partner_id.name, - line.sdd_mandate_id.last_debit_date)) - elif line.sdd_mandate_id.type == 'recurrent': + "'%s' has type set to 'One-Off' and it has a " + "last debit date set to '%s', so we can't use " + "it.") + % (line.mandate_id.unique_mandate_reference, + line.mandate_id.partner_id.name, + line.mandate_id.last_debit_date)) + elif line.mandate_id.type == 'recurrent': seq_type_map = { 'recurring': 'RCUR', 'first': 'FRST', 'final': 'FNAL', - } + } seq_type_label = \ - line.sdd_mandate_id.recurrent_sequence_type + 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) + key = (requested_date, priority, seq_type, scheme) if key in lines_per_group: lines_per_group[key].append(line) else: @@ -237,7 +228,7 @@ class banking_export_sdd_wizard(orm.TransientModel): cr, uid, line.id, {'date': requested_date}, context=context) - for (requested_date, priority, sequence_type), lines in \ + for (requested_date, priority, sequence_type, scheme), lines in \ lines_per_group.items(): # B. Payment info payment_info_2_0, nb_of_transactions_2_4, control_sum_2_5 = \ @@ -246,7 +237,7 @@ class banking_export_sdd_wizard(orm.TransientModel): "sepa_export.payment_order_ids[0].reference + '-' + " "sequence_type + '-' + requested_date.replace('-', '') " "+ '-' + priority", - priority, 'CORE', sequence_type, requested_date, { + priority, scheme, sequence_type, requested_date, { 'sepa_export': sepa_export, 'sequence_type': sequence_type, 'priority': priority, @@ -261,10 +252,8 @@ class banking_export_sdd_wizard(orm.TransientModel): 'sepa_export.payment_order_ids[0].mode.bank_id.bank.bic', {'sepa_export': sepa_export}, gen_args, context=context) - charge_bearer_2_24 = etree.SubElement(payment_info_2_0, 'ChrgBr') charge_bearer_2_24.text = sepa_export.charge_bearer - creditor_scheme_identification_2_27 = etree.SubElement( payment_info_2_0, 'CdtrSchmeId') self.generate_creditor_scheme_identification( @@ -273,7 +262,6 @@ class banking_export_sdd_wizard(orm.TransientModel): 'sepa_creditor_identifier', 'SEPA Creditor Identifier', {'sepa_export': sepa_export}, 'SEPA', gen_args, context=context) - transactions_count_2_4 = 0 amount_control_sum_2_5 = 0.0 for line in lines: @@ -306,22 +294,22 @@ class banking_export_sdd_wizard(orm.TransientModel): mandate_related_info_2_47, 'MndtId') mandate_identification_2_48.text = self._prepare_field( cr, uid, 'Unique Mandate Reference', - 'line.sdd_mandate_id.unique_mandate_reference', + 'line.mandate_id.unique_mandate_reference', {'line': line}, 35, gen_args=gen_args, context=context) mandate_signature_date_2_49 = etree.SubElement( mandate_related_info_2_47, 'DtOfSgntr') mandate_signature_date_2_49.text = self._prepare_field( cr, uid, 'Mandate Signature Date', - 'line.sdd_mandate_id.signature_date', + 'line.mandate_id.signature_date', {'line': line}, 10, gen_args=gen_args, context=context) if sequence_type == 'FRST' and ( - line.sdd_mandate_id.last_debit_date or - not line.sdd_mandate_id.sepa_migrated): + line.mandate_id.last_debit_date or + not line.mandate_id.sepa_migrated): previous_bank = self._get_previous_bank( cr, uid, line, context=context) - if previous_bank or not line.sdd_mandate_id.sepa_migrated: + if previous_bank or not line.mandate_id.sepa_migrated: amendment_indicator_2_50 = etree.SubElement( mandate_related_info_2_47, 'AmdmntInd') amendment_indicator_2_50.text = 'true' @@ -362,13 +350,13 @@ class banking_export_sdd_wizard(orm.TransientModel): ori_debtor_agent_other, 'Id') ori_debtor_agent_other_id.text = 'SMNDA' # SMNDA = Same Mandate New Debtor Agent - elif not line.sdd_mandate_id.sepa_migrated: + elif not line.mandate_id.sepa_migrated: ori_mandate_identification_2_52 = etree.SubElement( amendment_info_details_2_51, 'OrgnlMndtId') ori_mandate_identification_2_52.text = \ self._prepare_field( cr, uid, 'Original Mandate Identification', - 'line.sdd_mandate_id.' + 'line.mandate_id.' 'original_mandate_identification', {'line': line}, gen_args=gen_args, @@ -404,46 +392,42 @@ class banking_export_sdd_wizard(orm.TransientModel): gen_args, context=context) def cancel_sepa(self, cr, uid, ids, context=None): - ''' - Cancel the SEPA file: just drop the file - ''' + """Cancel the SEPA file: just drop the file""" sepa_export = self.browse(cr, uid, ids[0], context=context) self.pool.get('banking.export.sdd').unlink( cr, uid, sepa_export.file_id.id, context=context) return {'type': 'ir.actions.act_window_close'} def save_sepa(self, cr, uid, ids, context=None): - ''' - Save the SEPA Direct Debit file: mark all payments in the file + """Save the SEPA Direct Debit file: mark all payments in the file as 'sent'. Write 'last debit date' on mandate and set oneoff - mandate to expired - ''' + mandate to expired. + """ sepa_export = self.browse(cr, uid, ids[0], context=context) self.pool.get('banking.export.sdd').write( cr, uid, sepa_export.file_id.id, {'state': 'sent'}, context=context) - wf_service = netsvc.LocalService('workflow') for order in sepa_export.payment_order_ids: - wf_service.trg_validate(uid, 'payment.order', order.id, 'done', cr) - mandate_ids = [line.sdd_mandate_id.id for line in order.line_ids] - self.pool['sdd.mandate'].write( + workflow.trg_validate(uid, 'payment.order', order.id, 'done', cr) + mandate_ids = [line.mandate_id.id for line in order.line_ids] + self.pool['account.banking.mandate'].write( cr, uid, mandate_ids, {'last_debit_date': datetime.today().strftime('%Y-%m-%d')}, context=context) to_expire_ids = [] first_mandate_ids = [] for line in order.line_ids: - if line.sdd_mandate_id.type == 'oneoff': - to_expire_ids.append(line.sdd_mandate_id.id) - elif line.sdd_mandate_id.type == 'recurrent': - seq_type = line.sdd_mandate_id.recurrent_sequence_type + if line.mandate_id.type == 'oneoff': + to_expire_ids.append(line.mandate_id.id) + elif line.mandate_id.type == 'recurrent': + seq_type = line.mandate_id.recurrent_sequence_type if seq_type == 'final': - to_expire_ids.append(line.sdd_mandate_id.id) + to_expire_ids.append(line.mandate_id.id) elif seq_type == 'first': - first_mandate_ids.append(line.sdd_mandate_id.id) - self.pool['sdd.mandate'].write( + first_mandate_ids.append(line.mandate_id.id) + self.pool['account.banking.mandate'].write( cr, uid, to_expire_ids, {'state': 'expired'}, context=context) - self.pool['sdd.mandate'].write( + self.pool['account.banking.mandate'].write( cr, uid, first_mandate_ids, { 'recurrent_sequence_type': 'recurring', 'sepa_migrated': True, diff --git a/__unported__/account_banking_sepa_direct_debit/wizard/export_sdd_view.xml b/account_banking_sepa_direct_debit/wizard/export_sdd_view.xml similarity index 100% rename from __unported__/account_banking_sepa_direct_debit/wizard/export_sdd_view.xml rename to account_banking_sepa_direct_debit/wizard/export_sdd_view.xml diff --git a/account_direct_debit/__init__.py b/account_direct_debit/__init__.py new file mode 100644 index 000000000..9b4296142 --- /dev/null +++ b/account_direct_debit/__init__.py @@ -0,0 +1,2 @@ +from . import models +from . import wizard diff --git a/__unported__/account_direct_debit/__openerp__.py b/account_direct_debit/__openerp__.py similarity index 80% rename from __unported__/account_direct_debit/__openerp__.py rename to account_direct_debit/__openerp__.py index 26f6beba7..b7f1660e3 100644 --- a/__unported__/account_direct_debit/__openerp__.py +++ b/account_direct_debit/__openerp__.py @@ -27,10 +27,10 @@ 'category': 'Banking addons', 'depends': ['account_banking_payment_export'], 'data': [ - 'view/account_payment.xml', - 'view/account_invoice.xml', - 'view/payment_mode.xml', - 'view/payment_mode_type.xml', + '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', ], @@ -44,11 +44,6 @@ 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. - -This module depends on and is part of the banking addons for OpenERP. This set -of modules helps you to provide support for communications with your local -banking institutions. The banking addons are a continuation of Account Banking -Framework by Edusense BV. See https://launchpad.net/banking-addons. ''', - 'installable': False, + 'installable': True, } diff --git a/__unported__/account_direct_debit/data/account_payment_term.xml b/account_direct_debit/data/account_payment_term.xml similarity index 100% rename from __unported__/account_direct_debit/data/account_payment_term.xml rename to account_direct_debit/data/account_payment_term.xml diff --git a/__unported__/account_direct_debit/i18n/account_direct_debit.pot b/account_direct_debit/i18n/account_direct_debit.pot similarity index 77% rename from __unported__/account_direct_debit/i18n/account_direct_debit.pot rename to account_direct_debit/i18n/account_direct_debit.pot index c5e80375a..191f17bec 100644 --- a/__unported__/account_direct_debit/i18n/account_direct_debit.pot +++ b/account_direct_debit/i18n/account_direct_debit.pot @@ -1,13 +1,13 @@ -# Translation of OpenERP Server. +# Translation of Odoo Server. # This file contains the translation of the following modules: # * account_direct_debit # msgid "" msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" +"Project-Id-Version: Odoo Server 8.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-10-25 16:01+0000\n" -"PO-Revision-Date: 2013-10-25 16:01+0000\n" +"POT-Creation-Date: 2014-10-31 23:05+0000\n" +"PO-Revision-Date: 2014-10-31 23:05+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -16,59 +16,34 @@ msgstr "" "Plural-Forms: \n" #. module: account_direct_debit -#: model:account.payment.term,note:account_direct_debit.payment_term_direct_debit -msgid "Direct debit in 14 days" +#: model:ir.actions.act_window,help:account_direct_debit.action_debit_order_tree +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 "" #. module: account_direct_debit -#: model:ir.model,name:account_direct_debit.model_payment_order -msgid "Payment Order" +#: field:account.move.line,amount_to_receive:0 +msgid "Amount to receive" msgstr "" #. module: account_direct_debit -#: view:payment.order:0 -msgid "Select Invoices to Collect" -msgstr "" - -#. module: account_direct_debit -#: model:ir.model,name:account_direct_debit.model_payment_line -msgid "Payment Line" -msgstr "" - -#. module: account_direct_debit -#: code:addons/account_direct_debit/model/payment_line.py:140 +#: code:addons/account_direct_debit/models/payment_line.py:133 #, python-format msgid "Can not reconcile" msgstr "" #. module: account_direct_debit -#: view:account.invoice:0 +#: 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 "" #. module: account_direct_debit -#: code:addons/account_direct_debit/model/account_invoice.py:147 -#, python-format -msgid "Error !" -msgstr "" - -#. module: account_direct_debit -#: view:account.invoice:0 -msgid "Show only invoices with state Debit denied" -msgstr "" - -#. module: account_direct_debit -#: view:payment.order:0 -msgid "{'invisible':['|',('state','!=','draft'),('payment_order_type', '!=', 'payment')]}" -msgstr "" - -#. module: account_direct_debit -#: model:ir.model,name:account_direct_debit.model_account_move_line -msgid "Journal Items" -msgstr "" - -#. module: account_direct_debit -#: view:account.invoice:0 +#: view:account.invoice:account_direct_debit.view_account_invoice_filter msgid "Debit denied" msgstr "" @@ -84,31 +59,14 @@ msgid "Direct debit" msgstr "" #. module: account_direct_debit -#: code:addons/account_direct_debit/model/account_invoice.py:148 +#: model:account.payment.term,note:account_direct_debit.payment_term_direct_debit +msgid "Direct debit in 14 days" +msgstr "" + +#. module: account_direct_debit +#: code:addons/account_direct_debit/models/account_invoice.py:149 #, python-format -msgid "You cannot set invoice '%s' to state 'debit denied', as it is still reconciled." -msgstr "" - -#. module: account_direct_debit -#: code:addons/account_direct_debit/model/account_invoice.py:152 -#, python-format -msgid "Invoice '%s': direct debit is denied." -msgstr "" - -#. module: account_direct_debit -#: code:addons/account_direct_debit/model/payment_line.py:141 -#, python-format -msgid "Cancelation of payment line '%s' has already been processed" -msgstr "" - -#. module: account_direct_debit -#: model:ir.model,name:account_direct_debit.model_payment_order_create -msgid "payment.order.create" -msgstr "" - -#. module: account_direct_debit -#: field:payment.line,storno:0 -msgid "Storno" +msgid "Error !" msgstr "" #. module: account_direct_debit @@ -116,18 +74,54 @@ msgstr "" msgid "If this is true, the debit order has been canceled by the bank or by the customer" msgstr "" -#. module: account_direct_debit -#: model:ir.actions.act_window,help:account_direct_debit.action_debit_order_tree -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 "" - -#. module: account_direct_debit -#: field:account.move.line,amount_to_receive:0 -msgid "Amount to receive" -msgstr "" - #. module: account_direct_debit #: model:ir.model,name:account_direct_debit.model_account_invoice msgid "Invoice" msgstr "" +#. module: account_direct_debit +#: code:addons/account_direct_debit/models/account_invoice.py:154 +#, python-format +msgid "Invoice '%s': direct debit is denied." +msgstr "" + +#. module: account_direct_debit +#: view:payment.order:account_direct_debit.view_payment_order_form +msgid "Invoices" +msgstr "" + +#. module: account_direct_debit +#: model:ir.model,name:account_direct_debit.model_account_move_line +msgid "Journal Items" +msgstr "" + +#. module: account_direct_debit +#: model:ir.model,name:account_direct_debit.model_payment_line +msgid "Payment Line" +msgstr "" + +#. module: account_direct_debit +#: model:ir.model,name:account_direct_debit.model_payment_order +msgid "Payment Order" +msgstr "" + +#. module: account_direct_debit +#: view:payment.order:account_direct_debit.view_payment_order_form +msgid "Select invoices to collect" +msgstr "" + +#. module: account_direct_debit +#: view:account.invoice:account_direct_debit.view_account_invoice_filter +msgid "Show only invoices with state Debit denied" +msgstr "" + +#. module: account_direct_debit +#: field:payment.line,storno:0 +msgid "Storno" +msgstr "" + +#. 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 "" diff --git a/account_direct_debit/i18n/es.po b/account_direct_debit/i18n/es.po new file mode 100644 index 000000000..d5aacd581 --- /dev/null +++ b/account_direct_debit/i18n/es.po @@ -0,0 +1,127 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_direct_debit +# +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" +"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_direct_debit +#: model:ir.actions.act_window,help:account_direct_debit.action_debit_order_tree +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 +msgid "Direct Debit Orders" +msgstr "Órdenes de cobro" + +#. module: account_direct_debit +#: model:account.payment.term,name:account_direct_debit.payment_term_direct_debit +msgid "Direct debit" +msgstr "Cobro" + +#. module: account_direct_debit +#: model:account.payment.term,note:account_direct_debit.payment_term_direct_debit +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" +msgstr "Facturas" + +#. module: account_direct_debit +#: model:ir.model,name:account_direct_debit.model_account_move_line +msgid "Journal Items" +msgstr "Asientos 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" + +#. module: account_direct_debit +#: field:payment.line,storno:0 +msgid "Storno" +msgstr "Storno" + +#. 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." diff --git a/__unported__/account_direct_debit/i18n/nl.po b/account_direct_debit/i18n/nl.po similarity index 100% rename from __unported__/account_direct_debit/i18n/nl.po rename to account_direct_debit/i18n/nl.po diff --git a/account_direct_debit/models/__init__.py b/account_direct_debit/models/__init__.py new file mode 100644 index 000000000..ffb948151 --- /dev/null +++ b/account_direct_debit/models/__init__.py @@ -0,0 +1,4 @@ +from . import account_payment +from . import payment_line +from . import account_move_line +from . import account_invoice diff --git a/__unported__/account_direct_debit/model/account_invoice.py b/account_direct_debit/models/account_invoice.py similarity index 95% rename from __unported__/account_direct_debit/model/account_invoice.py rename to account_direct_debit/models/account_invoice.py index fe2e92337..cf29c6ef5 100644 --- a/__unported__/account_direct_debit/model/account_invoice.py +++ b/account_direct_debit/models/account_invoice.py @@ -22,9 +22,6 @@ # ############################################################################## -from openerp.osv import orm -from openerp.tools.translate import _ - """ This module adds support for Direct debit orders as applicable in the Netherlands. Debit orders are advanced in total by the bank. @@ -39,7 +36,7 @@ Invoice workflow: Balance: Debtors 2000 | - Sales | 2000 + Sales | 2000 2 an external booking takes place 1100 Bank 100 @@ -105,8 +102,8 @@ Two cases need to be distinguisted: 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 + 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) @@ -122,8 +119,11 @@ Two cases need to be distinguisted: open invoices with a matured invoice- or due date. """ +from openerp.osv import orm +from openerp.tools.translate import _ -class account_invoice(orm.Model): + +class AccountInvoice(orm.Model): _inherit = "account.invoice" def __init__(self, pool, cr): @@ -135,7 +135,7 @@ class account_invoice(orm.Model): Maybe apply a similar trick when overriding the buttons' 'states' attributes in the form view, manipulating the xml in fields_view_get(). """ - super(account_invoice, self).__init__(pool, cr) + super(AccountInvoice, self).__init__(pool, cr) invoice_obj = pool.get('account.invoice') invoice_obj._columns['state'].selection.append( ('debit_denied', 'Debit denied')) @@ -147,8 +147,8 @@ class account_invoice(orm.Model): 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) + _("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 diff --git a/__unported__/account_direct_debit/model/account_move_line.py b/account_direct_debit/models/account_move_line.py similarity index 86% rename from __unported__/account_direct_debit/model/account_move_line.py rename to account_direct_debit/models/account_move_line.py index 12842e45f..88b73f84f 100644 --- a/__unported__/account_direct_debit/model/account_move_line.py +++ b/account_direct_debit/models/account_move_line.py @@ -24,12 +24,11 @@ from operator import itemgetter from openerp.osv import fields, orm -class account_move_line(orm.Model): +class AccountMoveLine(orm.Model): _inherit = "account.move.line" - def amount_to_receive(self, cr, uid, ids, name, arg={}, context=None): - """ - Return the amount still to receive regarding all the debit orders + 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 @@ -49,13 +48,12 @@ class account_move_line(orm.Model): AND pl.storno is false AND po.state != 'cancel') AS amount FROM account_move_line ml - WHERE id IN %s""", (tuple(ids), )) + 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() + """Reverse of account_payment/account_move_line.py:_to_pay_search(). """ if not args: return [] @@ -81,23 +79,20 @@ class account_move_line(orm.Model): WHERE type=%s AND active) AND reconcile_id IS null AND debit > 0 - AND ''' + where + ' and ' + query), ('receivable', ) + sql_args) - + 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))] + return [('id', 'in', map(lambda x:x[0], res))] def line2bank(self, cr, uid, ids, payment_mode_id, context=None): - '''I have to inherit this function for direct debits to fix the + """I have to inherit this function for direct debits to fix the following issue : if the customer invoice has a value for 'partner_bank_id', then it will take this partner_bank_id in the payment line... but, on a customer invoice, the partner_bank_id is the bank account of the company, not the bank account of the customer ! - ''' - if context is None: - context = {} + """ pay_mode_obj = self.pool['payment.mode'] if payment_mode_id: pay_mode = pay_mode_obj.browse( @@ -114,12 +109,12 @@ class account_move_line(orm.Model): line2bank[line.id] = bank.id break return line2bank - return super(account_move_line, self).line2bank( + return super(AccountMoveLine, self).line2bank( cr, uid, ids, payment_mode_id, context=context) _columns = { 'amount_to_receive': fields.function( - amount_to_receive, method=True, + _amount_to_receive, method=True, type='float', string='Amount to receive', fnct_search=_to_receive_search), - } + } diff --git a/__unported__/account_direct_debit/model/account_payment.py b/account_direct_debit/models/account_payment.py similarity index 76% rename from __unported__/account_direct_debit/model/account_payment.py rename to account_direct_debit/models/account_payment.py index b346efec3..702477107 100644 --- a/__unported__/account_direct_debit/model/account_payment.py +++ b/account_direct_debit/models/account_payment.py @@ -2,12 +2,11 @@ from openerp.osv import orm -class payment_order(orm.Model): +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 + """Called from the workflow. Used to unset done state on payment orders that were reconciled with bank transfers which are being cancelled """ @@ -16,5 +15,5 @@ class payment_order(orm.Model): for line in order.line_ids: if line.storno: return False - return super(payment_order, self).test_undo_done( + return super(PaymentOrder, self).test_undo_done( cr, uid, ids, context=context) diff --git a/__unported__/account_direct_debit/model/payment_line.py b/account_direct_debit/models/payment_line.py similarity index 67% rename from __unported__/account_direct_debit/model/payment_line.py rename to account_direct_debit/models/payment_line.py index 2be0993db..c5fbe1898 100644 --- a/__unported__/account_direct_debit/model/payment_line.py +++ b/account_direct_debit/models/payment_line.py @@ -1,16 +1,15 @@ # -*- coding: utf-8 -*- from openerp.osv import orm, fields -import netsvc -from tools.translate import _ +from openerp import netsvc +from openerp.tools.translate import _ -class payment_line(orm.Model): +class PaymentLine(orm.Model): _inherit = 'payment.line' def debit_storno(self, cr, uid, payment_line_id, amount, currency, storno_retry=True, context=None): - """ - The processing of a storno is triggered by a debit + """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 @@ -23,15 +22,13 @@ class payment_line(orm.Model): :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. + :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. """ - reconcile_obj = self.pool.get('account.move.reconcile') line = self.browse(cr, uid, payment_line_id) - transit_move_line = line.transit_move_line_id reconcile_id = False if (line.transit_move_line_id and not line.storno and self.pool.get('res.currency').is_zero( @@ -44,52 +41,52 @@ class payment_line(orm.Model): # 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 transit_move_line.reconcile_partial_id: - reconcile_id = transit_move_line.reconcile_partial_id.id - if len(transit_move_line.reconcile_id.line_partial_ids) == 2: + if line.transit_move_line_id.reconcile_partial_id: + reconcile_id = \ + line.transit_move_line_id.reconcile_partial_id.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_obj.write( - cr, uid, reconcile_id, { - 'line_id': [(6, 0, transit_move_line.id)], - 'line_partial_ids': [(6, 0, [])], - }, context=context) + cr, uid, reconcile_id, + {'line_id': [(6, 0, line.transit_move_line_id.id)], + 'line_partial_ids': [(6, 0, [])]}, context=context) else: # split up the original reconcile in a partial one # and a new one for reconciling the storno transfer + reconcile = { + 'line_partial_ids': [(3, line.transit_move_line_id.id)] + } reconcile_obj.write( - cr, uid, reconcile_id, { - 'line_partial_ids': [(3, transit_move_line.id)], - }, context=context) + cr, uid, reconcile_id, reconcile, context=context) reconcile_id = reconcile_obj.create( - cr, uid, { - 'type': 'auto', - 'line_id': [(6, 0, transit_move_line.id)], - }, context=context) - elif transit_move_line.reconcile_id: - reconcile_id = transit_move_line.reconcile_id.id - if len(transit_move_line.reconcile_id.line_id) == 2: + cr, uid, + {'type': 'auto', + 'line_id': [(6, 0, line.transit_move_line_id.id)]}, + context=context) + elif line.transit_move_line_id.reconcile_id: + reconcile_id = line.transit_move_line_id.reconcile_id.id + if len(line.transit_move_line_id.reconcile_id.line_id) == 2: # reuse the simple reconcile for the storno transfer reconcile_obj.write( - cr, uid, reconcile_id, { - 'line_id': [(6, 0, [transit_move_line.id])] - }, context=context) + cr, uid, reconcile_id, + {'line_id': [(6, 0, [line.transit_move_line_id.id])]}, + context=context) else: # split up the original reconcile in a partial one # and a new one for reconciling the storno transfer - partial_ids = [ - x.id for x in transit_move_line.reconcile_id.line_id - if x.id != transit_move_line.id - ] + 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_obj.write( - cr, uid, reconcile_id, { - 'line_partial_ids': [(6, 0, partial_ids)], - 'line_id': [(6, 0, [])], - }, context=context) + cr, uid, reconcile_id, + {'line_partial_ids': [(6, 0, partial_ids)], + 'line_id': [(6, 0, [])]}, context=context) reconcile_id = reconcile_obj.create( - cr, uid, { - 'type': 'auto', - 'line_id': [(6, 0, transit_move_line.id)], - }, context=context) + cr, uid, + {'type': 'auto', + 'line_id': [(6, 0, line.transit_move_line_id.id)]}, + context=context) # mark the payment line for storno processed if reconcile_id: self.write(cr, uid, [payment_line_id], @@ -103,10 +100,9 @@ class payment_line(orm.Model): activity, cr) return reconcile_id - def get_storno_account_id(self, cr, uid, payment_line_id, amount, - currency, context=None): - """ - Check the match of the arguments, and return the account associated + def get_storno_account_id( + self, cr, uid, payment_line_id, amount, currency, context=None): + """Check the match of the arguments, and return the account associated with the storno. Used in account_banking interactive mode @@ -116,7 +112,6 @@ class payment_line(orm.Model): :return: an account if there is a full match, False otherwise :rtype: database id of an account.account resource. """ - line = self.browse(cr, uid, payment_line_id) account_id = False if (line.transit_move_line_id and not line.storno and @@ -128,9 +123,7 @@ class payment_line(orm.Model): return account_id def debit_reconcile(self, cr, uid, payment_line_id, context=None): - """ - Raise if a payment line is passed for which storno is True - """ + """Raise if a payment line is passed for which storno is True.""" if isinstance(payment_line_id, (list, tuple)): payment_line_id = payment_line_id[0] payment_line_vals = self.read( @@ -140,7 +133,7 @@ class payment_line(orm.Model): _('Can not reconcile'), _('Cancelation of payment line \'%s\' has already been ' 'processed') % payment_line_vals['name']) - return super(payment_line, self).debit_reconcile( + return super(PaymentLine, self).debit_reconcile( cr, uid, payment_line_id, context=context) _columns = { @@ -149,4 +142,4 @@ class payment_line(orm.Model): readonly=True, help=("If this is true, the debit order has been canceled " "by the bank or by the customer")), - } + } diff --git a/__unported__/account_direct_debit/view/account_invoice.xml b/account_direct_debit/views/account_invoice.xml similarity index 100% rename from __unported__/account_direct_debit/view/account_invoice.xml rename to account_direct_debit/views/account_invoice.xml diff --git a/__unported__/account_direct_debit/view/account_payment.xml b/account_direct_debit/views/account_payment.xml similarity index 71% rename from __unported__/account_direct_debit/view/account_payment.xml rename to account_direct_debit/views/account_payment.xml index b5cbd73b2..8570789da 100644 --- a/__unported__/account_direct_debit/view/account_payment.xml +++ b/account_direct_debit/views/account_payment.xml @@ -19,7 +19,7 @@ [('payment_order_type', '=', 'debit')] 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.
- + @@ -29,23 +29,22 @@ - - - - - - {'invisible':['|',('state','!=','draft'),('payment_order_type', '!=', 'payment')]} - - - - +
+
[('payment_order_type', '=', payment_order_type)] diff --git a/__unported__/account_direct_debit/view/payment_mode.xml b/account_direct_debit/views/payment_mode.xml similarity index 100% rename from __unported__/account_direct_debit/view/payment_mode.xml rename to account_direct_debit/views/payment_mode.xml diff --git a/__unported__/account_direct_debit/view/payment_mode_type.xml b/account_direct_debit/views/payment_mode_type.xml similarity index 52% rename from __unported__/account_direct_debit/view/payment_mode_type.xml rename to account_direct_debit/views/payment_mode_type.xml index eb726750d..54c14367d 100644 --- a/__unported__/account_direct_debit/view/payment_mode_type.xml +++ b/account_direct_debit/views/payment_mode_type.xml @@ -2,15 +2,26 @@ - + + view.payment.mode.type.tree + payment.mode.type + + + + + + + + view.payment.mode.type.form payment.mode.type - + diff --git a/account_direct_debit/wizard/__init__.py b/account_direct_debit/wizard/__init__.py new file mode 100644 index 000000000..cbcdda94a --- /dev/null +++ b/account_direct_debit/wizard/__init__.py @@ -0,0 +1 @@ +from . import payment_order_create diff --git a/__unported__/account_direct_debit/model/payment_order_create.py b/account_direct_debit/wizard/payment_order_create.py similarity index 68% rename from __unported__/account_direct_debit/model/payment_order_create.py rename to account_direct_debit/wizard/payment_order_create.py index 5625faac2..046860ab7 100644 --- a/__unported__/account_direct_debit/model/payment_order_create.py +++ b/account_direct_debit/wizard/payment_order_create.py @@ -22,20 +22,20 @@ # ############################################################################## -from openerp.osv import orm +from openerp import models, api -class payment_order_create(orm.TransientModel): +class PaymentOrderCreate(models.TransientModel): _inherit = 'payment.order.create' - def extend_payment_order_domain( - self, cr, uid, payment_order, domain, context=None): - super(payment_order_create, self).extend_payment_order_domain( - cr, uid, payment_order, domain, context=context) + @api.model + def extend_payment_order_domain(self, payment_order, domain): + super(PaymentOrderCreate, self).extend_payment_order_domain( + payment_order, domain) if payment_order.payment_order_type == 'debit': - domain += [ - ('account_id.type', '=', 'receivable'), - ('invoice.state', '!=', 'debit_denied'), - ('amount_to_receive', '>', 0), - ] + domain += ['|', + ('invoice', '=', False), + ('invoice.state', '!=', 'debit_denied'), + ('account_id.type', '=', 'receivable'), + ('amount_to_receive', '>', 0)] return True diff --git a/__unported__/account_direct_debit/workflow/account_invoice.xml b/account_direct_debit/workflow/account_invoice.xml similarity index 100% rename from __unported__/account_direct_debit/workflow/account_invoice.xml rename to account_direct_debit/workflow/account_invoice.xml diff --git a/account_payment_partner/__init__.py b/account_payment_partner/__init__.py new file mode 100644 index 000000000..fe47437f2 --- /dev/null +++ b/account_payment_partner/__init__.py @@ -0,0 +1,24 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Account Payment Partner module for OpenERP +# Copyright (C) 2014 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# +# 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 . +# +############################################################################## + +from . import models +from . import wizard diff --git a/__unported__/account_payment_partner/__openerp__.py b/account_payment_partner/__openerp__.py similarity index 88% rename from __unported__/account_payment_partner/__openerp__.py rename to account_payment_partner/__openerp__.py index 1a2ffeea9..3f3a51f3f 100644 --- a/__unported__/account_payment_partner/__openerp__.py +++ b/account_payment_partner/__openerp__.py @@ -39,18 +39,15 @@ This module adds severals fields : On a Payment Order, in the wizard *Select Invoices to Pay*, the invoices will be filtered per Payment Mode. - -Please contact Alexis de Lattre from Akretion -for any help or question about this module. """, 'author': 'Akretion', 'website': 'http://www.akretion.com', + 'contributors': ['Pedro M. Baeza '], 'depends': ['account_banking_payment_export'], 'data': [ - 'view/partner.xml', - 'view/account_invoice.xml', + 'views/res_partner_view.xml', + 'views/account_invoice_view.xml', ], 'demo': ['demo/partner_demo.xml'], - 'active': False, - 'installable': False, + 'installable': True, } diff --git a/__unported__/account_payment_partner/demo/partner_demo.xml b/account_payment_partner/demo/partner_demo.xml similarity index 100% rename from __unported__/account_payment_partner/demo/partner_demo.xml rename to account_payment_partner/demo/partner_demo.xml diff --git a/account_payment_partner/i18n/account_payment_partner.pot b/account_payment_partner/i18n/account_payment_partner.pot new file mode 100644 index 000000000..3c5a39686 --- /dev/null +++ b/account_payment_partner/i18n/account_payment_partner.pot @@ -0,0 +1,52 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_payment_partner +# +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" +"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_payment_partner +#: field:res.partner,customer_payment_mode:0 +msgid "Customer Payment Mode" +msgstr "" + +#. module: account_payment_partner +#: model:ir.model,name:account_payment_partner.model_account_invoice +msgid "Invoice" +msgstr "" + +#. module: account_payment_partner +#: model:ir.model,name:account_payment_partner.model_res_partner +msgid "Partner" +msgstr "" + +#. module: account_payment_partner +#: field:account.invoice,payment_mode_id:0 +msgid "Payment Mode" +msgstr "" + +#. module: account_payment_partner +#: help:res.partner,customer_payment_mode:0 +msgid "Select the default payment mode for this customer." +msgstr "" + +#. module: account_payment_partner +#: help:res.partner,supplier_payment_mode:0 +msgid "Select the default payment mode for this supplier." +msgstr "" + +#. module: account_payment_partner +#: field:res.partner,supplier_payment_mode:0 +msgid "Supplier Payment Mode" +msgstr "" + diff --git a/account_payment_partner/i18n/es.po b/account_payment_partner/i18n/es.po new file mode 100644 index 000000000..63748b988 --- /dev/null +++ b/account_payment_partner/i18n/es.po @@ -0,0 +1,52 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_payment_partner +# +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" +"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_payment_partner +#: field:res.partner,customer_payment_mode:0 +msgid "Customer Payment Mode" +msgstr "Modo de pago de cliente" + +#. module: account_payment_partner +#: model:ir.model,name:account_payment_partner.model_account_invoice +msgid "Invoice" +msgstr "Factura" + +#. module: account_payment_partner +#: model:ir.model,name:account_payment_partner.model_res_partner +msgid "Partner" +msgstr "Empresa" + +#. module: account_payment_partner +#: field:account.invoice,payment_mode_id:0 +msgid "Payment Mode" +msgstr "Modo de pago" + +#. module: account_payment_partner +#: help:res.partner,customer_payment_mode:0 +msgid "Select the default payment mode for this customer." +msgstr "Seleccione el modo de pago por defecto cuando esta empresa actúa como cliente." + +#. module: account_payment_partner +#: help:res.partner,supplier_payment_mode:0 +msgid "Select the default payment mode for this supplier." +msgstr "Seleccione el modo de pago por defecto cuando esta empresa actúa como proveedor." + +#. module: account_payment_partner +#: field:res.partner,supplier_payment_mode:0 +msgid "Supplier Payment Mode" +msgstr "Modo de pago de proveedor" + diff --git a/__unported__/account_payment_partner/i18n/account_payment_partner.pot b/account_payment_partner/i18n/fr.po similarity index 100% rename from __unported__/account_payment_partner/i18n/account_payment_partner.pot rename to account_payment_partner/i18n/fr.po diff --git a/__unported__/account_payment_partner/i18n/nl.po b/account_payment_partner/i18n/nl.po similarity index 100% rename from __unported__/account_payment_partner/i18n/nl.po rename to account_payment_partner/i18n/nl.po diff --git a/__unported__/account_payment_partner/model/__init__.py b/account_payment_partner/models/__init__.py similarity index 94% rename from __unported__/account_payment_partner/model/__init__.py rename to account_payment_partner/models/__init__.py index 16ab8bc9e..c2c7b405d 100644 --- a/__unported__/account_payment_partner/model/__init__.py +++ b/account_payment_partner/models/__init__.py @@ -20,6 +20,5 @@ # ############################################################################## -from . import partner +from . import res_partner from . import account_invoice -from . import payment_order_create diff --git a/__unported__/account_payment_partner/model/account_invoice.py b/account_payment_partner/models/account_invoice.py similarity index 65% rename from __unported__/account_payment_partner/model/account_invoice.py rename to account_payment_partner/models/account_invoice.py index 607cda29a..e14c0d956 100644 --- a/__unported__/account_payment_partner/model/account_invoice.py +++ b/account_payment_partner/models/account_invoice.py @@ -20,37 +20,34 @@ # ############################################################################## -from openerp.osv import orm, fields +from openerp import models, fields, api -class account_invoice(orm.Model): +class AccountInvoice(models.Model): _inherit = 'account.invoice' - _columns = { - 'payment_mode_id': fields.many2one( - 'payment.mode', 'Payment Mode'), - } + payment_mode_id = fields.Many2one( + comodel_name='payment.mode', string="Payment Mode", + domain="[('type', '=', type)]") + @api.multi def onchange_partner_id( - self, cr, uid, ids, type, partner_id, date_invoice=False, + self, type, partner_id, date_invoice=False, payment_term=False, partner_bank_id=False, company_id=False): - res = super(account_invoice, self).onchange_partner_id( - cr, uid, ids, type, partner_id, date_invoice=date_invoice, + res = super(AccountInvoice, self).onchange_partner_id( + type, partner_id, date_invoice=date_invoice, payment_term=payment_term, partner_bank_id=partner_bank_id, company_id=company_id) if partner_id: - partner = self.pool['res.partner'].browse(cr, uid, partner_id) + partner = self.env['res.partner'].browse(partner_id) if type == 'in_invoice': res['value']['payment_mode_id'] = \ - partner.supplier_payment_mode.id or False + partner.supplier_payment_mode.id elif type == 'out_invoice': res['value'].update({ - 'payment_mode_id': - partner.customer_payment_mode.id or False, - 'partner_bank_id': - partner.customer_payment_mode and - partner.customer_payment_mode.bank_id.id or False, - }) + 'payment_mode_id': partner.customer_payment_mode.id, + 'partner_bank_id': partner.customer_payment_mode.bank_id.id + }) else: res['value']['payment_mode_id'] = False return res diff --git a/__unported__/account_payment_partner/model/payment_order_create.py b/account_payment_partner/models/payment_order_create.py similarity index 91% rename from __unported__/account_payment_partner/model/payment_order_create.py rename to account_payment_partner/models/payment_order_create.py index ea8b1ccb3..3b9b536a7 100644 --- a/__unported__/account_payment_partner/model/payment_order_create.py +++ b/account_payment_partner/models/payment_order_create.py @@ -23,17 +23,16 @@ from openerp.osv import orm -class payment_order_create(orm.TransientModel): +class PaymentOrderCreate(orm.TransientModel): _inherit = 'payment.order.create' def extend_payment_order_domain( self, cr, uid, payment_order, domain, context=None): - super(payment_order_create, self).extend_payment_order_domain( + super(PaymentOrderCreate, self).extend_payment_order_domain( cr, uid, payment_order, domain, context=context) domain += [ '|', '|', ('invoice', '=', False), ('invoice.payment_mode_id', '=', False), - ('invoice.payment_mode_id', '=', payment_order.mode.id) - ] + ('invoice.payment_mode_id', '=', payment_order.mode.id)] return True diff --git a/__unported__/account_payment_partner/model/partner.py b/account_payment_partner/models/res_partner.py similarity index 60% rename from __unported__/account_payment_partner/model/partner.py rename to account_payment_partner/models/res_partner.py index 4bfe4c787..5726da446 100644 --- a/__unported__/account_payment_partner/model/partner.py +++ b/account_payment_partner/models/res_partner.py @@ -20,25 +20,23 @@ # ############################################################################## -from openerp.osv import orm, fields +from openerp import models, fields, api -class res_partner(orm.Model): +class ResPartner(models.Model): _inherit = 'res.partner' - _columns = { - 'supplier_payment_mode': fields.property( - 'payment.mode', type='many2one', relation='payment.mode', - string='Supplier Payment Mode', view_load=True, - help="Select the default payment mode for this supplier."), - 'customer_payment_mode': fields.property( - 'payment.mode', type='many2one', relation='payment.mode', - string='Customer Payment Mode', view_load=True, - help="Select the default payment mode for this customer."), - } + supplier_payment_mode = fields.Many2one( + 'payment.mode', string='Supplier Payment Mode', company_dependent=True, + domain="[('purchase_ok', '=', True)]", + help="Select the default payment mode for this supplier.") + customer_payment_mode = fields.Many2one( + 'payment.mode', string='Customer Payment Mode', company_dependent=True, + domain="[('sale_ok', '=', True)]", + help="Select the default payment mode for this customer.") - def _commercial_fields(self, cr, uid, context=None): - res = super(res_partner, self)._commercial_fields( - cr, uid, context=context) + @api.model + def _commercial_fields(self): + res = super(ResPartner, self)._commercial_fields() res += ['supplier_payment_mode', 'customer_payment_mode'] return res diff --git a/account_payment_partner/views/account_invoice_view.xml b/account_payment_partner/views/account_invoice_view.xml new file mode 100644 index 000000000..534822ea9 --- /dev/null +++ b/account_payment_partner/views/account_invoice_view.xml @@ -0,0 +1,40 @@ + + + + + + + + + + account_payment_partner.invoice_form + account.invoice + + + + + + + + + + + account_payment_partner.invoice_supplier_form + account.invoice + + + + + + + + + + + diff --git a/__unported__/account_payment_partner/view/partner.xml b/account_payment_partner/views/res_partner_view.xml similarity index 75% rename from __unported__/account_payment_partner/view/partner.xml rename to account_payment_partner/views/res_partner_view.xml index 02eb8cc0f..3c6d670aa 100644 --- a/__unported__/account_payment_partner/view/partner.xml +++ b/account_payment_partner/views/res_partner_view.xml @@ -9,23 +9,19 @@ - account_partner_payment.partner_form res.partner - + - + - diff --git a/__unported__/account_payment_partner/__init__.py b/account_payment_partner/wizard/__init__.py similarity index 96% rename from __unported__/account_payment_partner/__init__.py rename to account_payment_partner/wizard/__init__.py index 161123944..f7107a63f 100644 --- a/__unported__/account_payment_partner/__init__.py +++ b/account_payment_partner/wizard/__init__.py @@ -20,4 +20,4 @@ # ############################################################################## -from . import model +from . import payment_order_create diff --git a/account_payment_partner/wizard/payment_order_create.py b/account_payment_partner/wizard/payment_order_create.py new file mode 100644 index 000000000..c26b7f9d9 --- /dev/null +++ b/account_payment_partner/wizard/payment_order_create.py @@ -0,0 +1,37 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Account Payment Partner module for OpenERP +# Copyright (C) 2014 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# +# 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 . +# +############################################################################## + +from openerp import models, api + + +class PaymentOrderCreate(models.TransientModel): + _inherit = 'payment.order.create' + + @api.model + def extend_payment_order_domain(self, payment_order, domain): + res = super(PaymentOrderCreate, self).extend_payment_order_domain( + payment_order, domain) + domain += ['|', '|', + ('invoice', '=', False), + ('invoice.payment_mode_id', '=', False), + ('invoice.payment_mode_id', '=', payment_order.mode.id)] + return res diff --git a/__unported__/account_payment_purchase/__init__.py b/account_payment_purchase/__init__.py similarity index 98% rename from __unported__/account_payment_purchase/__init__.py rename to account_payment_purchase/__init__.py index 59199014f..b21037b9f 100644 --- a/__unported__/account_payment_purchase/__init__.py +++ b/account_payment_purchase/__init__.py @@ -20,4 +20,4 @@ # ############################################################################## -from . import model +from . import models diff --git a/__unported__/account_payment_purchase/__openerp__.py b/account_payment_purchase/__openerp__.py similarity index 75% rename from __unported__/account_payment_purchase/__openerp__.py rename to account_payment_purchase/__openerp__.py index 25a2a73b7..283d67477 100644 --- a/__unported__/account_payment_purchase/__openerp__.py +++ b/account_payment_purchase/__openerp__.py @@ -30,26 +30,26 @@ Account Payment Purchase ======================== -This modules adds 2 fields on purchase orders : *Bank Account* and *Payment +This module adds 2 fields on purchase orders: *Bank Account* and *Payment Mode*. These fields are copied from partner to purchase order and then from purchase order to supplier invoice. -This module is similar to the *purchase_payment* module ; the main difference +This module is similar to the *purchase_payment* module; the main difference is that it doesn't depend on the *account_payment_extension* module (it's not -the only module to conflict with *account_payment_extension* ; all the SEPA -modules in the banking addons conflict with *account_payment_extension*, cf -banking-addons-70/account_banking_payment_export/__openerp__.py). - -Please contact Alexis de Lattre from Akretion -for any help or question about this module. +the only module to conflict with *account_payment_extension*; all the SEPA +modules in the banking addons conflict with *account_payment_extension*). """, 'author': 'Akretion', 'website': 'http://www.akretion.com', - 'depends': ['purchase', 'account_payment_partner'], + 'contributors': ['Pedro M. Baeza '], + 'depends': [ + 'purchase', + 'account_payment_partner' + ], 'conflicts': ['purchase_payment'], 'data': [ - 'view/purchase.xml', + 'views/purchase_order_view.xml', ], - 'installable': False, - 'active': False, + 'installable': True, + 'auto_install': True, } diff --git a/__unported__/account_payment_purchase/i18n/account_payment_purchase.pot b/account_payment_purchase/i18n/account_payment_purchase.pot similarity index 86% rename from __unported__/account_payment_purchase/i18n/account_payment_purchase.pot rename to account_payment_purchase/i18n/account_payment_purchase.pot index 17ed963d5..a00a36e87 100644 --- a/__unported__/account_payment_purchase/i18n/account_payment_purchase.pot +++ b/account_payment_purchase/i18n/account_payment_purchase.pot @@ -1,13 +1,13 @@ -# Translation of OpenERP Server. +# Translation of Odoo Server. # This file contains the translation of the following modules: # * account_payment_purchase # msgid "" msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" +"Project-Id-Version: Odoo Server 8.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-06-09 23:23+0000\n" -"PO-Revision-Date: 2014-06-09 23:23+0000\n" +"POT-Creation-Date: 2014-10-31 22:55+0000\n" +"PO-Revision-Date: 2014-10-31 22:55+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" diff --git a/account_payment_purchase/i18n/es.po b/account_payment_purchase/i18n/es.po new file mode 100644 index 000000000..b170125d9 --- /dev/null +++ b/account_payment_purchase/i18n/es.po @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_payment_purchase +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-10-31 22:55+0000\n" +"PO-Revision-Date: 2014-10-31 22:55+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_payment_purchase +#: field:purchase.order,payment_mode_id:0 +msgid "Payment Mode" +msgstr "Modo de pago" + +#. module: account_payment_purchase +#: model:ir.model,name:account_payment_purchase.model_stock_picking +msgid "Picking List" +msgstr "Albarán" + +#. module: account_payment_purchase +#: model:ir.model,name:account_payment_purchase.model_purchase_order +msgid "Purchase Order" +msgstr "Pedido de compra" + +#. module: account_payment_purchase +#: help:purchase.order,supplier_partner_bank_id:0 +msgid "Select the bank account of your supplier on which your company should send the payment. This field is copied from the partner and will be copied to the supplier invoice." +msgstr "Seleccione la cuenta bancaria de su proveedor a la que la compañía debe enviar el pago. Este campo se copia del proveedor si está rellenado, y se trasladará a la factura de proveedor." + +#. module: account_payment_purchase +#: field:purchase.order,supplier_partner_bank_id:0 +msgid "Supplier Bank Account" +msgstr "Cuenta bancaria del proveedor" + diff --git a/__unported__/account_payment_purchase/i18n/fr.po b/account_payment_purchase/i18n/fr.po similarity index 100% rename from __unported__/account_payment_purchase/i18n/fr.po rename to account_payment_purchase/i18n/fr.po diff --git a/__unported__/account_payment_purchase/i18n/nl.po b/account_payment_purchase/i18n/nl.po similarity index 100% rename from __unported__/account_payment_purchase/i18n/nl.po rename to account_payment_purchase/i18n/nl.po diff --git a/__unported__/account_payment_purchase/model/__init__.py b/account_payment_purchase/models/__init__.py similarity index 94% rename from __unported__/account_payment_purchase/model/__init__.py rename to account_payment_purchase/models/__init__.py index fe39c6366..3d13bc0e4 100644 --- a/__unported__/account_payment_purchase/model/__init__.py +++ b/account_payment_purchase/models/__init__.py @@ -20,5 +20,5 @@ # ############################################################################## -from . import purchase -from . import stock +from . import purchase_order +from . import stock_picking diff --git a/account_payment_purchase/models/purchase_order.py b/account_payment_purchase/models/purchase_order.py new file mode 100644 index 000000000..26d08dd23 --- /dev/null +++ b/account_payment_purchase/models/purchase_order.py @@ -0,0 +1,63 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Account Payment Purchase module for OpenERP +# Copyright (C) 2014 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# +# 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 . +# +############################################################################## + +from openerp import models, fields, api + + +class PurchaseOrder(models.Model): + _inherit = "purchase.order" + + supplier_partner_bank_id = fields.Many2one( + 'res.partner.bank', string='Supplier Bank Account', + domain="[('partner_id', '=', partner_id)]", + help="Select the bank account of your supplier on which your company " + "should send the payment. This field is copied from the partner " + "and will be copied to the supplier invoice.") + payment_mode_id = fields.Many2one( + 'payment.mode', string='Payment Mode', + domain="[('purchase_ok', '=', True)]") + + @api.model + def _get_default_supplier_partner_bank(self, partner): + """This function is designed to be inherited""" + return partner.bank_ids and partner.bank_ids[0].id or False + + @api.multi + def onchange_partner_id(self, partner_id): + res = super(PurchaseOrder, self).onchange_partner_id(partner_id) + if partner_id: + partner = self.env['res.partner'].browse(partner_id) + res['value']['supplier_partner_bank_id'] = \ + self._get_default_supplier_partner_bank(partner) + res['value']['payment_mode_id'] = partner.supplier_payment_mode.id + else: + res['value']['supplier_partner_bank_id'] = False + res['value']['payment_mode_id'] = False + return res + + @api.model + def _prepare_invoice(self, order, line_ids): + res = super(PurchaseOrder, self)._prepare_invoice(order, line_ids) + if order: + res['partner_bank_id'] = order.supplier_partner_bank_id.id + res['payment_mode_id'] = order.payment_mode_id.id + return res diff --git a/__unported__/account_payment_purchase/model/stock.py b/account_payment_purchase/models/stock_picking.py similarity index 60% rename from __unported__/account_payment_purchase/model/stock.py rename to account_payment_purchase/models/stock_picking.py index e2f83663b..2ab8c6073 100644 --- a/__unported__/account_payment_purchase/model/stock.py +++ b/account_payment_purchase/models/stock_picking.py @@ -20,23 +20,19 @@ # ############################################################################## -from openerp.osv import orm +from openerp import models, api -class stock_picking(orm.Model): +class StockPicking(models.Model): _inherit = "stock.picking" - def _prepare_invoice( - self, cr, uid, picking, partner, inv_type, journal_id, - context=None): - """Copy bank partner and payment type from PO to invoice""" - invoice_vals = super(stock_picking, self)._prepare_invoice( - cr, uid, picking, partner, inv_type, journal_id, context=context) - if picking.purchase_id: - invoice_vals.update({ - 'partner_bank_id': - picking.purchase_id.supplier_partner_bank.id or False, - 'payment_mode_type': - picking.purchase_id.payment_mode_type.id or False, - }) - return invoice_vals + @api.model + def _create_invoice_from_picking(self, picking, vals): + if picking and picking.move_lines: + # Get purchase order from first move line + if picking.move_lines[0].purchase_line_id: + purchase = picking.move_lines[0].purchase_line_id.order_id + vals['partner_bank_id'] = purchase.supplier_partner_bank_id.id + vals['payment_mode_id'] = purchase.payment_mode_id.id + return super(StockPicking, self)._create_invoice_from_picking(picking, + vals) diff --git a/__unported__/account_payment_purchase/view/purchase.xml b/account_payment_purchase/views/purchase_order_view.xml similarity index 85% rename from __unported__/account_payment_purchase/view/purchase.xml rename to account_payment_purchase/views/purchase_order_view.xml index f6b2cffec..0e25c175e 100644 --- a/__unported__/account_payment_purchase/view/purchase.xml +++ b/account_payment_purchase/views/purchase_order_view.xml @@ -16,8 +16,7 @@ - + diff --git a/__unported__/account_payment_sale/__init__.py b/account_payment_sale/__init__.py similarity index 98% rename from __unported__/account_payment_sale/__init__.py rename to account_payment_sale/__init__.py index 83c0dcfe2..11323c6e9 100644 --- a/__unported__/account_payment_sale/__init__.py +++ b/account_payment_sale/__init__.py @@ -20,4 +20,4 @@ # ############################################################################## -from . import model +from . import models diff --git a/__unported__/account_payment_sale/__openerp__.py b/account_payment_sale/__openerp__.py similarity index 73% rename from __unported__/account_payment_sale/__openerp__.py rename to account_payment_sale/__openerp__.py index b5b53fccd..84d1c9d96 100644 --- a/__unported__/account_payment_sale/__openerp__.py +++ b/account_payment_sale/__openerp__.py @@ -25,31 +25,31 @@ 'version': '1.0', 'category': 'Banking addons', 'license': 'AGPL-3', - 'summary': "Adds Payment Mode on Sale Orders", + 'summary': "Adds payment mode on sale orders", 'description': """ Account Payment Sale ==================== -This modules adds one field on sale orders : *Payment Mode*. +This modules adds one field on sale orders: *Payment Mode*. This field is copied from partner to sale order and then from sale order to customer invoice. -This module is similar to the *sale_payment* module ; the main difference is +This module is similar to the *sale_payment* module; the main difference is that it doesn't depend on the *account_payment_extension* module (it's not the -only module to conflict with *account_payment_extension* ; all the SEPA -modules in the banking addons conflict with *account_payment_extension*, cf -banking-addons-70/account_banking_payment_export/__openerp__.py). - -Please contact Alexis de Lattre from Akretion -for any help or question about this module. +only module to conflict with *account_payment_extension*; all the SEPA +modules in the banking addons conflict with *account_payment_extension*. """, 'author': 'Akretion', 'website': 'http://www.akretion.com', - 'depends': ['sale', 'account_payment_partner'], + 'contributors': ['Pedro M. Baeza '], + 'depends': [ + 'sale', + 'account_payment_partner' + ], 'conflicts': ['sale_payment'], 'data': [ - 'view/sale.xml', + 'views/sale_order_view.xml', ], - 'installable': False, - 'active': False, + 'installable': True, + 'auto_install': True, } diff --git a/__unported__/account_payment_sale/i18n/account_payment_sale.pot b/account_payment_sale/i18n/account_payment_sale.pot similarity index 76% rename from __unported__/account_payment_sale/i18n/account_payment_sale.pot rename to account_payment_sale/i18n/account_payment_sale.pot index 75c88ad87..c2d05ec68 100644 --- a/__unported__/account_payment_sale/i18n/account_payment_sale.pot +++ b/account_payment_sale/i18n/account_payment_sale.pot @@ -1,13 +1,13 @@ -# Translation of OpenERP Server. +# Translation of Odoo Server. # This file contains the translation of the following modules: # * account_payment_sale # msgid "" msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" +"Project-Id-Version: Odoo Server 8.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-06-09 23:24+0000\n" -"PO-Revision-Date: 2014-06-09 23:24+0000\n" +"POT-Creation-Date: 2014-10-31 23:00+0000\n" +"PO-Revision-Date: 2014-10-31 23:00+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" diff --git a/account_payment_sale/i18n/es.po b/account_payment_sale/i18n/es.po new file mode 100644 index 000000000..436919b1e --- /dev/null +++ b/account_payment_sale/i18n/es.po @@ -0,0 +1,27 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_payment_sale +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-10-31 23:00+0000\n" +"PO-Revision-Date: 2014-10-31 23:00+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_payment_sale +#: field:sale.order,payment_mode_id:0 +msgid "Payment Mode" +msgstr "Modo de pago" + +#. module: account_payment_sale +#: model:ir.model,name:account_payment_sale.model_sale_order +msgid "Sales Order" +msgstr "Pedido de venta" + diff --git a/__unported__/account_payment_sale/i18n/nl.po b/account_payment_sale/i18n/nl.po similarity index 100% rename from __unported__/account_payment_sale/i18n/nl.po rename to account_payment_sale/i18n/nl.po diff --git a/account_payment_sale/models/__init__.py b/account_payment_sale/models/__init__.py new file mode 100644 index 000000000..814479106 --- /dev/null +++ b/account_payment_sale/models/__init__.py @@ -0,0 +1,19 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# 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 . +# +############################################################################## + +from . import sale_order diff --git a/__unported__/account_payment_sale/model/sale.py b/account_payment_sale/models/sale_order.py similarity index 54% rename from __unported__/account_payment_sale/model/sale.py rename to account_payment_sale/models/sale_order.py index 5951f96af..e96b3cd3b 100644 --- a/__unported__/account_payment_sale/model/sale.py +++ b/account_payment_sale/models/sale_order.py @@ -20,36 +20,31 @@ # ############################################################################## -from openerp.osv import orm, fields +from openerp import models, fields, api -class sale_order(orm.Model): +class SaleOrder(models.Model): _inherit = "sale.order" - _columns = { - 'payment_mode_id': fields.many2one( - 'payment.mode', 'Payment Mode'), - } + payment_mode_id = fields.Many2one( + 'payment.mode', string='Payment Mode', + domain="[('sale_ok', '=', True)]") - def onchange_partner_id(self, cr, uid, ids, part, context=None): - res = super(sale_order, self).onchange_partner_id( - cr, uid, ids, part, context=context) - if part: - partner = self.pool['res.partner'].browse( - cr, uid, part, context=context) - res['value']['payment_mode_id'] = \ - partner.customer_payment_mode.id or False, + @api.multi + def onchange_partner_id(self, partner_id): + res = super(SaleOrder, self).onchange_partner_id(partner_id) + if partner_id: + partner = self.env['res.partner'].browse(partner_id) + res['value']['payment_mode_id'] = partner.customer_payment_mode.id else: res['value']['payment_mode_id'] = False return res - def _prepare_invoice(self, cr, uid, order, lines, context=None): + @api.model + def _prepare_invoice(self, order, lines): """Copy bank partner from sale order to invoice""" - invoice_vals = super(sale_order, self)._prepare_invoice( - cr, uid, order, lines, context=context) - invoice_vals.update({ - 'payment_mode_id': order.payment_mode_id.id or False, - 'partner_bank_id': order.payment_mode_id and - order.payment_mode_id.bank_id.id or False, - }) - return invoice_vals + vals = super(SaleOrder, self)._prepare_invoice(order, lines) + if order.payment_mode_id: + vals['payment_mode_id'] = order.payment_mode_id.id, + vals['partner_bank_id'] = order.payment_mode_id.bank_id.id + return vals diff --git a/__unported__/account_payment_sale/view/sale.xml b/account_payment_sale/views/sale_order_view.xml similarity index 100% rename from __unported__/account_payment_sale/view/sale.xml rename to account_payment_sale/views/sale_order_view.xml diff --git a/__unported__/account_payment_sale_stock/__init__.py b/account_payment_sale_stock/__init__.py similarity index 98% rename from __unported__/account_payment_sale_stock/__init__.py rename to account_payment_sale_stock/__init__.py index c98702b99..b5fc83a16 100644 --- a/__unported__/account_payment_sale_stock/__init__.py +++ b/account_payment_sale_stock/__init__.py @@ -20,4 +20,4 @@ # ############################################################################## -from . import model +from . import models diff --git a/__unported__/account_payment_sale_stock/__openerp__.py b/account_payment_sale_stock/__openerp__.py similarity index 77% rename from __unported__/account_payment_sale_stock/__openerp__.py rename to account_payment_sale_stock/__openerp__.py index 9fc4b5e17..72f008684 100644 --- a/__unported__/account_payment_sale_stock/__openerp__.py +++ b/account_payment_sale_stock/__openerp__.py @@ -25,23 +25,20 @@ 'version': '1.0', 'category': 'Banking addons', 'license': 'AGPL-3', - 'summary': "Manage Payment Mode when invoicing from picking", + 'summary': "Manage payment mode when invoicing a sale from picking", 'description': """ Account Payment Sale Stock ========================== -This modules copies *Payment Mode* from Sale Order to Invoice when the -Invoice is generated from the Picking. - -Please contact Alexis de Lattre from Akretion -for any help or question about this module. +This module copies *Payment Mode* from sale order to invoice when it is +generated from the picking. """, 'author': 'Akretion', 'website': 'http://www.akretion.com', - 'depends': ['sale_stock', 'account_payment_sale'], + 'contributors': ['Pedro M. Baeza '], + 'depends': ['sale_stock', + 'account_payment_sale'], 'conflicts': ['account_payment_extension'], - 'data': [], 'auto_install': True, - 'active': False, - 'installable': False, + 'installable': True, } diff --git a/account_payment_sale_stock/i18n/account_payment_sale_stock.pot b/account_payment_sale_stock/i18n/account_payment_sale_stock.pot new file mode 100644 index 000000000..2250652bb --- /dev/null +++ b/account_payment_sale_stock/i18n/account_payment_sale_stock.pot @@ -0,0 +1,21 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-10-31 23:01+0000\n" +"PO-Revision-Date: 2014-10-31 23:01+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_payment_sale_stock +#: model:ir.model,name:account_payment_sale_stock.model_stock_picking +msgid "Picking List" +msgstr "" + diff --git a/account_payment_sale_stock/i18n/es.po b/account_payment_sale_stock/i18n/es.po new file mode 100644 index 000000000..69200f01b --- /dev/null +++ b/account_payment_sale_stock/i18n/es.po @@ -0,0 +1,21 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-10-31 23:01+0000\n" +"PO-Revision-Date: 2014-10-31 23:01+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_payment_sale_stock +#: model:ir.model,name:account_payment_sale_stock.model_stock_picking +msgid "Picking List" +msgstr "Albarán" + diff --git a/__unported__/account_payment_sale_stock/model/__init__.py b/account_payment_sale_stock/models/__init__.py similarity index 97% rename from __unported__/account_payment_sale_stock/model/__init__.py rename to account_payment_sale_stock/models/__init__.py index 251e4ac06..66edd9dbe 100644 --- a/__unported__/account_payment_sale_stock/model/__init__.py +++ b/account_payment_sale_stock/models/__init__.py @@ -20,4 +20,4 @@ # ############################################################################## -from . import stock +from . import stock_picking diff --git a/account_payment_sale_stock/models/stock_picking.py b/account_payment_sale_stock/models/stock_picking.py new file mode 100644 index 000000000..17be3301a --- /dev/null +++ b/account_payment_sale_stock/models/stock_picking.py @@ -0,0 +1,33 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# 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 . +# +############################################################################## + +from openerp import models, api + + +class StockPicking(models.Model): + _inherit = "stock.picking" + + @api.model + def _create_invoice_from_picking(self, picking, vals): + if picking and picking.sale_id: + sale_order = picking.sale_id + if sale_order.payment_mode_id: + vals['partner_bank_id'] = sale_order.payment_mode_id.bank_id.id + vals['payment_mode_id'] = sale_order.payment_mode_id.id + return super(StockPicking, self)._create_invoice_from_picking(picking, + vals)