mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
24 lines
895 B
Python
24 lines
895 B
Python
from odoo.addons.sale.tests.test_sale_to_invoice import TestSaleToInvoice
|
|
|
|
|
|
class TestSalePayment(TestSaleToInvoice):
|
|
|
|
def setUp(self):
|
|
super(TestSalePayment, self).setUp()
|
|
self.context = {
|
|
'active_model': 'sale.order',
|
|
'active_ids': [self.sale_order.id],
|
|
'active_id': self.sale_order.id,
|
|
}
|
|
|
|
def test_payment(self):
|
|
self.sale_order.action_confirm()
|
|
payment_wizard = self.env['account.payment.register'].with_context(self.context).create({})
|
|
self.assertTrue(payment_wizard.journal_id)
|
|
|
|
payment_action = payment_wizard.create_payments()
|
|
self.assertTrue(isinstance(payment_action, dict))
|
|
payment = self.env[payment_action['res_model']].browse(payment_action['res_id'])
|
|
self.assertTrue(payment.exists())
|
|
self.assertEqual(payment.amount, self.sale_order.amount_total)
|