From 4cb4a67530fe9ea84e6f109f9933c83a0df79a49 Mon Sep 17 00:00:00 2001 From: "Adrien Peiffer (ACSONE)" Date: Tue, 24 Mar 2015 14:10:06 +0100 Subject: [PATCH 01/12] [ADD] Add account_payment_blocking --- account_payment_blocking/__init__.py | 24 ++++++ account_payment_blocking/__openerp__.py | 59 ++++++++++++++ account_payment_blocking/model/__init__.py | 24 ++++++ .../model/account_invoice.py | 72 +++++++++++++++++ .../model/payment_order_create.py | 34 ++++++++ account_payment_blocking/tests/__init__.py | 27 +++++++ .../test_account_banking_payment_blocking.py | 81 +++++++++++++++++++ .../view/account_invoice_view.xml | 15 ++++ 8 files changed, 336 insertions(+) create mode 100644 account_payment_blocking/__init__.py create mode 100644 account_payment_blocking/__openerp__.py create mode 100644 account_payment_blocking/model/__init__.py create mode 100644 account_payment_blocking/model/account_invoice.py create mode 100644 account_payment_blocking/model/payment_order_create.py create mode 100644 account_payment_blocking/tests/__init__.py create mode 100644 account_payment_blocking/tests/test_account_banking_payment_blocking.py create mode 100644 account_payment_blocking/view/account_invoice_view.xml diff --git a/account_payment_blocking/__init__.py b/account_payment_blocking/__init__.py new file mode 100644 index 000000000..aa439117c --- /dev/null +++ b/account_payment_blocking/__init__.py @@ -0,0 +1,24 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Account Payment Blocking module for OpenERP +# Copyright (C) 2014 ACSONE SA/NV (http://acsone.eu) +# @author Stéphane Bidoul +# +# 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 model +from . import tests diff --git a/account_payment_blocking/__openerp__.py b/account_payment_blocking/__openerp__.py new file mode 100644 index 000000000..1e591a504 --- /dev/null +++ b/account_payment_blocking/__openerp__.py @@ -0,0 +1,59 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Account Payment Blocking module for OpenERP +# Copyright (C) 2014 ACSONE SA/NV (http://acsone.eu) +# @author Stéphane Bidoul +# @author Adrien Peiffer +# +# 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 payment blocking', + 'version': '0.1', + 'category': 'Banking addons', + 'description': """ + Prevent invoices under litigation to be proposed in payment orders. + + This module uses the 'blocked' flag that is present on move lines, + to filter out lines proposed in payment orders. + + In addition it exposes this flag on the supplier invoice form + so it is easier to block an invoice. + """, + 'author': 'ACSONE SA/NV', + 'website': 'http://acsone.eu', + 'depends': [ + 'base', + 'account_banking_payment_export' + ], + 'data': [ + 'view/account_invoice_view.xml' + ], + 'test': [ + ], + 'demo': [ + ], + 'js': [ + ], + 'qweb': [ + ], + 'css': [ + ], + 'installable': True, + 'application': False, + 'auto_install': False, + 'license': 'AGPL-3', +} diff --git a/account_payment_blocking/model/__init__.py b/account_payment_blocking/model/__init__.py new file mode 100644 index 000000000..0ef1a3c56 --- /dev/null +++ b/account_payment_blocking/model/__init__.py @@ -0,0 +1,24 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Account Payment Blocking module for OpenERP +# Copyright (C) 2014 ACSONE SA/NV (http://acsone.eu) +# @author Stéphane Bidoul +# +# 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 payment_order_create +from . import account_invoice diff --git a/account_payment_blocking/model/account_invoice.py b/account_payment_blocking/model/account_invoice.py new file mode 100644 index 000000000..5632c922f --- /dev/null +++ b/account_payment_blocking/model/account_invoice.py @@ -0,0 +1,72 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Account Payment Blocking module for OpenERP +# Copyright (C) 2014 ACSONE SA/NV (http://acsone.eu) +# @author Adrien Peiffer +# +# 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 account_invoice(orm.Model): + _inherit = "account.invoice" + + def _get_move_line(self, cr, uid, invoice_id, context=None): + return self.pool.get('account.move.line')\ + .search(cr, uid, [('account_id.type', 'in', + ['payable', 'receivable']), + ('invoice.id', '=', invoice_id)]) + + def _set_move_blocked(self, cr, uid, ids, name, field_value, arg, + context=None): + if isinstance(ids, (int, long)): + ids = [ids] + for invoice in self.browse(cr, uid, ids, context=context): + if invoice.move_id.id: + move_line_ids = self._get_move_line(cr, uid, invoice.id, + context=context) + assert len(move_line_ids) == 1 + # work with account_constraints from OCA/AFT: + context.update({'from_parent_object': True}) + self.pool.get('account.move.line')\ + .write(cr, uid, move_line_ids, {'blocked': field_value}, + context=context) + + def _get_move_blocked(self, cr, uid, ids, name, arg, context=None): + res = {} + if isinstance(ids, (int, long)): + ids = [ids] + for invoice in self.browse(cr, uid, ids, context=context): + if invoice.move_id.id: + move_line_ids = self._get_move_line(cr, uid, invoice.id, + context=context) + assert len(move_line_ids) == 1 + move_line = self.pool.get('account.move.line')\ + .browse(cr, uid, move_line_ids, context=context)[0] + res[invoice.id] = move_line.blocked + else: + res[invoice.id] = False + return res + + _columns = { + 'blocked': fields.function(_get_move_blocked, + fnct_inv=_set_move_blocked, + type='boolean', string='No Follow Up', + states={'draft': [('readonly', + True)]}), + } diff --git a/account_payment_blocking/model/payment_order_create.py b/account_payment_blocking/model/payment_order_create.py new file mode 100644 index 000000000..ef167886a --- /dev/null +++ b/account_payment_blocking/model/payment_order_create.py @@ -0,0 +1,34 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Account Payment Blocking module for OpenERP +# Copyright (C) 2014 ACSONE SA/NV (http://acsone.eu) +# @author Stéphane Bidoul +# +# 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 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) + domain += [('blocked', '!=', True)] + return True diff --git a/account_payment_blocking/tests/__init__.py b/account_payment_blocking/tests/__init__.py new file mode 100644 index 000000000..625581235 --- /dev/null +++ b/account_payment_blocking/tests/__init__.py @@ -0,0 +1,27 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Account Payment Blocking module for OpenERP +# Copyright (C) 2014 ACSONE SA/NV (http://acsone.eu) +# @author Adrien Peiffer +# +# 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 test_account_banking_payment_blocking + +checks = [ + test_account_banking_payment_blocking, +] diff --git a/account_payment_blocking/tests/test_account_banking_payment_blocking.py b/account_payment_blocking/tests/test_account_banking_payment_blocking.py new file mode 100644 index 000000000..5551580c0 --- /dev/null +++ b/account_payment_blocking/tests/test_account_banking_payment_blocking.py @@ -0,0 +1,81 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Account Payment Blocking module for OpenERP +# Copyright (C) 2014 ACSONE SA/NV (http://acsone.eu) +# @author Adrien Peiffer +# +# 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 openerp.tests.common as common +from openerp import netsvc + +DB = common.DB +ADMIN_USER_ID = common.ADMIN_USER_ID + + +def create_simple_invoice(self, cr, uid, context=None): + partner_id = self.ref('base.res_partner_2') + product_id = self.ref('product.product_product_4') + return self.registry('account.invoice')\ + .create(cr, uid, {'partner_id': partner_id, + 'account_id': + self.ref('account.a_recv'), + 'journal_id': + self.ref('account.expenses_journal'), + 'invoice_line': [(0, 0, {'name': 'test', + 'account_id': + self.ref('account.a_sale'), + 'price_unit': 2000.00, + 'quantity': 1, + 'product_id': product_id, + } + ) + ], + }) + + +class TestAccountBankingPaymentBlocking(common.TransactionCase): + + def setUp(self): + super(TestAccountBankingPaymentBlocking, self).setUp() + self.context = self.registry("res.users").context_get(self.cr, + self.uid) + + def test_invoice(self): + invoice_obj = self.registry('account.invoice') + move_line_obj = self.registry('account.move.line') + invoice_id = create_simple_invoice(self, self.cr, self.uid, + context=self.context) + netsvc.LocalService("workflow")\ + .trg_validate(self.uid, 'account.invoice', invoice_id, + 'invoice_open', self.cr) + invoice = invoice_obj.browse(self.cr, self.uid, [invoice_id], + context=self.context)[0] + move_line_ids = move_line_obj\ + .search(self.cr, self.uid, [('account_id.type', 'in', + ['payable', 'receivable']), + ('invoice.id', '=', invoice.id)]) + move_line = move_line_obj.browse(self.cr, self.uid, move_line_ids)[0] + self.assertEqual(invoice.blocked, move_line.blocked, + 'Blocked values are not equals') + move_line_obj.write(self.cr, self.uid, move_line_ids, + {'blocked': True}) + invoice = invoice_obj.browse(self.cr, self.uid, [invoice_id], + context=self.context)[0] + move_line = move_line_obj.browse(self.cr, self.uid, move_line_ids)[0] + self.assertEqual(invoice.blocked, move_line.blocked, + 'Blocked values are not equals') diff --git a/account_payment_blocking/view/account_invoice_view.xml b/account_payment_blocking/view/account_invoice_view.xml new file mode 100644 index 000000000..09e6a1ba8 --- /dev/null +++ b/account_payment_blocking/view/account_invoice_view.xml @@ -0,0 +1,15 @@ + + + + + account.invoice.supplier.form (account_banking_payment_blocking) + account.invoice + + + + + + + + + \ No newline at end of file From cc34f1d20f57e1e26112b46023b797c46e3bf125 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Thu, 26 Mar 2015 11:27:26 +0100 Subject: [PATCH 02/12] [IMP] account_payment_blocking: README according to OCA guidelines --- account_payment_blocking/README.rst | 65 +++++++++++++++++++++++++ account_payment_blocking/__openerp__.py | 10 +--- 2 files changed, 67 insertions(+), 8 deletions(-) create mode 100644 account_payment_blocking/README.rst diff --git a/account_payment_blocking/README.rst b/account_payment_blocking/README.rst new file mode 100644 index 000000000..01698306e --- /dev/null +++ b/account_payment_blocking/README.rst @@ -0,0 +1,65 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :alt: License + +account_payment_blocking +======================== + +This module was written to extend the functionality of payment orders +to block invoices under litigation to be presented for inclusion un payment orders. + +This module uses the 'blocked' flag that is present on move lines, +to filter out lines proposed in payment orders. + +In addition it exposes this flag on the supplier invoice form +so it is easier to block an invoice. + +Installation +============ + +This module depends on account_banking_payment_export that is part +of the OCA/bank-payment suite. + +Configuration +============= + +There is nothing to configure. + +Usage +===== + +To use this module, set the "Blocked" flag on supplier invoices +or on payable/receivable move lines. + +These moves will not be proposed for inclusion un payment orders. + +For further information, please visit: + + * https://www.odoo.com/forum/help-1 + +Known issues / Roadmap +====================== + +None. + +Credits +======= + +Contributors +------------ + +* Adrien Peiffer +* Stéphane Bidoul + +Maintainer +---------- + +.. image:: http://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: http://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. + +To contribute to this module, please visit http://odoo-community.org. + diff --git a/account_payment_blocking/__openerp__.py b/account_payment_blocking/__openerp__.py index 1e591a504..73bb262d8 100644 --- a/account_payment_blocking/__openerp__.py +++ b/account_payment_blocking/__openerp__.py @@ -24,14 +24,8 @@ 'name': 'account banking payment blocking', 'version': '0.1', 'category': 'Banking addons', - 'description': """ - Prevent invoices under litigation to be proposed in payment orders. - - This module uses the 'blocked' flag that is present on move lines, - to filter out lines proposed in payment orders. - - In addition it exposes this flag on the supplier invoice form - so it is easier to block an invoice. + 'summary': """ + Prevent invoices under litigation to be proposed in payment orders. """, 'author': 'ACSONE SA/NV', 'website': 'http://acsone.eu', From db78dcc7fd91e3b8d700cbd1b7f2a2a181eaf732 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Thu, 26 Mar 2015 11:46:46 +0100 Subject: [PATCH 03/12] [IMP] account_payment_blocking: typo, authors and minor cleanup --- account_payment_blocking/README.rst | 2 +- account_payment_blocking/__openerp__.py | 12 +----------- account_payment_blocking/tests/__init__.py | 4 ---- 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/account_payment_blocking/README.rst b/account_payment_blocking/README.rst index 01698306e..80927ee3e 100644 --- a/account_payment_blocking/README.rst +++ b/account_payment_blocking/README.rst @@ -5,7 +5,7 @@ account_payment_blocking ======================== This module was written to extend the functionality of payment orders -to block invoices under litigation to be presented for inclusion un payment orders. +to block invoices under litigation to be presented for inclusion in payment orders. This module uses the 'blocked' flag that is present on move lines, to filter out lines proposed in payment orders. diff --git a/account_payment_blocking/__openerp__.py b/account_payment_blocking/__openerp__.py index 73bb262d8..40829ffe1 100644 --- a/account_payment_blocking/__openerp__.py +++ b/account_payment_blocking/__openerp__.py @@ -27,7 +27,7 @@ 'summary': """ Prevent invoices under litigation to be proposed in payment orders. """, - 'author': 'ACSONE SA/NV', + 'author': 'ACSONE SA/NV,Odoo Community Association (OCA)', 'website': 'http://acsone.eu', 'depends': [ 'base', @@ -36,16 +36,6 @@ 'data': [ 'view/account_invoice_view.xml' ], - 'test': [ - ], - 'demo': [ - ], - 'js': [ - ], - 'qweb': [ - ], - 'css': [ - ], 'installable': True, 'application': False, 'auto_install': False, diff --git a/account_payment_blocking/tests/__init__.py b/account_payment_blocking/tests/__init__.py index 625581235..2f65b479d 100644 --- a/account_payment_blocking/tests/__init__.py +++ b/account_payment_blocking/tests/__init__.py @@ -21,7 +21,3 @@ ############################################################################## from . import test_account_banking_payment_blocking - -checks = [ - test_account_banking_payment_blocking, -] From 755ceb549cbc62ee78163466e8a1386ab5502816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Thu, 26 Mar 2015 11:50:24 +0100 Subject: [PATCH 04/12] [IMP] account_payment_blocking: further improve README --- account_payment_blocking/README.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/account_payment_blocking/README.rst b/account_payment_blocking/README.rst index 80927ee3e..2fc469474 100644 --- a/account_payment_blocking/README.rst +++ b/account_payment_blocking/README.rst @@ -5,9 +5,9 @@ account_payment_blocking ======================== This module was written to extend the functionality of payment orders -to block invoices under litigation to be presented for inclusion in payment orders. +to prevent invoices under litigation to be presented for inclusion in payment orders. -This module uses the 'blocked' flag that is present on move lines, +This module uses the 'blocked' flag that is present on journal items to filter out lines proposed in payment orders. In addition it exposes this flag on the supplier invoice form @@ -28,9 +28,9 @@ Usage ===== To use this module, set the "Blocked" flag on supplier invoices -or on payable/receivable move lines. +or on payable/receivable journal items. -These moves will not be proposed for inclusion un payment orders. +These invoices will not be proposed for inclusion in payment orders. For further information, please visit: From 62633a3c855941bba74e900b42e2d3a2dd6a5056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Thu, 26 Mar 2015 12:10:08 +0100 Subject: [PATCH 05/12] [IMP] account_payment_blocking: use workflow instead of netsvc --- .../tests/test_account_banking_payment_blocking.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/account_payment_blocking/tests/test_account_banking_payment_blocking.py b/account_payment_blocking/tests/test_account_banking_payment_blocking.py index 5551580c0..de9ce3bec 100644 --- a/account_payment_blocking/tests/test_account_banking_payment_blocking.py +++ b/account_payment_blocking/tests/test_account_banking_payment_blocking.py @@ -21,7 +21,7 @@ ############################################################################## import openerp.tests.common as common -from openerp import netsvc +from openerp import workflow DB = common.DB ADMIN_USER_ID = common.ADMIN_USER_ID @@ -60,9 +60,8 @@ class TestAccountBankingPaymentBlocking(common.TransactionCase): move_line_obj = self.registry('account.move.line') invoice_id = create_simple_invoice(self, self.cr, self.uid, context=self.context) - netsvc.LocalService("workflow")\ - .trg_validate(self.uid, 'account.invoice', invoice_id, - 'invoice_open', self.cr) + workflow.trg_validate(self.uid, 'account.invoice', invoice_id, + 'invoice_open', self.cr) invoice = invoice_obj.browse(self.cr, self.uid, [invoice_id], context=self.context)[0] move_line_ids = move_line_obj\ From 1419300ac54e511ff87d4d6fb61828b3371ffbfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Fri, 17 Apr 2015 11:09:45 +0200 Subject: [PATCH 06/12] [FIX] account_payment_blocking: license in README --- account_payment_blocking/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_payment_blocking/README.rst b/account_payment_blocking/README.rst index 2fc469474..213619884 100644 --- a/account_payment_blocking/README.rst +++ b/account_payment_blocking/README.rst @@ -1,5 +1,5 @@ .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :alt: License + :alt: License: AGPL-3 account_payment_blocking ======================== From d488ce4548a36e42208d5782bbf7728de3940df3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Fri, 17 Apr 2015 11:10:08 +0200 Subject: [PATCH 07/12] [FIX] account_payment_blocking: OpenERP -> Odoo in comments --- account_payment_blocking/__init__.py | 2 +- account_payment_blocking/__openerp__.py | 2 +- account_payment_blocking/model/__init__.py | 2 +- account_payment_blocking/model/account_invoice.py | 2 +- account_payment_blocking/model/payment_order_create.py | 2 +- account_payment_blocking/tests/__init__.py | 2 +- .../tests/test_account_banking_payment_blocking.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/account_payment_blocking/__init__.py b/account_payment_blocking/__init__.py index aa439117c..44a3c774c 100644 --- a/account_payment_blocking/__init__.py +++ b/account_payment_blocking/__init__.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Account Payment Blocking module for OpenERP +# Account Payment Blocking module for Odoo # Copyright (C) 2014 ACSONE SA/NV (http://acsone.eu) # @author Stéphane Bidoul # diff --git a/account_payment_blocking/__openerp__.py b/account_payment_blocking/__openerp__.py index 40829ffe1..ae324404c 100644 --- a/account_payment_blocking/__openerp__.py +++ b/account_payment_blocking/__openerp__.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Account Payment Blocking module for OpenERP +# Account Payment Blocking module for Odoo # Copyright (C) 2014 ACSONE SA/NV (http://acsone.eu) # @author Stéphane Bidoul # @author Adrien Peiffer diff --git a/account_payment_blocking/model/__init__.py b/account_payment_blocking/model/__init__.py index 0ef1a3c56..229675797 100644 --- a/account_payment_blocking/model/__init__.py +++ b/account_payment_blocking/model/__init__.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Account Payment Blocking module for OpenERP +# Account Payment Blocking module for Odoo # Copyright (C) 2014 ACSONE SA/NV (http://acsone.eu) # @author Stéphane Bidoul # diff --git a/account_payment_blocking/model/account_invoice.py b/account_payment_blocking/model/account_invoice.py index 5632c922f..4a4497b4f 100644 --- a/account_payment_blocking/model/account_invoice.py +++ b/account_payment_blocking/model/account_invoice.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Account Payment Blocking module for OpenERP +# Account Payment Blocking module for Odoo # Copyright (C) 2014 ACSONE SA/NV (http://acsone.eu) # @author Adrien Peiffer # diff --git a/account_payment_blocking/model/payment_order_create.py b/account_payment_blocking/model/payment_order_create.py index ef167886a..e91b59e17 100644 --- a/account_payment_blocking/model/payment_order_create.py +++ b/account_payment_blocking/model/payment_order_create.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Account Payment Blocking module for OpenERP +# Account Payment Blocking module for Odoo # Copyright (C) 2014 ACSONE SA/NV (http://acsone.eu) # @author Stéphane Bidoul # diff --git a/account_payment_blocking/tests/__init__.py b/account_payment_blocking/tests/__init__.py index 2f65b479d..cd79c5432 100644 --- a/account_payment_blocking/tests/__init__.py +++ b/account_payment_blocking/tests/__init__.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Account Payment Blocking module for OpenERP +# Account Payment Blocking module for Odoo # Copyright (C) 2014 ACSONE SA/NV (http://acsone.eu) # @author Adrien Peiffer # diff --git a/account_payment_blocking/tests/test_account_banking_payment_blocking.py b/account_payment_blocking/tests/test_account_banking_payment_blocking.py index de9ce3bec..6d182a6c6 100644 --- a/account_payment_blocking/tests/test_account_banking_payment_blocking.py +++ b/account_payment_blocking/tests/test_account_banking_payment_blocking.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Account Payment Blocking module for OpenERP +# Account Payment Blocking module for Odoo # Copyright (C) 2014 ACSONE SA/NV (http://acsone.eu) # @author Adrien Peiffer # From 8e04e070ab33b588ea215cef32a5743b268eac26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Fri, 17 Apr 2015 11:12:05 +0200 Subject: [PATCH 08/12] [FIX] account_payment_blocking: ensure context --- account_payment_blocking/model/account_invoice.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/account_payment_blocking/model/account_invoice.py b/account_payment_blocking/model/account_invoice.py index 4a4497b4f..32cd09beb 100644 --- a/account_payment_blocking/model/account_invoice.py +++ b/account_payment_blocking/model/account_invoice.py @@ -34,6 +34,8 @@ class account_invoice(orm.Model): def _set_move_blocked(self, cr, uid, ids, name, field_value, arg, context=None): + if context is None: + context = {} if isinstance(ids, (int, long)): ids = [ids] for invoice in self.browse(cr, uid, ids, context=context): From dd40dd0870cd21f3d422ac2d2912c014b4d14d15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Fri, 17 Apr 2015 11:14:12 +0200 Subject: [PATCH 09/12] [FIX] account_payment_blocking: copyright year --- account_payment_blocking/__init__.py | 2 +- account_payment_blocking/__openerp__.py | 2 +- account_payment_blocking/model/__init__.py | 2 +- account_payment_blocking/model/account_invoice.py | 2 +- account_payment_blocking/model/payment_order_create.py | 2 +- account_payment_blocking/tests/__init__.py | 2 +- .../tests/test_account_banking_payment_blocking.py | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/account_payment_blocking/__init__.py b/account_payment_blocking/__init__.py index 44a3c774c..a0dd54a71 100644 --- a/account_payment_blocking/__init__.py +++ b/account_payment_blocking/__init__.py @@ -2,7 +2,7 @@ ############################################################################## # # Account Payment Blocking module for Odoo -# Copyright (C) 2014 ACSONE SA/NV (http://acsone.eu) +# Copyright (C) 2014-2015 ACSONE SA/NV (http://acsone.eu) # @author Stéphane Bidoul # # This program is free software: you can redistribute it and/or modify diff --git a/account_payment_blocking/__openerp__.py b/account_payment_blocking/__openerp__.py index ae324404c..0b958b8ba 100644 --- a/account_payment_blocking/__openerp__.py +++ b/account_payment_blocking/__openerp__.py @@ -2,7 +2,7 @@ ############################################################################## # # Account Payment Blocking module for Odoo -# Copyright (C) 2014 ACSONE SA/NV (http://acsone.eu) +# Copyright (C) 2014-2015 ACSONE SA/NV (http://acsone.eu) # @author Stéphane Bidoul # @author Adrien Peiffer # diff --git a/account_payment_blocking/model/__init__.py b/account_payment_blocking/model/__init__.py index 229675797..ffc12a4cc 100644 --- a/account_payment_blocking/model/__init__.py +++ b/account_payment_blocking/model/__init__.py @@ -2,7 +2,7 @@ ############################################################################## # # Account Payment Blocking module for Odoo -# Copyright (C) 2014 ACSONE SA/NV (http://acsone.eu) +# Copyright (C) 2014-2015 ACSONE SA/NV (http://acsone.eu) # @author Stéphane Bidoul # # This program is free software: you can redistribute it and/or modify diff --git a/account_payment_blocking/model/account_invoice.py b/account_payment_blocking/model/account_invoice.py index 32cd09beb..f7fd1c04e 100644 --- a/account_payment_blocking/model/account_invoice.py +++ b/account_payment_blocking/model/account_invoice.py @@ -2,7 +2,7 @@ ############################################################################## # # Account Payment Blocking module for Odoo -# Copyright (C) 2014 ACSONE SA/NV (http://acsone.eu) +# Copyright (C) 2014-2015 ACSONE SA/NV (http://acsone.eu) # @author Adrien Peiffer # # This program is free software: you can redistribute it and/or modify diff --git a/account_payment_blocking/model/payment_order_create.py b/account_payment_blocking/model/payment_order_create.py index e91b59e17..b96d7c9d4 100644 --- a/account_payment_blocking/model/payment_order_create.py +++ b/account_payment_blocking/model/payment_order_create.py @@ -2,7 +2,7 @@ ############################################################################## # # Account Payment Blocking module for Odoo -# Copyright (C) 2014 ACSONE SA/NV (http://acsone.eu) +# Copyright (C) 2014-2015 ACSONE SA/NV (http://acsone.eu) # @author Stéphane Bidoul # # This program is free software: you can redistribute it and/or modify diff --git a/account_payment_blocking/tests/__init__.py b/account_payment_blocking/tests/__init__.py index cd79c5432..08bc44110 100644 --- a/account_payment_blocking/tests/__init__.py +++ b/account_payment_blocking/tests/__init__.py @@ -2,7 +2,7 @@ ############################################################################## # # Account Payment Blocking module for Odoo -# Copyright (C) 2014 ACSONE SA/NV (http://acsone.eu) +# Copyright (C) 2014-2015 ACSONE SA/NV (http://acsone.eu) # @author Adrien Peiffer # # This program is free software: you can redistribute it and/or modify diff --git a/account_payment_blocking/tests/test_account_banking_payment_blocking.py b/account_payment_blocking/tests/test_account_banking_payment_blocking.py index 6d182a6c6..c96006d39 100644 --- a/account_payment_blocking/tests/test_account_banking_payment_blocking.py +++ b/account_payment_blocking/tests/test_account_banking_payment_blocking.py @@ -2,7 +2,7 @@ ############################################################################## # # Account Payment Blocking module for Odoo -# Copyright (C) 2014 ACSONE SA/NV (http://acsone.eu) +# Copyright (C) 2014-2015 ACSONE SA/NV (http://acsone.eu) # @author Adrien Peiffer # # This program is free software: you can redistribute it and/or modify From 3847b99ac0d3d98f24dabd605d2547251ccb12d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Fri, 17 Apr 2015 11:15:25 +0200 Subject: [PATCH 10/12] [FIX] account_payment_blocking: missing context on search --- account_payment_blocking/model/account_invoice.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/account_payment_blocking/model/account_invoice.py b/account_payment_blocking/model/account_invoice.py index f7fd1c04e..c48621cae 100644 --- a/account_payment_blocking/model/account_invoice.py +++ b/account_payment_blocking/model/account_invoice.py @@ -30,7 +30,8 @@ class account_invoice(orm.Model): return self.pool.get('account.move.line')\ .search(cr, uid, [('account_id.type', 'in', ['payable', 'receivable']), - ('invoice.id', '=', invoice_id)]) + ('invoice.id', '=', invoice_id)], + context=context) def _set_move_blocked(self, cr, uid, ids, name, field_value, arg, context=None): From 898ba88f2f60c1af879ef4fb5824a5c75e212789 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Fri, 17 Apr 2015 11:17:06 +0200 Subject: [PATCH 11/12] [FIX] account_payment_blocking: better title in README --- account_payment_blocking/README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/account_payment_blocking/README.rst b/account_payment_blocking/README.rst index 213619884..7d2eae5b1 100644 --- a/account_payment_blocking/README.rst +++ b/account_payment_blocking/README.rst @@ -1,8 +1,8 @@ .. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg :alt: License: AGPL-3 -account_payment_blocking -======================== +Block payment of invoices +========================= This module was written to extend the functionality of payment orders to prevent invoices under litigation to be presented for inclusion in payment orders. From e888f43168b4707b0a789faaec99cb4c60704cf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Fri, 17 Apr 2015 11:19:25 +0200 Subject: [PATCH 12/12] [IMP] account_payment_blocking: add generic OCA icon --- .../static/description/icon.png | 538 ++++++++++++++++++ 1 file changed, 538 insertions(+) create mode 100644 account_payment_blocking/static/description/icon.png diff --git a/account_payment_blocking/static/description/icon.png b/account_payment_blocking/static/description/icon.png new file mode 100644 index 000000000..8dadd2c25 --- /dev/null +++ b/account_payment_blocking/static/description/icon.png @@ -0,0 +1,538 @@ + + + + + + + + + + + + maintainer-tools/icon.png at master · OCA/maintainer-tools · GitHub + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Skip to content +
+ + + + + + + + + + +
+
+
+ +
+
+
+ + + +

+ + /maintainer-tools + + + + + +

+
+
+ +
+
+
+ + + +
+ +
+

HTTPS clone URL

+
+ + + + +
+
+ + +
+

Subversion checkout URL

+
+ + + + +
+
+ + + +

You can clone with + HTTPS or Subversion. + + + +

+ + + + + + + Download ZIP + +
+
+ +
+ + + + + + +
+ +
+ + + branch: + master + + + +
+ +
+ + + + +
+ + +
+ + +
+
+ @pedrobaeza + pedrobaeza + + +
+ + + +
+ +
+
+
+ +
+ Raw + History +
+ + + + +
+ +
+ 9.455 kb +
+
+ +
+
+ icon.png +
+
+ +
+ +Jump to Line + + +
+ +
+ +
+
+ + +
+ +
+ +
+ + +
+
+
+ +
+
+
+
+
+ +
+ + + + + + +
+ + + Something went wrong with that request. Please try again. +
+ + + + + + + + + + +