mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[IMP] account_exception: added ignore exception on wizard
H11044
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
# from odoo.tests import common
|
||||
from odoo.tests import Form
|
||||
from odoo.addons.account.tests.common import AccountTestInvoicingCommon
|
||||
from odoo.tests import tagged
|
||||
# from odoo.tests.common import Form
|
||||
|
||||
|
||||
@tagged('post_install', '-at_install')
|
||||
@@ -15,10 +14,25 @@ class TestAccountMoveException(AccountTestInvoicingCommon):
|
||||
|
||||
# must be exceptions when no phone and posting
|
||||
invoice.partner_id.phone = False
|
||||
invoice.action_post()
|
||||
action = invoice.action_post()
|
||||
self.assertTrue(invoice.exception_ids)
|
||||
self.assertEqual(invoice.state, 'draft')
|
||||
|
||||
wizard_model = action.get('res_model', '')
|
||||
self.assertEqual(wizard_model, 'account.move.exception.confirm')
|
||||
wizard = Form(self.env[wizard_model].with_context(action['context'])).save()
|
||||
self.assertFalse(wizard.show_ignore_button)
|
||||
|
||||
# no exceptions when ignoring exceptions and posting
|
||||
invoice.ignore_exception = True
|
||||
invoice.action_post()
|
||||
self.assertFalse(invoice.exception_ids)
|
||||
self.assertEqual(invoice.state, 'posted')
|
||||
|
||||
# no exceptions when phone and posting
|
||||
invoice.button_draft()
|
||||
invoice.ignore_exception = False
|
||||
invoice.partner_id.phone = '123'
|
||||
invoice.action_post()
|
||||
self.assertFalse(invoice.exception_ids)
|
||||
self.assertEqual(invoice.state, 'posted')
|
||||
|
||||
Reference in New Issue
Block a user