diff --git a/account_banking/account_banking.py b/account_banking/account_banking.py index 680806808..1ff65a503 100644 --- a/account_banking/account_banking.py +++ b/account_banking/account_banking.py @@ -876,7 +876,9 @@ class payment_order(osv.osv): _('You can only combine payment orders of the same type') ) # process manual payments - self.action_sent(cr, uid, ids, context) + 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, cursor, uid, ids, **kwargs): @@ -909,9 +911,7 @@ class payment_order(osv.osv): Set both self and payment lines to state 'sent'. ''' self._write_payment_lines(cursor, uid, ids, export_state='sent') - wf_service = netsvc.LocalService('workflow') - for id in ids: - wf_service.trg_validate(uid, 'payment.order', id, 'sent', cursor) + self.write(cursor, uid, ids, {'state':'sent'}) return True def action_rejected(self, cursor, uid, ids, *args): diff --git a/account_banking/account_banking_workflow.xml b/account_banking/account_banking_workflow.xml index eca49415b..3b943b15a 100644 --- a/account_banking/account_banking_workflow.xml +++ b/account_banking/account_banking_workflow.xml @@ -10,8 +10,7 @@ sent - action_sent() -write({'state':'sent'}) + action_sent()) function diff --git a/account_banking_nl_clieop/wizard/export_clieop.py b/account_banking_nl_clieop/wizard/export_clieop.py index 75c9fb4ca..2088c8d98 100644 --- a/account_banking_nl_clieop/wizard/export_clieop.py +++ b/account_banking_nl_clieop/wizard/export_clieop.py @@ -23,6 +23,7 @@ import base64 from datetime import datetime, date, timedelta from osv import osv, fields from tools.translate import _ +import netsvc from account_banking import sepa import clieop @@ -365,8 +366,9 @@ class banking_export_clieop_wizard(osv.osv_memory): clieop_file = clieop_obj.write( cursor, uid, clieop_export['file_id'].id, {'state':'sent'} ) - payment_order_obj.action_sent( - cursor, uid, [x.id for x in clieop_export['payment_order_ids']]) + wf_service = netsvc.LocalService('workflow') + for order in clieop_export['payment_order_ids']: + wf_service.trg_validate(uid, 'payment.order', order.id, 'sent', cursor) return {'type': 'ir.actions.act_window_close'} banking_export_clieop_wizard()