Port SEPA modules to new API

Fix an important regression in account_banking_sepa_direct_debit: "Date of Last Debit" was not set any more
Proper write of date_done with account_banking_payment_export is installed without account_banking_payment_transfer
Add post-install script for date_sent on payment.order
This commit is contained in:
Alexis de Lattre
2015-06-06 00:20:41 +02:00
parent 7089fc150e
commit 3781f37bcb
19 changed files with 379 additions and 428 deletions

View File

@@ -1 +1,2 @@
from . import model
from .post_install import set_date_sent

View File

@@ -31,6 +31,7 @@
'author': "Banking addons community,Odoo Community Association (OCA)",
'website': 'https://github.com/OCA/banking',
'category': 'Banking addons',
'post_init_hook': 'set_date_sent',
'depends': [
'account_banking_payment_export',
],

View File

@@ -98,9 +98,7 @@ class PaymentOrder(models.Model):
def action_done(self):
for line in self.line_ids:
line.date_done = fields.Date.context_today(self)
self.date_done = fields.Date.context_today(self)
# state is written in workflow definition
return True
return super(PaymentOrder, self).action_done()
@api.multi
def _get_transfer_move_lines(self):

View File

@@ -0,0 +1,25 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Account Banking Payment Transfer module for Odoo
# Copyright (C) 2015 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
def set_date_sent(cr, pool):
cr.execute('UPDATE payment_order set date_sent=date_done')

View File

@@ -68,8 +68,6 @@ write({'state':'rejected'})</field>
unfortunately.
-->
<record id="account_payment.act_done" model="workflow.activity">
<field name="action">action_done()
write({'state':'done'})</field>
<field name="flow_stop" eval="False"/>
</record>