mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[ADD] select all candidate invoices by default in the payment order
This commit is contained in:
1
account_payment_shortcut/__init__.py
Normal file
1
account_payment_shortcut/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
import payment_order
|
||||
43
account_payment_shortcut/__openerp__.py
Normal file
43
account_payment_shortcut/__openerp__.py
Normal file
@@ -0,0 +1,43 @@
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright (C) 2011 Therp BV (<http://therp.nl>).
|
||||
# All Rights Reserved
|
||||
#
|
||||
# WARNING: This program as such is intended to be used by professional
|
||||
# programmers who take the whole responsability of assessing all potential
|
||||
# consequences resulting from its eventual inadequacies and bugs
|
||||
# End users who are looking for a ready-to-use solution with commercial
|
||||
# garantees and support are strongly adviced to contract EduSense BV
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU 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 General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
{
|
||||
'name': 'Account Payment Invoice Selection Shortcut',
|
||||
'version': '6.0.1.64',
|
||||
'license': 'GPL-3',
|
||||
'author': 'Therp BV',
|
||||
'website': 'http://therp.nl',
|
||||
'category': 'Banking addons',
|
||||
'depends': ['account_payment'],
|
||||
'init_xml': [],
|
||||
'update_xml': [
|
||||
],
|
||||
'demo_xml': [],
|
||||
'description': '''
|
||||
When composing a payment order, select all candidates by default (in the second step of the "Select invoices to pay" wizard).
|
||||
''',
|
||||
'active': False,
|
||||
'installable': True,
|
||||
}
|
||||
31
account_payment_shortcut/payment_order.py
Normal file
31
account_payment_shortcut/payment_order.py
Normal file
@@ -0,0 +1,31 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
from osv import osv, fields
|
||||
|
||||
class payment_order_create(osv.osv_memory):
|
||||
|
||||
_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.
|
||||
"""
|
||||
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 and context.get('line_ids', False)
|
||||
):
|
||||
res['entries'] = context['line_ids']
|
||||
|
||||
return res
|
||||
|
||||
payment_order_create()
|
||||
Reference in New Issue
Block a user