mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[MIG] contract_mandate to v10
This commit is contained in:
@@ -2,61 +2,61 @@
|
||||
# Copyright 2017 Carlos Dauden - Tecnativa <carlos.dauden@tecnativa.com>
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
from openerp.tests import common
|
||||
from odoo.tests import HttpCase
|
||||
|
||||
|
||||
class TestContractMandate(common.SavepointCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
super(TestContractMandate, cls).setUpClass()
|
||||
cls.payment_method = cls.env['account.payment.method'].create({
|
||||
class TestContractMandate(HttpCase):
|
||||
|
||||
def setUp(self):
|
||||
super(TestContractMandate, self).setUp()
|
||||
self.payment_method = self.env['account.payment.method'].create({
|
||||
'name': 'Test SDD',
|
||||
'code': 'test_code_sdd',
|
||||
'payment_type': 'inbound',
|
||||
'mandate_required': True,
|
||||
})
|
||||
cls.payment_mode = cls.env['account.payment.mode'].create({
|
||||
self.payment_mode = self.env['account.payment.mode'].create({
|
||||
'name': 'Test payment mode',
|
||||
'bank_account_link': 'variable',
|
||||
'payment_method_id': cls.payment_method.id,
|
||||
'payment_method_id': self.payment_method.id,
|
||||
})
|
||||
cls.partner = cls.env['res.partner'].create({
|
||||
self.partner = self.env['res.partner'].create({
|
||||
'customer': True,
|
||||
'name': 'Test Customer',
|
||||
'customer_payment_mode_id': cls.payment_mode.id,
|
||||
'customer_payment_mode_id': self.payment_mode.id,
|
||||
})
|
||||
cls.partner_bank = cls.env['res.partner.bank'].create({
|
||||
self.partner_bank = self.env['res.partner.bank'].create({
|
||||
'acc_number': '1234',
|
||||
'partner_id': cls.partner.id,
|
||||
'partner_id': self.partner.id,
|
||||
})
|
||||
cls.mandate = cls.env['account.banking.mandate'].create({
|
||||
'partner_id': cls.partner.id,
|
||||
'partner_bank_id': cls.partner_bank.id,
|
||||
self.mandate = self.env['account.banking.mandate'].create({
|
||||
'partner_id': self.partner.id,
|
||||
'partner_bank_id': self.partner_bank.id,
|
||||
'signature_date': '2017-01-01',
|
||||
})
|
||||
cls.uom = cls.env.ref('product.product_uom_hour')
|
||||
cls.product = cls.env['product.product'].create({
|
||||
self.uom = self.env.ref('product.product_uom_hour')
|
||||
self.product = self.env['product.product'].create({
|
||||
'name': 'Custom Service',
|
||||
'type': 'service',
|
||||
'uom_id': cls.uom.id,
|
||||
'uom_po_id': cls.uom.id,
|
||||
'uom_id': self.uom.id,
|
||||
'uom_po_id': self.uom.id,
|
||||
'sale_ok': True,
|
||||
'taxes_id': [(6, 0, [])],
|
||||
})
|
||||
cls.contract = cls.env['account.analytic.account'].create({
|
||||
self.contract = self.env['account.analytic.account'].create({
|
||||
'name': 'Test contract',
|
||||
'partner_id': cls.partner.id,
|
||||
'partner_id': self.partner.id,
|
||||
'recurring_invoices': True,
|
||||
'recurring_interval': 1,
|
||||
'recurring_invoice_line_ids': [(0, 0, {
|
||||
'quantity': 2.0,
|
||||
'price_unit': 200.0,
|
||||
'name': 'Test contract line',
|
||||
'product_id': cls.product.id,
|
||||
'uom_id': cls.product.uom_id.id,
|
||||
'product_id': self.product.id,
|
||||
'uom_id': self.product.uom_id.id,
|
||||
})],
|
||||
'payment_mode_id': cls.payment_mode.id,
|
||||
'mandate_id': cls.mandate.id,
|
||||
'payment_mode_id': self.payment_mode.id,
|
||||
'mandate_id': self.mandate.id,
|
||||
})
|
||||
|
||||
def test_contract_mandate(self):
|
||||
|
||||
Reference in New Issue
Block a user