Port almost all modules to v10 (#305)

Port almost all modules to v10

* Update to EPC Rulebook v9.2 that start to apply on 2016-11-20 (bug #300)
This commit is contained in:
Alexis de Lattre
2016-10-20 01:41:41 +02:00
committed by Pedro M. Baeza
parent 1956039bc6
commit fbe4351dbe
129 changed files with 447 additions and 793 deletions

View File

@@ -7,10 +7,10 @@
{
'name': 'Account Banking Mandate',
'summary': 'Banking mandates',
'version': '9.0.1.0.0',
'version': '10.0.1.0.0',
'license': 'AGPL-3',
'author': "Compassion CH, "
"Serv. Tecnol. Avanzados - Pedro M. Baeza, "
"Tecnativa, "
"Akretion, "
"Odoo Community Association (OCA)",
'website': 'https://github.com/OCA/bank-payment',
@@ -31,6 +31,5 @@
'security/mandate_security.xml',
'security/ir.model.access.csv',
],
'test': ['test/banking_mandate.yml'],
'installable': False,
'installable': True,
}

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<odoo noupdate="1">
<record id="dd_mandate_seq" model="ir.sequence">
@@ -11,5 +10,4 @@
</record>
</data>
</openerp>
</odoo>

View File

@@ -4,8 +4,8 @@
# © 2015-2016 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api, _
from openerp.exceptions import UserError, ValidationError
from odoo import models, fields, api, _
from odoo.exceptions import UserError, ValidationError
class AccountBankingMandate(models.Model):

View File

@@ -5,7 +5,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
from odoo import models, fields, api
class AccountInvoice(models.Model):

View File

@@ -2,7 +2,7 @@
# © 2016 Akretion (http://www.akretion.com/)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
from odoo import models, fields, api
class AccountMoveLine(models.Model):

View File

@@ -4,8 +4,8 @@
# © 2015-2016 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api, _
from openerp.exceptions import ValidationError, UserError
from odoo import models, fields, api, _
from odoo.exceptions import ValidationError, UserError
class AccountPaymentLine(models.Model):

View File

@@ -2,7 +2,7 @@
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields
from odoo import models, fields
class AccountPaymentMethod(models.Model):

View File

@@ -4,7 +4,7 @@
# © 2015-2016 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
from odoo import models, fields, api
class BankPaymentLine(models.Model):

View File

@@ -2,7 +2,7 @@
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
from odoo import models, fields, api
class ResPartner(models.Model):

View File

@@ -3,7 +3,7 @@
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields
from odoo import models, fields
class ResPartnerBank(models.Model):

View File

@@ -1,13 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015 Akretion (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
© 2015-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo noupdate="1">
<openerp>
<data noupdate="1">
<record id="account_banking_mandate_rule" model="ir.rule">
<field name="name">Banking Mandate multi-company</field>
@@ -19,5 +17,5 @@
<field name="perm_create" eval="True"/>
</record>
</data>
</openerp>
</odoo>

View File

@@ -1,35 +0,0 @@
-
In order to test mandate, I create a partner with a bank account.
Then, I create a mandate, validate it, cancel it and the set it back to draft
I create a partner
-
!record {model: res.partner, id: mandate_partner, view: False}:
name: "Mandate test"
-
I create a partner bank account
-
!record {model: res.partner.bank, id: mandate_partner_bank, view: False}:
acc_number: '1234'
partner_id: mandate_partner
-
I create a mandate on 1st January
-
!record {model: account.banking.mandate, id: test_mandate, view: False}:
partner_bank_id: mandate_partner_bank
signature_date: "2014-01-01"
-
I check that the state field is automatically set by default
-
!assert {model: account.banking.mandate, id: test_mandate}:
- state == 'draft'
-
I go through all states by clicking on buttons and check that cancel state is reached
-
!python {model: account.banking.mandate}: |
self.validate(cr, uid, [ref('test_mandate')])
self.cancel(cr, uid, [ref('test_mandate')])
mandate = self.browse(cr, uid, ref('test_mandate'))
assert mandate.state == 'cancel', 'Mandate is not in cancel state'
self.back2draft(cr, uid, [ref('test_mandate')])

View File

@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import test_mandate

View File

@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests.common import TransactionCase
class TestMandate(TransactionCase):
def test_mandate(self):
bank_account = self.env.ref('account_payment_mode.res_partner_12_iban')
mandate = self.env['account.banking.mandate'].create({
'partner_bank_id': bank_account.id,
'signature_date': '2015-01-01',
})
self.assertEqual(mandate.state, 'draft')
mandate.validate()
self.assertEqual(mandate.state, 'valid')
mandate.cancel()
self.assertEqual(mandate.state, 'cancel')
mandate.back2draft()
self.assertEqual(mandate.state, 'draft')

View File

@@ -1,11 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013 Akretion (http://www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
© 2013-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<openerp>
<data>
<odoo>
<record id="view_mandate_form" model="ir.ui.view">
@@ -108,5 +106,4 @@
/>
</data>
</openerp>
</odoo>

View File

@@ -1,18 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013-2016 Akretion (http://www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
© 2013-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<openerp>
<data>
<odoo>
<record id="invoice_form" model="ir.ui.view">
<field name="name">add.mandate.on.customer.invoice.form</field>
<field name="model">account.invoice</field>
<field name="inherit_id" ref="account_payment_partner.invoice_form"/>
<field name="arch" type="xml">
<field name="payment_mode_id" position="after">
<field name="partner_bank_id" position="after">
<field name="mandate_id"
domain="[('partner_id', '=', commercial_partner_id), ('state', '=', 'valid')]"
attrs="{'required': [('mandate_required', '=', True)], 'invisible': [('mandate_required', '=', False)]}"/>
@@ -21,5 +20,5 @@
</field>
</record>
</data>
</openerp>
</odoo>

View File

@@ -1,12 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2016 Akretion (http://www.akretion.com/)
@author Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
© 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<openerp>
<data>
<odoo>
<record id="view_move_line_form" model="ir.ui.view">
@@ -22,5 +20,4 @@
</record>
</data>
</openerp>
</odoo>

View File

@@ -4,7 +4,7 @@
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<data>
<record id="account_payment_line_form" model="ir.ui.view">
<field name="name">account_banking_mandate.account.payment.line.form</field>
@@ -33,5 +33,5 @@
</field>
</record>
</data>
</odoo>

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<odoo>
<record id="account_payment_method_form" model="ir.ui.view">
@@ -16,5 +15,4 @@
</record>
</data>
</openerp>
</odoo>

View File

@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015-2016 Akretion (http://www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
© 2015-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<openerp>
<data>
<odoo>
<record id="bank_payment_line_form" model="ir.ui.view">
<field name="name">banking.mandate.bank.payment.line.form</field>
@@ -32,5 +31,4 @@
</record>
</data>
</openerp>
</odoo>

View File

@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2016 Akretion (http://www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
© 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<openerp>
<data>
<odoo>
<record id="partner_view_buttons" model="ir.ui.view">
<field name="name">mandate.res.partner.form</field>
@@ -22,5 +21,5 @@
</field>
</record>
</data>
</openerp>
</odoo>

View File

@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013-2016 Akretion (http://www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
© 2013-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<openerp>
<data>
<odoo>
<record id="mandate_partner_bank_form" model="ir.ui.view">
<field name="name">mandate.res.partner.bank.form</field>
@@ -31,5 +30,5 @@
</field>
</record>
</data>
</openerp>
</odoo>

View File

@@ -22,7 +22,7 @@ The mandate will be copied from the sale order to the invoice.
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/173/9.0
:target: https://runbot.odoo-community.org/runbot/173/10.0
Known issues / Roadmap
======================

View File

@@ -4,7 +4,7 @@
{
'name': 'Account Banking Mandate Sale',
'version': '9.0.1.0.0',
'version': '10.0.1.0.0',
'category': 'Banking addons',
'license': 'AGPL-3',
'summary': "Adds mandates on sale orders",
@@ -18,5 +18,5 @@
'data': [
'views/sale_order.xml',
],
'installable': False,
'installable': True,
}

View File

@@ -2,7 +2,7 @@
# © 2014-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import models, fields, api
from odoo import models, fields, api
class SaleOrder(models.Model):

View File

@@ -1,12 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2016 Akretion (http://www.akretion.com/)
@author Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
© 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<openerp>
<data>
<odoo>
<record id="view_order_form" model="ir.ui.view">
@@ -14,7 +12,7 @@
<field name="model">sale.order</field>
<field name="inherit_id" ref="account_payment_sale.view_order_form"/>
<field name="arch" type="xml">
<field name="payment_mode_id" position="after">
<field name="fiscal_position_id" position="after">
<field name="commercial_partner_id" invisible="1"/>
<field name="mandate_id"
domain="[('partner_id', '=', commercial_partner_id), ('state', 'in', ('draft', 'valid'))]"/>
@@ -23,5 +21,4 @@
</record>
</data>
</openerp>
</odoo>

View File

@@ -2,7 +2,7 @@
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import models, api
from odoo import models, api
class SaleAdvancePaymentInv(models.TransientModel):

View File

@@ -7,11 +7,11 @@
{
'name': 'Account Banking PAIN Base Module',
'summary': 'Base module for PAIN file generation',
'version': '9.0.1.0.0',
'version': '10.0.1.0.0',
'license': 'AGPL-3',
'author': "Akretion, "
"Noviat, "
"Serv. Tecnol. Avanzados - Pedro M. Baeza, "
"Tecnativa, "
"Antiun Ingeniería S.L., "
"Odoo Community Association (OCA)",
'website': 'https://github.com/OCA/bank-payment',
@@ -26,9 +26,9 @@
'views/account_payment_order.xml',
'views/bank_payment_line_view.xml',
'views/account_payment_mode.xml',
'views/res_company_view.xml',
'views/account_config_settings.xml',
'views/account_payment_method.xml',
],
'post_init_hook': 'set_default_initiating_party',
'installable': False,
'installable': True,
}

View File

@@ -1,15 +0,0 @@
# -*- coding: utf-8 -*-
# © 2015 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp.addons.account_banking_pain_base.post_install\
import set_default_initiating_party
from openerp import pooler
def migrate(cr, version):
if not version:
return
pool = pooler.get_pool(cr.dbname)
set_default_initiating_party(cr, pool)

View File

@@ -1,10 +1,9 @@
# -*- coding: utf-8 -*-
# © 2013-2016 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from . import account_payment_line
from . import account_payment_order
from . import bank_payment_line
from . import account_payment_mode
from . import res_company
from . import account_config_settings
from . import account_payment_method

View File

@@ -0,0 +1,14 @@
# -*- coding: utf-8 -*-
# © 2016 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models, fields
class AccountConfigSettings(models.TransientModel):
_inherit = 'account.config.settings'
initiating_party_issuer = fields.Char(
related='company_id.initiating_party_issuer')
initiating_party_identifier = fields.Char(
related='company_id.initiating_party_identifier')

View File

@@ -3,7 +3,7 @@
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields
from odoo import models, fields
class AccountPaymentLine(models.Model):

View File

@@ -2,8 +2,8 @@
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api, _
from openerp.exceptions import UserError
from odoo import models, fields, api, _
from odoo.exceptions import UserError
class AccountPaymentMethod(models.Model):

View File

@@ -4,7 +4,7 @@
# © 2016 Antiun Ingenieria S.L. - Antonio Espinosa
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields
from odoo import models, fields
class AccountPaymentMode(models.Model):

View File

@@ -4,12 +4,11 @@
# © 2016 Antiun Ingenieria S.L. - Antonio Espinosa
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api, _
from openerp.exceptions import UserError
from openerp.tools.safe_eval import safe_eval
from odoo import models, fields, api, _, tools
from odoo.exceptions import UserError
from odoo.tools.safe_eval import safe_eval
from datetime import datetime
from lxml import etree
from openerp import tools
import logging

View File

@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
# © 2013-2015 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# © 2013-2016 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
from odoo import models, fields, api
class BankPaymentLine(models.Model):

View File

@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
# © 2013-2015 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# © 2013-2016 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# © 2013 Noviat (http://www.noviat.com) - Luc de Meyer
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
from odoo import models, fields, api
import logging
logger = logging.getLogger(__name__)
@@ -22,32 +22,31 @@ class ResCompany(models.Model):
help="This will be used as the 'Initiating Party Identifier' in "
"the PAIN files generated by Odoo.")
@api.model
def _default_initiating_party(self, company):
'''This method is called from post_install.py, which itself is also
called from migrations/8.0.0.2/post-migration.py'''
@api.one
def _default_initiating_party(self):
'''This method is called from post_install.py'''
party_issuer_per_country = {
'BE': 'KBO-BCE', # KBO-BCE = the registry of companies in Belgium
}
logger.debug(
'Calling _default_initiating_party on company %s', company.name)
country_code = company.country_id.code
if not company.initiating_party_issuer:
'Calling _default_initiating_party on company %s', self.name)
country_code = self.country_id.code
if not self.initiating_party_issuer:
if country_code and country_code in party_issuer_per_country:
company.write({
self.write({
'initiating_party_issuer':
party_issuer_per_country[country_code]})
logger.info(
'Updated initiating_party_issuer on company %s',
company.name)
self.name)
party_identifier = False
if not company.initiating_party_identifier:
if company.vat and country_code:
if not self.initiating_party_identifier:
if self.vat and country_code:
if country_code == 'BE':
party_identifier = company.vat[2:].replace(' ', '')
party_identifier = self.vat[2:].replace(' ', '')
if party_identifier:
company.write({
self.write({
'initiating_party_identifier': party_identifier})
logger.info(
'Updated initiating_party_identifier on company %s',
company.name)
self.name)

View File

@@ -3,13 +3,12 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import SUPERUSER_ID
from odoo import api, SUPERUSER_ID
def set_default_initiating_party(cr, pool):
company_ids = pool['res.company'].search(cr, SUPERUSER_ID, [])
companies = pool['res.company'].browse(cr, SUPERUSER_ID, company_ids)
for company in companies:
pool['res.company']._default_initiating_party(
cr, SUPERUSER_ID, company)
def set_default_initiating_party(cr, registry):
with api.Environment.manage():
env = api.Environment(cr, SUPERUSER_ID, {})
companies = env['res.company'].search([])
companies._default_initiating_party()
return

View File

@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
© 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<odoo>
<record id="view_account_config_settings" model="ir.ui.view">
<field name="name">pain.group.on.account.config.settings</field>
<field name="model">account.config.settings</field>
<field name="inherit_id" ref="account.view_account_config_settings"/>
<field name="arch" type="xml">
<xpath expr="//separator[@name='analytic_account']" position="before">
<group name="pain">
<field name="initiating_party_identifier"/>
<field name="initiating_party_issuer"/>
</group>
</xpath>
</field>
</record>
</odoo>

View File

@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013-2016 Akretion (http://www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
© 2013-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<openerp>
<data>
<odoo>
<record id="account_payment_line_form" model="ir.ui.view">
<field name="name">pain.base.account.payment.line</field>
@@ -19,5 +18,5 @@
</field>
</record>
</data>
</openerp>
</odoo>

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<odoo>
<record id="account_payment_method_form" model="ir.ui.view">
@@ -28,5 +27,4 @@
</record>
</data>
</openerp>
</odoo>

View File

@@ -1,12 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013-2016 Akretion (http://www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
Copyright (C) 2013-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
© 2015 Antiun Ingenieria S.L. - Antonio Espinosa
The licence is in the file __openerp__.py
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<openerp>
<data>
<odoo>
<record id="account_payment_mode_form" model="ir.ui.view">
@@ -23,5 +21,4 @@
</record>
</data>
</openerp>
</odoo>

View File

@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2016 Akretion (http://www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
© 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<openerp>
<data>
<odoo>
<record id="account_payment_order_form" model="ir.ui.view">
<field name="name">pain.base.account.payment.order.form</field>
@@ -20,5 +19,5 @@
</field>
</record>
</data>
</openerp>
</odoo>

View File

@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015-2016 Akretion (http://www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
© 2015-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<openerp>
<data>
<odoo>
<record id="bank_payment_line_form" model="ir.ui.view">
<field name="name">pain.base.bank.payment.line.form</field>
@@ -19,5 +18,5 @@
</field>
</record>
</data>
</openerp>
</odoo>

View File

@@ -1,25 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013-2015 Akretion (http://www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
-->
<openerp>
<data>
<record id="view_company_form" model="ir.ui.view">
<field name="name">pain.group.on.res.company.form</field>
<field name="model">res.company</field>
<field name="inherit_id" ref="base.view_company_form"/>
<field name="arch" type="xml">
<group name="account_grp" position="after">
<group name="pain" string="Payment Initiation">
<field name="initiating_party_identifier"/>
<field name="initiating_party_issuer"/>
</group>
</group>
</field>
</record>
</data>
</openerp>

View File

@@ -49,7 +49,7 @@ Transfer that you created during the configuration step.
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/173/9.0
:target: https://runbot.odoo-community.org/runbot/173/10.0
Known issues / Roadmap
======================

View File

@@ -7,10 +7,10 @@
{
'name': 'Account Banking SEPA Credit Transfer',
'summary': 'Create SEPA XML files for Credit Transfers',
'version': '9.0.1.0.0',
'version': '10.0.1.0.0',
'license': 'AGPL-3',
'author': "Akretion, "
"Serv. Tecnol. Avanzados - Pedro M. Baeza, "
"Tecnativa, "
"Antiun Ingeniería S.L., "
"Odoo Community Association (OCA)",
'website': 'https://github.com/OCA/bank-payment',
@@ -24,5 +24,5 @@
'demo/sepa_credit_transfer_demo.xml'
],
'post_init_hook': 'update_bank_journals',
'installable': False,
'installable': True,
}

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<odoo noupdate="1">
<record id="sepa_credit_transfer" model="account.payment.method">
@@ -12,5 +11,4 @@
</record>
</data>
</openerp>
</odoo>

View File

@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo noupdate="1">
<openerp>
<data noupdate="1">
<record id="payment_mode_outbound_sepa_ct1" model="account.payment.mode">
<field name="name">SEPA Credit Transfer to suppliers</field>
@@ -21,5 +20,5 @@
<field name="supplier_payment_mode_id" ref="payment_mode_outbound_sepa_ct1"/>
</record>
</data>
</openerp>
</odoo>

View File

@@ -1,52 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# 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/>.
#
##############################################################################
from openerp import pooler, SUPERUSER_ID
def migrate(cr, version):
if not version:
return
pool = pooler.get_pool(cr.dbname)
cr.execute('''
SELECT
old_sepa.file,
rel.account_order_id AS payment_order_id,
payment_order.reference
FROM migration_banking_export_sepa old_sepa
LEFT JOIN migration_account_payment_order_sepa_rel rel
ON old_sepa.id=rel.banking_export_sepa_id
LEFT JOIN payment_order ON payment_order.id=rel.account_order_id
''')
for sepa_file in cr.dictfetchall():
if not sepa_file['payment_order_id']:
continue
filename = 'sct_%s.xml' % sepa_file['reference'].replace('/', '-')
pool['ir.attachment'].create(
cr, SUPERUSER_ID, {
'name': filename,
'res_id': sepa_file['payment_order_id'],
'res_model': 'payment.order',
'datas': str(sepa_file['file']),
})
return

View File

@@ -1,32 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# 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 migrate(cr, version):
if not version:
return
cr.execute(
'ALTER TABLE banking_export_sepa '
'RENAME TO migration_banking_export_sepa')
cr.execute(
'ALTER TABLE account_payment_order_sepa_rel '
'RENAME TO migration_account_payment_order_sepa_rel')

View File

@@ -2,7 +2,7 @@
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
from odoo import models, fields, api
class AccountPaymentMethod(models.Model):

View File

@@ -3,8 +3,8 @@
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, api, _
from openerp.exceptions import UserError
from odoo import models, api, _
from odoo.exceptions import UserError
from lxml import etree

View File

@@ -2,18 +2,18 @@
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import SUPERUSER_ID
from odoo import api, SUPERUSER_ID
def update_bank_journals(cr, pool):
ajo = pool['account.journal']
journal_ids = ajo.search(
cr, SUPERUSER_ID, [('type', '=', 'bank')])
sct_id = pool['ir.model.data'].xmlid_to_res_id(
cr, SUPERUSER_ID,
'account_banking_sepa_credit_transfer.sepa_credit_transfer')
if sct_id:
ajo.write(cr, SUPERUSER_ID, journal_ids, {
'outbound_payment_method_ids': [(4, sct_id)],
})
def update_bank_journals(cr, registry):
with api.Environment.manage():
env = api.Environment(cr, SUPERUSER_ID, {})
ajo = env['account.journal']
journals = ajo.search([('type', '=', 'bank')])
sct = env.ref(
'account_banking_sepa_credit_transfer.sepa_credit_transfer')
if sct:
journals.write({
'outbound_payment_method_ids': [(4, sct.id)],
})
return

View File

@@ -2,9 +2,9 @@
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp.addons.account.tests.account_test_classes\
from odoo.addons.account.tests.account_test_classes\
import AccountingTestCase
from openerp.tools import float_compare
from odoo.tools import float_compare
import time
from lxml import etree
@@ -56,6 +56,9 @@ class TestSCT(AccountingTestCase):
self.eur_currency = self.env.ref('base.EUR')
self.usd_currency = self.env.ref('base.USD')
self.main_company.currency_id = self.eur_currency.id
# Trigger the recompute of account type on res.partner.bank
for bank_acc in self.partner_bank_model.search([]):
bank_acc.acc_number = bank_acc.acc_number
def test_eur_currency_sct(self):
invoice1 = self.create_invoice(
@@ -126,7 +129,6 @@ class TestSCT(AccountingTestCase):
self.assertEquals(attachment.datas_fname[-4:], '.xml')
xml_file = attachment.datas.decode('base64')
xml_root = etree.fromstring(xml_file)
# print "xml_file=", etree.tostring(xml_root, pretty_print=True)
namespaces = xml_root.nsmap
namespaces['p'] = xml_root.nsmap[None]
namespaces.pop(None)
@@ -204,7 +206,6 @@ class TestSCT(AccountingTestCase):
self.assertEquals(attachment.datas_fname[-4:], '.xml')
xml_file = attachment.datas.decode('base64')
xml_root = etree.fromstring(xml_file)
# print "xml_file=", etree.tostring(xml_root, pretty_print=True)
namespaces = xml_root.nsmap
namespaces['p'] = xml_root.nsmap[None]
namespaces.pop(None)
@@ -247,5 +248,5 @@ class TestSCT(AccountingTestCase):
'name': 'Great service',
'account_id': self.account_expense.id,
})
invoice.signal_workflow('invoice_open')
invoice.action_invoice_open()
return invoice

View File

@@ -47,7 +47,7 @@ you created during the configuration step.
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/173/9.0
:target: https://runbot.odoo-community.org/runbot/173/10.0
Known issues / Roadmap
======================

View File

@@ -7,10 +7,10 @@
{
'name': 'Account Banking SEPA Direct Debit',
'summary': 'Create SEPA files for Direct Debit',
'version': '9.0.1.0.0',
'version': '10.0.1.0.0',
'license': 'AGPL-3',
'author': "Akretion, "
"Serv. Tecnol. Avanzados - Pedro M. Baeza, "
"Tecnativa, "
"Antiun Ingeniería S.L., "
"Odoo Community Association (OCA)",
'website': 'https://github.com/OCA/bank-payment',
@@ -21,7 +21,6 @@
],
'data': [
'views/account_banking_mandate_view.xml',
'views/res_company_view.xml',
'views/res_config.xml',
'views/account_payment_mode.xml',
'data/mandate_expire_cron.xml',
@@ -32,5 +31,5 @@
],
'demo': ['demo/sepa_direct_debit_demo.xml'],
'post_init_hook': 'update_bank_journals',
'installable': False,
'installable': True,
}

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<odoo>
<data noupdate="1">
@@ -14,4 +14,4 @@
</data>
</openerp>
</odoo>

View File

@@ -1,12 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013-2016 Akretion (http://www.akretion.com/)
@author Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
© 2013-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<openerp>
<odoo>
<data noupdate="1">
<record id="sdd_mandate_expire_cron" model="ir.cron">
<field name="name">Set SEPA Direct Debit Mandates to Expired</field>
@@ -18,7 +17,7 @@
<field name="doall" eval="False"/>
<field name="model" eval="'account.banking.mandate'"/>
<field name="function" eval="'_sdd_mandate_set_state_to_expired'" />
<field name="args" eval="'(None, )'"/>
<field name="args" eval="'()'"/>
</record>
</data>
</openerp>
</odoo>

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<odoo>
<record id="paperformat_euro_sepa_lowmargin" model="report.paperformat">
<field name="name">European A4 low margin for SEPA</field>
@@ -18,5 +17,4 @@
<field name="dpi">80</field>
</record>
</data>
</openerp>
</odoo>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<odoo>
<data noupdate="1">
<record id="payment_mode_inbound_sepa_dd1" model="account.payment.mode">
@@ -46,4 +46,4 @@
</data>
</openerp>
</odoo>

View File

@@ -1,50 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# 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/>.
#
##############################################################################
from openerp import pooler, SUPERUSER_ID
def migrate(cr, version):
if not version:
return
pool = pooler.get_pool(cr.dbname)
cr.execute('''
SELECT
old_sepa.file,
rel.account_order_id AS payment_order_id,
payment_order.reference
FROM migration_banking_export_sdd old_sepa
LEFT JOIN migration_account_payment_order_sdd_rel rel
ON old_sepa.id=rel.banking_export_sepa_id
LEFT JOIN payment_order ON payment_order.id=rel.account_order_id
''')
for sepa_file in cr.dictfetchall():
filename = 'sdd_%s.xml' % sepa_file['reference'].replace('/', '-')
pool['ir.attachment'].create(
cr, SUPERUSER_ID, {
'name': filename,
'res_id': sepa_file['payment_order_id'],
'res_model': 'payment.order',
'datas': str(sepa_file['file']),
})
return

View File

@@ -1,32 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# 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 migrate(cr, version):
if not version:
return
cr.execute(
'ALTER TABLE banking_export_sdd '
'RENAME TO migration_banking_export_sdd')
cr.execute(
'ALTER TABLE account_payment_order_sdd_rel '
'RENAME TO migration_account_payment_order_sdd_rel')

View File

@@ -1,13 +0,0 @@
# -*- coding: utf-8 -*-
# © 2016 Sergio Teruel <sergio.teruel@tecnativa.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
def migrate(cr, version):
if not version:
return
cr.execute('''
UPDATE account_banking_mandate SET format='sepa'
''')
return

View File

@@ -3,7 +3,7 @@
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api, exceptions, _
from odoo import models, fields, api, exceptions, _
from datetime import datetime
from dateutil.relativedelta import relativedelta
import logging

View File

@@ -2,7 +2,7 @@
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
from odoo import models, fields, api
class AccountPaymentMethod(models.Model):

View File

@@ -2,9 +2,9 @@
# © 2016 Antiun Ingenieria S.L. - Antonio Espinosa
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api, _
from odoo import models, fields, api, _
from .common import is_sepa_creditor_identifier_valid
from openerp.exceptions import ValidationError
from odoo.exceptions import ValidationError
class AccountPaymentMode(models.Model):

View File

@@ -2,8 +2,8 @@
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import models, fields, api, _
from openerp.exceptions import UserError
from odoo import models, fields, api, _
from odoo.exceptions import UserError
from lxml import etree
@@ -210,46 +210,24 @@ class AccountPaymentOrder(models.Model):
'line.mandate_id.signature_date',
{'line': line}, 10, gen_args=gen_args)
if sequence_type == 'FRST' and line.mandate_id.last_debit_date:
previous_bank = self._get_previous_bank(line)
if previous_bank:
amendment_indicator = etree.SubElement(
mandate_related_info, 'AmdmntInd')
amendment_indicator.text = 'true'
amendment_info_details = etree.SubElement(
mandate_related_info, 'AmdmntInfDtls')
if (
previous_bank.bank_bic ==
line.partner_bank_id.bank_bic):
ori_debtor_account = etree.SubElement(
amendment_info_details, 'OrgnlDbtrAcct')
ori_debtor_account_id = etree.SubElement(
ori_debtor_account, 'Id')
ori_debtor_account_iban = etree.SubElement(
ori_debtor_account_id, 'IBAN')
ori_debtor_account_iban.text = self._validate_iban(
self._prepare_field(
'Original Debtor Account',
'previous_bank.sanitized_acc_number',
{'previous_bank': previous_bank},
gen_args=gen_args))
else:
ori_debtor_agent = etree.SubElement(
amendment_info_details, 'OrgnlDbtrAgt')
ori_debtor_agent_institution = etree.SubElement(
ori_debtor_agent, 'FinInstnId')
ori_debtor_agent_bic = etree.SubElement(
ori_debtor_agent_institution, bic_xml_tag)
ori_debtor_agent_bic.text = self._prepare_field(
'Original Debtor Agent',
'previous_bank.bank_bic',
{'previous_bank': previous_bank},
gen_args=gen_args)
ori_debtor_agent_other = etree.SubElement(
ori_debtor_agent_institution, 'Othr')
ori_debtor_agent_other_id = etree.SubElement(
ori_debtor_agent_other, 'Id')
ori_debtor_agent_other_id.text = 'SMNDA'
# SMNDA = Same Mandate New Debtor Agent
amendment_indicator = etree.SubElement(
mandate_related_info, 'AmdmntInd')
amendment_indicator.text = 'true'
amendment_info_details = etree.SubElement(
mandate_related_info, 'AmdmntInfDtls')
ori_debtor_account = etree.SubElement(
amendment_info_details, 'OrgnlDbtrAcct')
ori_debtor_account_id = etree.SubElement(
ori_debtor_account, 'Id')
ori_debtor_agent_other = etree.SubElement(
ori_debtor_account_id, 'Othr')
ori_debtor_agent_other_id = etree.SubElement(
ori_debtor_agent_other, 'Id')
ori_debtor_agent_other_id.text = 'SMNDA'
# Until 20/11/2016, SMNDA meant
# "Same Mandate New Debtor Agent"
# After 20/11/2016, SMNDA means
# "Same Mandate New Debtor Account"
self.generate_party_block(
dd_transaction_info, 'Dbtr', 'C',

View File

@@ -2,7 +2,7 @@
# © 2015-2016 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, api
from odoo import models, api
class BankPaymentLine(models.Model):

View File

@@ -4,9 +4,9 @@
# © 2016 Antiun Ingenieria S.L. - Antonio Espinosa
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api, _
from odoo import models, fields, api, _
from .common import is_sepa_creditor_identifier_valid
from openerp.exceptions import ValidationError
from odoo.exceptions import ValidationError
class ResCompany(models.Model):
@@ -19,8 +19,6 @@ class ResCompany(models.Model):
"of :\n- your country ISO code (2 letters)\n- a 2-digits "
"checkum\n- a 3-letters business code\n- a country-specific "
"identifier")
original_creditor_identifier = fields.Char(
string='Original Creditor Identifier', size=70)
@api.multi
@api.constrains('sepa_creditor_identifier')

View File

@@ -2,7 +2,7 @@
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields
from odoo import models, fields
class AccountConfigSettings(models.TransientModel):

View File

@@ -2,17 +2,18 @@
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import SUPERUSER_ID
from odoo import api, SUPERUSER_ID
def update_bank_journals(cr, pool):
ajo = pool['account.journal']
journal_ids = ajo.search(cr, SUPERUSER_ID, [('type', '=', 'bank')])
sdd_id = pool['ir.model.data'].xmlid_to_res_id(
cr, SUPERUSER_ID,
'account_banking_sepa_direct_debit.sepa_direct_debit')
if sdd_id:
ajo.write(cr, SUPERUSER_ID, journal_ids, {
'inbound_payment_method_ids': [(4, sdd_id)],
})
def update_bank_journals(cr, registry):
with api.Environment.manage():
env = api.Environment(cr, SUPERUSER_ID, {})
ajo = env['account.journal']
journals = ajo.search([('type', '=', 'bank')])
sdd = env.ref(
'account_banking_sepa_direct_debit.sepa_direct_debit')
if sdd:
journals.write({
'inbound_payment_method_ids': [(4, sdd.id)],
})
return

View File

@@ -1,21 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<odoo>
<!-- QWeb Report -->
<report
id="report_sepa_direct_debit_mandate"
model="account.banking.mandate"
string="Sepa Mandate"
report_type="qweb-pdf"
name="account_banking_sepa_direct_debit.sepa_direct_debit_mandate"
file="account_banking_sepa_direct_debit.sepa_direct_debit_mandate"
<!-- QWeb Report -->
<report
id="report_sepa_direct_debit_mandate"
model="account.banking.mandate"
string="Sepa Mandate"
report_type="qweb-pdf"
name="account_banking_sepa_direct_debit.sepa_direct_debit_mandate"
file="account_banking_sepa_direct_debit.sepa_direct_debit_mandate"
/>
<record id="report_sepa_direct_debit_mandate" model="ir.actions.report.xml">
<field name="paperformat_id"
ref="account_banking_sepa_direct_debit.paperformat_euro_sepa_lowmargin"/>
</record>
<record id="report_sepa_direct_debit_mandate" model="ir.actions.report.xml">
<field name="paperformat_id"
ref="account_banking_sepa_direct_debit.paperformat_euro_sepa_lowmargin"/>
</record>
</data>
</openerp>
</odoo>

View File

@@ -2,16 +2,17 @@
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp.addons.account.tests.account_test_classes\
from odoo.addons.account.tests.account_test_classes\
import AccountingTestCase
from openerp.tools import float_compare
from odoo.tools import float_compare
import time
from lxml import etree
class TestSDD(AccountingTestCase):
def test_sdd(self):
def setUp(self):
super(TestSDD, self).setUp()
self.company = self.env['res.company']
self.account_model = self.env['account.account']
self.move_model = self.env['account.move']
@@ -53,8 +54,13 @@ class TestSDD(AccountingTestCase):
'bank_account_link': 'fixed',
'fixed_journal_id': self.bank_journal.id,
})
eur_currency_id = self.env.ref('base.EUR').id
company.currency_id = eur_currency_id
self.eur_currency_id = self.env.ref('base.EUR').id
company.currency_id = self.eur_currency_id
# Trigger the recompute of account type on res.partner.bank
for bank_acc in self.partner_bank_model.search([]):
bank_acc.acc_number = bank_acc.acc_number
def test_sdd(self):
self.env.ref(
'account_banking_sepa_direct_debit.res_partner_2_mandate').\
recurrent_sequence_type = 'first'
@@ -81,7 +87,8 @@ class TestSDD(AccountingTestCase):
self.assertEquals(len(pay_lines), 1)
agrolait_pay_line1 = pay_lines[0]
accpre = self.env['decimal.precision'].precision_get('Account')
self.assertEquals(agrolait_pay_line1.currency_id.id, eur_currency_id)
self.assertEquals(
agrolait_pay_line1.currency_id.id, self.eur_currency_id)
self.assertEquals(
agrolait_pay_line1.mandate_id, invoice1.mandate_id)
self.assertEquals(
@@ -100,7 +107,8 @@ class TestSDD(AccountingTestCase):
('partner_id', '=', self.partner_agrolait.id)])
self.assertEquals(len(bank_lines), 1)
agrolait_bank_line = bank_lines[0]
self.assertEquals(agrolait_bank_line.currency_id.id, eur_currency_id)
self.assertEquals(
agrolait_bank_line.currency_id.id, self.eur_currency_id)
self.assertEquals(float_compare(
agrolait_bank_line.amount_currency, 42.0, precision_digits=accpre),
0)
@@ -163,5 +171,5 @@ class TestSDD(AccountingTestCase):
'name': 'Great service',
'account_id': self.account_revenue.id,
})
invoice.signal_workflow('invoice_open')
invoice.action_invoice_open()
return invoice

View File

@@ -1,14 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013-2016 Akretion (http://www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
© 2013-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<!--
Customize all mandate views (and actions) to fit SEPA mandate style
-->
<openerp>
<data>
<odoo>
<record id="view_mandate_form" model="ir.ui.view">
@@ -62,5 +60,5 @@
</field>
</record>
</data>
</openerp>
</odoo>

View File

@@ -2,8 +2,8 @@
<!-- © 2015 Antiun Ingenieria S.L. - Antonio Espinosa
© 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -->
<openerp>
<data>
<odoo>
<record id="account_payment_mode_form" model="ir.ui.view">
<field name="name">Add SEPA identifiers on payment mode form</field>
@@ -19,5 +19,5 @@
</field>
</record>
</data>
</openerp>
</odoo>

View File

@@ -1,22 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2013-2016 Akretion (http://www.akretion.com)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
-->
<openerp>
<data>
<record id="view_company_form" model="ir.ui.view">
<field name="name">sepa_direct_debit.res.company.form</field>
<field name="model">res.company</field>
<field name="inherit_id" ref="account_banking_pain_base.view_company_form"/>
<field name="arch" type="xml">
<group name="pain" position="inside">
<field name="sepa_creditor_identifier"/>
</group>
</field>
</record>
</data>
</openerp>

View File

@@ -1,21 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="view_account_config_settings" model="ir.ui.view">
<field name="name">sepa_direct_debit.account_config_settings.form</field>
<field name="model">account.config.settings</field>
<field name="inherit_id" ref="account.view_account_config_settings"/>
<field name="inherit_id" ref="account_banking_pain_base.view_account_config_settings"/>
<field name="arch" type="xml">
<div name="payment_acquirer" position="before">
<div name="sepa_direct_debit">
<label for="sepa_creditor_identifier"/>
<field name="sepa_creditor_identifier" class="oe_inline"
placeholder="Write the ICS of your company"/>
</div>
</div>
<group name="pain" position="inside">
<field name="sepa_creditor_identifier"
placeholder="Write the ICS of your company"/>
</group>
</field>
</record>
</data>
</odoo>

View File

@@ -20,7 +20,7 @@ This module doesn't add any feature, but it is used by several other modules.
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/173/9.0
:target: https://runbot.odoo-community.org/runbot/173/10.0
Bug Tracker
===========

View File

@@ -4,7 +4,7 @@
{
'name': 'Account Payment Mode',
'version': '9.0.1.0.0',
'version': '10.0.1.0.0',
'license': 'AGPL-3',
'author': "Akretion,Odoo Community Association (OCA)",
'website': 'https://github.com/OCA/bank-payment',
@@ -19,5 +19,5 @@
'views/account_journal.xml',
],
'demo': ['demo/payment_demo.xml'],
'installable': False,
'installable': True,
}

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<odoo noupdate="1">
<record id="bank_fiducial" model="res.bank">
<field name="name">Fiducial Banque</field>
@@ -106,5 +105,4 @@
</record>
</data>
</openerp>
</odoo>

View File

@@ -2,7 +2,7 @@
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields
from odoo import models, fields
class AccountJournal(models.Model):

View File

@@ -2,7 +2,7 @@
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
from odoo import models, fields, api
class AccountPaymentMethod(models.Model):

View File

@@ -2,8 +2,8 @@
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api, _
from openerp.exceptions import ValidationError
from odoo import models, fields, api, _
from odoo.exceptions import ValidationError
class AccountPaymentMode(models.Model):

View File

@@ -2,7 +2,7 @@
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields
from odoo import models, fields
class ResPartnerBank(models.Model):

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- FIX of the 'account' module: on the form view of a bank journal,
allow to link to an existing bank account -->
@@ -25,5 +24,4 @@ allow to link to an existing bank account -->
</field>
</record>
</data>
</odoo>

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- The object account.payment.method is defined in the account module
but there are no view for this object in the account module... so we define it
@@ -59,5 +58,4 @@ here. I hate the objects that don't have a view... -->
parent="account.account_management_menu"
sequence="30" />
</data>
</odoo>

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<odoo>
<record id="account_payment_mode_form" model="ir.ui.view">
<field name="name">account.payment.mode.form</field>
@@ -68,5 +67,4 @@
parent="account.account_management_menu"
sequence="25" />
</data>
</openerp>
</odoo>

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<odoo>
<!-- Avoid creation of bank accounts linked to contacts.
@@ -19,5 +18,4 @@ which prevents the selection of a contact -->
</record>
</data>
</openerp>
</odoo>

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<odoo>
<!-- Show acc_type on res.partner.bank in order to be able to
detect wrong IBANs -->
@@ -41,5 +40,4 @@ detect wrong IBANs -->
</record>
</data>
</openerp>
</odoo>

View File

@@ -34,7 +34,7 @@ This module also adds a button *Add to Payment Order* on supplier invoices and a
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/173/9.0
:target: https://runbot.odoo-community.org/runbot/173/10.0
Known issues / Roadmap
======================

View File

@@ -8,11 +8,11 @@
{
'name': 'Account Payment Order',
'version': '9.0.1.1.0',
'version': '10.0.1.1.0',
'license': 'AGPL-3',
'author': "ACSONE SA/NV, "
"Therp BV, "
"Serv. Tecnol. Avanzados - Pedro M. Baeza, "
"Tecnativa, "
"Akretion, "
"Odoo Community Association (OCA)",
'website': 'https://github.com/OCA/bank-payment',
@@ -37,5 +37,5 @@
'data/payment_seq.xml',
],
'demo': ['demo/payment_demo.xml'],
'installable': False,
'installable': True,
}

View File

@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Add manual bank transfer as default payment option -->
<record model="payment.mode.type" id="manual_bank_tranfer">
<field name="name">Manual Bank Transfer</field>
<field name="code">BANKMAN</field>
<field name="suitable_bank_types"
eval="[(6,0,[ref('base.bank_normal'),ref('base_iban.bank_iban'),])]" />
<field name="ir_model_id"
ref="model_payment_manual"/>
<field name="payment_order_type">payment</field>
</record>
</data>
</openerp>

View File

@@ -1,12 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2015-2016 Akretion (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
© 2015-2016 Akretion (http://www.akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->
<openerp>
<data>
<odoo>
<record id="bank_payment_line_seq" model="ir.sequence">
@@ -34,5 +33,4 @@
</record>
</data>
</openerp>
</odoo>

View File

@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data noupdate="1">
<odoo noupdate="1">
<record id="account_payment_mode.payment_mode_outbound_dd1" model="account.payment.mode">
@@ -30,5 +29,4 @@
</record>
</data>
</openerp>
</odoo>

View File

@@ -4,8 +4,8 @@
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api, _
from openerp.exceptions import UserError
from odoo import models, fields, api, _
from odoo.exceptions import UserError
class AccountInvoice(models.Model):

View File

@@ -2,7 +2,7 @@
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields
from odoo import models, fields
class AccountMove(models.Model):

View File

@@ -3,7 +3,7 @@
# © 2014 Serv. Tecnol. Avanzados - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api
from odoo import models, fields, api
class AccountMoveLine(models.Model):

View File

@@ -2,8 +2,8 @@
# © 2015-2016 Akretion - Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api, _
from openerp.exceptions import UserError
from odoo import models, fields, api, _
from odoo.exceptions import UserError
class AccountPaymentLine(models.Model):

View File

@@ -5,8 +5,8 @@
# © 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import models, fields, api, _
from openerp.exceptions import ValidationError
from odoo import models, fields, api, _
from odoo.exceptions import ValidationError
class AccountPaymentMode(models.Model):

Some files were not shown because too many files have changed in this diff Show More