From 4b464b9270c267603877ee5a216028727ca947cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Fri, 5 Sep 2014 11:22:00 +0200 Subject: [PATCH 1/2] [MIG] kill statement_voucher_killer for 8.0 In 8.0, bank statements do not use vouchers anymore. --- .../__openerp__.py | 5 +- .../statement_voucher_killer/__init__.py | 21 --- .../statement_voucher_killer/__openerp__.py | 47 ------ .../statement_voucher_killer/i18n/es.po | 28 ---- .../i18n/statement_voucher_killer.pot | 27 ---- .../statement_view.xml | 19 --- .../statement_voucher_killer/voucher.py | 141 ------------------ 7 files changed, 1 insertion(+), 287 deletions(-) delete mode 100644 __unported__/statement_voucher_killer/__init__.py delete mode 100644 __unported__/statement_voucher_killer/__openerp__.py delete mode 100644 __unported__/statement_voucher_killer/i18n/es.po delete mode 100644 __unported__/statement_voucher_killer/i18n/statement_voucher_killer.pot delete mode 100644 __unported__/statement_voucher_killer/statement_view.xml delete mode 100644 __unported__/statement_voucher_killer/voucher.py diff --git a/__unported__/account_payment_transaction_id/__openerp__.py b/__unported__/account_payment_transaction_id/__openerp__.py index da15e7f3..fc011a0d 100644 --- a/__unported__/account_payment_transaction_id/__openerp__.py +++ b/__unported__/account_payment_transaction_id/__openerp__.py @@ -28,13 +28,10 @@ 'category': 'Hidden', 'depends': ['base_transaction_id', 'account_payment', - 'statement_voucher_killer', ], 'description': """ Compatibility module between Account Payment and Base Transaction ID. - -Needs `statement_voucher_killer` - """, +""", 'website': 'http://www.camptocamp.com', 'data': [], 'test': [], diff --git a/__unported__/statement_voucher_killer/__init__.py b/__unported__/statement_voucher_killer/__init__.py deleted file mode 100644 index 5e978d48..00000000 --- a/__unported__/statement_voucher_killer/__init__.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (c) 2013 Camptocamp SA (http://www.camptocamp.com) -# @author Nicolas Bessi -# -# 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 voucher diff --git a/__unported__/statement_voucher_killer/__openerp__.py b/__unported__/statement_voucher_killer/__openerp__.py deleted file mode 100644 index 4464d9df..00000000 --- a/__unported__/statement_voucher_killer/__openerp__.py +++ /dev/null @@ -1,47 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (c) 2013 Camptocamp SA (http://www.camptocamp.com) -# @author Nicolas Bessi -# -# 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': 'Satement voucher killer', - 'version': '1.0.0', - 'category': 'other', - 'description': """ -Prevent voucher creation when importing lines into statement -============================================================ - -When importing invoice or payment into a bank statement or a payment order, -normally a draft voucher is created on the line. This module will disable this -voucher creation. When importing payment line, date used to populate statement -line will be take from imported line in this order: - - * Date - * Maturity date - * Related statement date - -""", - 'author': 'Camptocamp', - 'website': 'http://www.camptocamp.com', - 'depends': ['account_voucher', 'account_payment'], - 'data': [ - 'statement_view.xml', - ], - 'test': [], - 'installable': False, - } diff --git a/__unported__/statement_voucher_killer/i18n/es.po b/__unported__/statement_voucher_killer/i18n/es.po deleted file mode 100644 index f00f2234..00000000 --- a/__unported__/statement_voucher_killer/i18n/es.po +++ /dev/null @@ -1,28 +0,0 @@ -# Spanish translation for banking-addons -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the banking-addons package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: banking-addons\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-01-21 12:00+0000\n" -"PO-Revision-Date: 2014-06-05 22:50+0000\n" -"Last-Translator: Pedro Manuel Baeza \n" -"Language-Team: Spanish \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-06-06 06:36+0000\n" -"X-Generator: Launchpad (build 17031)\n" - -#. module: statement_voucher_killer -#: model:ir.model,name:statement_voucher_killer.model_account_statement_from_invoice_lines -msgid "Entries by Statement from Invoices" -msgstr "Entradas por extracto desde facturas" - -#. module: statement_voucher_killer -#: model:ir.model,name:statement_voucher_killer.model_account_payment_populate_statement -msgid "Account Payment Populate Statement" -msgstr "El pago rellena el extracto" diff --git a/__unported__/statement_voucher_killer/i18n/statement_voucher_killer.pot b/__unported__/statement_voucher_killer/i18n/statement_voucher_killer.pot deleted file mode 100644 index 5c314a5d..00000000 --- a/__unported__/statement_voucher_killer/i18n/statement_voucher_killer.pot +++ /dev/null @@ -1,27 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * statement_voucher_killer -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-01-21 12:00+0000\n" -"PO-Revision-Date: 2014-01-21 12: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: statement_voucher_killer -#: model:ir.model,name:statement_voucher_killer.model_account_statement_from_invoice_lines -msgid "Entries by Statement from Invoices" -msgstr "" - -#. module: statement_voucher_killer -#: model:ir.model,name:statement_voucher_killer.model_account_payment_populate_statement -msgid "Account Payment Populate Statement" -msgstr "" - diff --git a/__unported__/statement_voucher_killer/statement_view.xml b/__unported__/statement_voucher_killer/statement_view.xml deleted file mode 100644 index 32a23d76..00000000 --- a/__unported__/statement_voucher_killer/statement_view.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - account.bank.statement - - - - - - - - - - diff --git a/__unported__/statement_voucher_killer/voucher.py b/__unported__/statement_voucher_killer/voucher.py deleted file mode 100644 index ea88996f..00000000 --- a/__unported__/statement_voucher_killer/voucher.py +++ /dev/null @@ -1,141 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (c) 2013 Camptocamp SA (http://www.camptocamp.com) -# @author Nicolas Bessi -# -# 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 -from openerp.tools import DEFAULT_SERVER_DATE_FORMAT -import time - - -class AccountStatementFromInvoiceLines(orm.TransientModel): - _inherit = "account.statement.from.invoice.lines" - - def populate_statement(self, cr, uid, ids, context=None): - """Taken from account voucher as no hook is available. No function - no refactoring, just trimming the part that generates voucher""" - if context is None: - context = {} - statement_id = context.get('statement_id', False) - if not statement_id: - return {'type': 'ir.actions.act_window_close'} - data = self.read(cr, uid, ids, context=context)[0] - line_ids = data['line_ids'] - if not line_ids: - return {'type': 'ir.actions.act_window_close'} - line_obj = self.pool['account.move.line'] - statement_obj = self.pool['account.bank.statement'] - statement_line_obj = self.pool['account.bank.statement.line'] - currency_obj = self.pool['res.currency'] - line_date = time.strftime(DEFAULT_SERVER_DATE_FORMAT) - statement = statement_obj.browse( - cr, uid, statement_id, context=context) - # for each selected move lines - for line in line_obj.browse(cr, uid, line_ids, context=context): - ctx = context.copy() - # take the date for computation of currency => use payment date - ctx['date'] = line_date - amount = 0.0 - if line.debit > 0: - amount = line.debit - elif line.credit > 0: - amount = -line.credit - if line.amount_currency: - amount = currency_obj.compute( - cr, uid, line.currency_id.id, statement.currency.id, - line.amount_currency, context=ctx) - elif (line.invoice and - line.invoice.currency_id.id != statement.currency.id): - amount = currency_obj.compute( - cr, uid, line.invoice.currency_id.id, statement.currency.id, - amount, context=ctx) - context.update({'move_line_ids': [line.id], - 'invoice_id': line.invoice.id}) - s_type = 'general' - if line.journal_id.type in ('sale', 'sale_refund'): - s_type = 'customer' - elif line.journal_id.type in ('purchase', 'purhcase_refund'): - s_type = 'supplier' - vals = self._prepare_statement_line_vals( - cr, uid, line, s_type, statement_id, amount, context=context) - statement_line_obj.create(cr, uid, vals, context=context) - return {'type': 'ir.actions.act_window_close'} - - def _prepare_statement_line_vals(self, cr, uid, move_line, s_type, - statement_id, amount, context=None): - return {'name': move_line.name or '?', - 'amount': amount, - 'type': s_type, - 'partner_id': move_line.partner_id.id, - 'account_id': move_line.account_id.id, - 'statement_id': statement_id, - 'ref': move_line.ref, - 'voucher_id': False, - 'date': time.strftime('%Y-%m-%d'), - } - - -class AccountPaymentPopulateStatement(orm.TransientModel): - _inherit = "account.payment.populate.statement" - - def populate_statement(self, cr, uid, ids, context=None): - """Taken from payment addon as no hook is vailable. No function - no refactoring, just trimming the part that generates voucher""" - line_obj = self.pool['payment.line'] - statement_obj = self.pool['account.bank.statement'] - statement_line_obj = self.pool['account.bank.statement.line'] - currency_obj = self.pool['res.currency'] - if context is None: - context = {} - data = self.read(cr, uid, ids, [], context=context)[0] - line_ids = data['lines'] - if not line_ids: - return {'type': 'ir.actions.act_window_close'} - statement = statement_obj.browse( - cr, uid, context['active_id'], context=context) - for line in line_obj.browse(cr, uid, line_ids, context=context): - ctx = context.copy() - # Last value_date earlier,but this field exists no more now - ctx['date'] = line.ml_maturity_date - amount = currency_obj.compute( - cr, uid, line.currency.id, statement.currency.id, - line.amount_currency, context=ctx) - if not line.move_line_id.id: - continue - context.update({'move_line_ids': [line.move_line_id.id]}) - vals = self._prepare_statement_line_vals( - cr, uid, line, -amount, statement, context=context) - st_line_id = statement_line_obj.create(cr, uid, vals, - context=context) - line_obj.write( - cr, uid, [line.id], {'bank_statement_line_id': st_line_id}) - return {'type': 'ir.actions.act_window_close'} - - def _prepare_statement_line_vals(self, cr, uid, payment_line, amount, - statement, context=None): - return { - 'name': payment_line.order_id.reference or '?', - 'amount': amount, - 'type': 'supplier', - 'partner_id': payment_line.partner_id.id, - 'account_id': payment_line.move_line_id.account_id.id, - 'statement_id': statement.id, - 'ref': payment_line.communication, - 'date': (payment_line.date or payment_line.ml_maturity_date or - statement.date) - } From 339ee231871af5a97008c96c56eaca6347bc8713 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Fri, 21 Nov 2014 14:20:19 +0100 Subject: [PATCH 2/2] [DEL] remove invoicing_voucher_killer (moved to OCA/bank-payment) --- .../invoicing_voucher_killer/__init__.py | 20 -------- .../invoicing_voucher_killer/__openerp__.py | 39 ---------------- .../invoicing_voucher_killer/i18n/es.po | 33 ------------- .../i18n/invoicing_voucher_killer.pot | 32 ------------- .../invoicing_voucher_killer/invoice_data.xml | 7 --- .../invoicing_voucher_killer/invoice_view.xml | 46 ------------------- 6 files changed, 177 deletions(-) delete mode 100644 __unported__/invoicing_voucher_killer/__init__.py delete mode 100644 __unported__/invoicing_voucher_killer/__openerp__.py delete mode 100644 __unported__/invoicing_voucher_killer/i18n/es.po delete mode 100644 __unported__/invoicing_voucher_killer/i18n/invoicing_voucher_killer.pot delete mode 100644 __unported__/invoicing_voucher_killer/invoice_data.xml delete mode 100644 __unported__/invoicing_voucher_killer/invoice_view.xml diff --git a/__unported__/invoicing_voucher_killer/__init__.py b/__unported__/invoicing_voucher_killer/__init__.py deleted file mode 100644 index 0463f7df..00000000 --- a/__unported__/invoicing_voucher_killer/__init__.py +++ /dev/null @@ -1,20 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (c) 2013 Camptocamp SA (http://www.camptocamp.com) -# @author Nicolas Bessi -# -# 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 . -# -############################################################################## diff --git a/__unported__/invoicing_voucher_killer/__openerp__.py b/__unported__/invoicing_voucher_killer/__openerp__.py deleted file mode 100644 index bf84510c..00000000 --- a/__unported__/invoicing_voucher_killer/__openerp__.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Copyright (c) 2013 Camptocamp SA (http://www.camptocamp.com) -# @author Nicolas Bessi -# -# 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': 'Invoicing voucher killer', - 'version': '1.0.0', - 'category': 'other', - 'description': """ -Prevent the usage of voucher from invoices -########################################## -This add-on will disable "Register Payment" button -""", - 'author': 'Camptocamp', - 'website': 'http://www.camptocamp.com', - 'depends': ['account_voucher'], - 'data': ['invoice_data.xml', - 'invoice_view.xml'], - 'demo_xml': [], - 'test': [], - 'installable': False, - 'active': False, - } diff --git a/__unported__/invoicing_voucher_killer/i18n/es.po b/__unported__/invoicing_voucher_killer/i18n/es.po deleted file mode 100644 index 79fac92e..00000000 --- a/__unported__/invoicing_voucher_killer/i18n/es.po +++ /dev/null @@ -1,33 +0,0 @@ -# Spanish translation for banking-addons -# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014 -# This file is distributed under the same license as the banking-addons package. -# FIRST AUTHOR , 2014. -# -msgid "" -msgstr "" -"Project-Id-Version: banking-addons\n" -"Report-Msgid-Bugs-To: FULL NAME \n" -"POT-Creation-Date: 2014-01-21 12:00+0000\n" -"PO-Revision-Date: 2014-06-05 22:47+0000\n" -"Last-Translator: Pedro Manuel Baeza \n" -"Language-Team: Spanish \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2014-06-06 06:36+0000\n" -"X-Generator: Launchpad (build 17031)\n" - -#. module: invoicing_voucher_killer -#: view:account.invoice:0 -msgid "Pay" -msgstr "Pagar" - -#. module: invoicing_voucher_killer -#: model:res.groups,name:invoicing_voucher_killer.invoice_voucher_user -msgid "Use voucher in Invoices" -msgstr "Usar resguardos en facturas" - -#. module: invoicing_voucher_killer -#: view:account.invoice:0 -msgid "Register Payment" -msgstr "Registrar pago" diff --git a/__unported__/invoicing_voucher_killer/i18n/invoicing_voucher_killer.pot b/__unported__/invoicing_voucher_killer/i18n/invoicing_voucher_killer.pot deleted file mode 100644 index dec048dc..00000000 --- a/__unported__/invoicing_voucher_killer/i18n/invoicing_voucher_killer.pot +++ /dev/null @@ -1,32 +0,0 @@ -# Translation of OpenERP Server. -# This file contains the translation of the following modules: -# * invoicing_voucher_killer -# -msgid "" -msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-01-21 12:00+0000\n" -"PO-Revision-Date: 2014-01-21 12: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: invoicing_voucher_killer -#: view:account.invoice:0 -msgid "Pay" -msgstr "" - -#. module: invoicing_voucher_killer -#: model:res.groups,name:invoicing_voucher_killer.invoice_voucher_user -msgid "Use voucher in Invoices" -msgstr "" - -#. module: invoicing_voucher_killer -#: view:account.invoice:0 -msgid "Register Payment" -msgstr "" - diff --git a/__unported__/invoicing_voucher_killer/invoice_data.xml b/__unported__/invoicing_voucher_killer/invoice_data.xml deleted file mode 100644 index 01870109..00000000 --- a/__unported__/invoicing_voucher_killer/invoice_data.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - Use voucher in Invoices - - - diff --git a/__unported__/invoicing_voucher_killer/invoice_view.xml b/__unported__/invoicing_voucher_killer/invoice_view.xml deleted file mode 100644 index 3ca3663e..00000000 --- a/__unported__/invoicing_voucher_killer/invoice_view.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - Hide voucher in invoice - account.invoice - - - -