diff --git a/account_banking_payment/__openerp__.py b/account_banking_payment/__openerp__.py index af1ecab2e..a0984398f 100644 --- a/account_banking_payment/__openerp__.py +++ b/account_banking_payment/__openerp__.py @@ -32,17 +32,14 @@ 'category': 'Banking addons', 'depends': [ 'account_banking', - 'account_payment', + 'account_banking_payment_export', ], 'data': [ 'view/account_payment.xml', 'view/banking_transaction_wizard.xml', 'view/payment_mode.xml', 'view/payment_mode_type.xml', - 'view/bank_payment_manual.xml', - 'data/payment_mode_type.xml', 'workflow/account_payment.xml', - 'security/ir.model.access.csv', ], 'description': ''' This addon adds payment infrastructure to the Banking Addons. diff --git a/account_banking_payment/model/__init__.py b/account_banking_payment/model/__init__.py index 9908c8e01..e7ae81724 100644 --- a/account_banking_payment/model/__init__.py +++ b/account_banking_payment/model/__init__.py @@ -5,5 +5,4 @@ import payment_mode_type import payment_order_create import banking_import_transaction import banking_transaction_wizard -import bank_payment_manual import banking_import_line diff --git a/account_banking_payment/model/account_payment.py b/account_banking_payment/model/account_payment.py index 2820b7e61..6153b662e 100644 --- a/account_banking_payment/model/account_payment.py +++ b/account_banking_payment/model/account_payment.py @@ -115,49 +115,6 @@ class payment_order(orm.Model): 'payment_order_type': 'payment', } - def launch_wizard(self, cr, uid, ids, context=None): - """ - 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 == None: - context = {} - result = {} - orders = self.browse(cr, uid, ids, context) - order = orders[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 - 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 = { - 'name': wizard_obj._description or _('Payment Order Export'), - 'view_type': 'form', - 'view_mode': 'form', - 'res_model': wizard_model, - 'domain': [], - '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:]: - if order.mode.type and order.mode.type.ir_model_id: - raise orm.except_orm( - _('Error'), - _('You can only combine payment orders of the same type') - ) - # process manual payments - wf_service = netsvc.LocalService('workflow') - for order_id in ids: - wf_service.trg_validate(uid, 'payment.order', order_id, 'sent', cr) - return result - def _write_payment_lines(self, cr, uid, ids, **kwargs): ''' ORM method for setting attributes of corresponding payment.line objects. diff --git a/account_banking_payment/model/payment_mode.py b/account_banking_payment/model/payment_mode.py index f93acec8e..6237593b6 100644 --- a/account_banking_payment/model/payment_mode.py +++ b/account_banking_payment/model/payment_mode.py @@ -27,28 +27,9 @@ from openerp.osv import orm, fields class payment_mode(orm.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): - """ Reinstates functional code for suitable bank type filtering. - 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): - res = [type.code for type 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.' - ), 'transfer_account_id': fields.many2one( 'account.account', 'Transfer account', domain=[('type', '=', 'other'), diff --git a/account_banking_payment/model/payment_mode_type.py b/account_banking_payment/model/payment_mode_type.py index 51de7ca66..572cce869 100644 --- a/account_banking_payment/model/payment_mode_type.py +++ b/account_banking_payment/model/payment_mode_type.py @@ -27,30 +27,9 @@ from openerp.osv import orm, fields class payment_mode_type(orm.Model): - _name = 'payment.mode.type' - _description = 'Payment Mode Type' + _inherit = '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' - ), - # Setting suitable_bank_types to required pending - # https://bugs.launchpad.net/openobject-addons/+bug/786845 - '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, diff --git a/account_banking_payment/model/payment_order_create.py b/account_banking_payment/model/payment_order_create.py index 68a0d22f4..c7ac88790 100644 --- a/account_banking_payment/model/payment_order_create.py +++ b/account_banking_payment/model/payment_order_create.py @@ -23,9 +23,7 @@ # ############################################################################## -from datetime import datetime from openerp.osv import orm, fields -from openerp.tools import DEFAULT_SERVER_DATE_FORMAT from openerp.tools.translate import _ diff --git a/account_banking_payment/view/account_payment.xml b/account_banking_payment/view/account_payment.xml index 4f7601332..c26847abf 100644 --- a/account_banking_payment/view/account_payment.xml +++ b/account_banking_payment/view/account_payment.xml @@ -17,10 +17,6 @@ 'invisible':[('state','!=','draft')] } - - launch_wizard - diff --git a/account_banking_payment/view/bank_payment_manual.xml b/account_banking_payment/view/bank_payment_manual.xml deleted file mode 100644 index 538862ca3..000000000 --- a/account_banking_payment/view/bank_payment_manual.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - Form for manual payment wizard - payment.manual - -
-