summaryrefslogtreecommitdiff
path: root/addons/base_vat/tests/test_validate_ruc.py
diff options
context:
space:
mode:
authorfw-bot <otis@odoo.com>2019-10-16 09:18:15 +0000
committerJosse Colpaert <jco@odoo.com>2019-10-16 11:37:28 +0000
commiteaa094285e489dadc5607cfb9ec44fc721322a29 (patch)
tree4bc5c9e6c16f3dc86d3ab7948c7532c53ecaff55 /addons/base_vat/tests/test_validate_ruc.py
parentcddf577abb991568197f31bf3ba3cad13aabd0ea (diff)
[FIX] l1n_pe: forward-port of fixes to l10n_pe
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>
Diffstat (limited to 'addons/base_vat/tests/test_validate_ruc.py')
-rw-r--r--addons/base_vat/tests/test_validate_ruc.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/addons/base_vat/tests/test_validate_ruc.py b/addons/base_vat/tests/test_validate_ruc.py
new file mode 100644
index 00000000000..69dfbdcf59c
--- /dev/null
+++ b/addons/base_vat/tests/test_validate_ruc.py
@@ -0,0 +1,16 @@
+# 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'