Coverage for ingadhoc-argentina-sale / l10n_ar_stock_ux / models / product_template.py: 50%
10 statements
« prev ^ index » next coverage.py v7.13.4, created at 2026-03-09 18:44 +0000
« prev ^ index » next coverage.py v7.13.4, created at 2026-03-09 18:44 +0000
1##############################################################################
2# For copyright and license notices, see __manifest__.py file in module root
3# directory
4##############################################################################
5from odoo import api, fields, models
6from odoo.exceptions import ValidationError
9class ProductTemplate(models.Model):
10 _inherit = "product.template"
12 arba_code = fields.Char()
14 @api.constrains("arba_code")
15 def check_arba_code(self):
16 for rec in self.filtered("arba_code"):
17 if len(rec.arba_code) != 6 or not rec.arba_code.isdigit():
18 raise ValidationError(
19 self.env._("El código según nomenclador de arba debe ser de 6 dígitos" " numéricos")
20 )