mirror of
https://github.com/bringout/oca-ocb-accounting.git
synced 2026-04-24 08:42:08 +02:00
Initial commit: Accounting packages
This commit is contained in:
commit
4ef34c2317
2661 changed files with 1709616 additions and 0 deletions
|
|
@ -0,0 +1,30 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from odoo.addons.account.tests.common import AccountTestInvoicingCommon
|
||||
from odoo.tests import tagged
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
@tagged('post_install', '-at_install')
|
||||
class TestAccountTax(AccountTestInvoicingCommon):
|
||||
|
||||
def test_changing_tax_company(self):
|
||||
''' Ensure you can't change the company of an account.tax if there are some journal entries '''
|
||||
|
||||
# Avoid duplicate key value violates unique constraint "account_tax_name_company_uniq".
|
||||
self.company_data['default_tax_sale'].name = 'test_changing_account_company'
|
||||
|
||||
self.env['account.move'].create({
|
||||
'move_type': 'out_invoice',
|
||||
'date': '2019-01-01',
|
||||
'invoice_line_ids': [
|
||||
(0, 0, {
|
||||
'name': 'invoice_line',
|
||||
'quantity': 1.0,
|
||||
'price_unit': 100.0,
|
||||
'tax_ids': [(6, 0, self.company_data['default_tax_sale'].ids)],
|
||||
}),
|
||||
],
|
||||
})
|
||||
|
||||
with self.assertRaises(UserError), self.cr.savepoint():
|
||||
self.company_data['default_tax_sale'].company_id = self.company_data_2['company']
|
||||
Loading…
Add table
Add a link
Reference in a new issue