[IMP] account_exception: back to detedt error on post

H11044
This commit is contained in:
Jorge Che
2022-09-30 21:06:40 +00:00
parent 78fa2aec94
commit c0a1c1af4b
4 changed files with 13 additions and 33 deletions

View File

@@ -1,15 +1,16 @@
# from odoo.tests import common
from odoo.addons.account.tests.common import AccountTestInvoicingCommon
from odoo.tests import tagged
# from odoo.tests.common import Form
@tagged('post_install', '-at_install')
class TestAccountMoveException(AccountTestInvoicingCommon):
def test_10_validation_on_write(self):
def test_10_validation_on_post(self):
self.env.user.groups_id += self.env.ref('analytic.group_analytic_accounting')
exception = self.env.ref('account_exception.excep_no_phone').sudo()
exception.active = True
exception = self.env.ref('account_exception.except_no_phone').sudo()
exception.active = True
invoice = self.init_invoice('out_invoice', products=self.product_a)
# must be exceptions when no phone and posting
@@ -20,5 +21,4 @@ class TestAccountMoveException(AccountTestInvoicingCommon):
# no exceptions when phone and posting
invoice.partner_id.phone = '123'
invoice.action_post()
self.assertTrue(invoice.exception_ids)
self.assertTrue(invoice.state='posted')
self.assertFalse(invoice.exception_ids)