mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
24 lines
949 B
Python
24 lines
949 B
Python
# from odoo.tests import common
|
|
from odoo.addons.account.tests.common import AccountTestInvoicingCommon
|
|
from odoo.tests import tagged
|
|
|
|
|
|
@tagged('post_install', '-at_install')
|
|
class TestAccountMoveException(AccountTestInvoicingCommon):
|
|
|
|
def test_10_validation_on_write(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
|
|
invoice = self.init_invoice('out_invoice', products=self.product_a)
|
|
|
|
# must be exceptions when no phone and posting
|
|
invoice.partner_id.phone = False
|
|
invoice.action_post()
|
|
self.assertTrue(invoice.exception_ids)
|
|
|
|
# no exceptions when phone and posting
|
|
invoice.partner_id.phone = '123'
|
|
invoice.action_post()
|
|
self.assertTrue(invoice.exception_ids)
|
|
self.assertTrue(invoice.state='posted') |