base_vat: Correct management of the check of peruvian VAT without prefix. l10n_pe: Correct income account the last one is not correct. l10n_pe: Forced Round globally for peruvian companies once l10n_pe is installed, and with the onchange. l10n_pe: For peruvian companies it does not make sense a sequence per year and the year in the prefix is incorrect, we must force XXX- as a sequence prefix. closes odoo/odoo#38854 Forward-port-of: #38764 Signed-off-by: Josse Colpaert <jco@openerp.com>
17 lines
681 B
Python
17 lines
681 B
Python
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
from odoo.tests import common
|
|
from odoo.exceptions import ValidationError
|
|
|
|
|
|
class TestRUCStructure(common.TransactionCase):
|
|
|
|
def test_peru_ruc_format(self):
|
|
"""Only values that has the length of 11 will be checked as RUC, that's what we are proving. The second part
|
|
will check for a valid ruc and there will be no problem at all.
|
|
"""
|
|
partner = self.env['res.partner'].create({'name': "Dummy partner", 'country_id': self.env.ref('base.pe').id})
|
|
|
|
with self.assertRaises(ValidationError):
|
|
partner.vat = '11111111111'
|
|
partner.vat = '20507822470'
|