Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Otros
l10n_ar_wsfe_caea
Merge requests
!11
[FIX][T3448]Validations
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
[FIX][T3448]Validations
12.0-validations
into
12.0-stage
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Gastón Bertolani
requested to merge
12.0-validations
into
12.0-stage
11 months ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Compare
12.0-stage
12.0-stage (base)
and
latest version
latest version
837948d4
1 commit,
11 months ago
1 file
+
5
−
7
Expand all files
Preferences
File browser
List view
Tree view
Compare changes
Inline
Side-by-side
Show whitespace changes
Show one file at a time
models/product.py
+
5
−
7
Options
# -*- coding: utf-8 -*-
from
odoo
import
api
,
models
,
exceptions
from
odoo
import
_
,
api
,
models
,
exceptions
import
logging
_logger
=
logging
.
getLogger
(
__name__
)
@@ -14,18 +14,16 @@ class Product(models.Model):
@api.constrains
(
'
barcode
'
)
def
const_barcode
(
self
):
for
rec
in
self
:
if
len
(
rec
.
barcode
)
>
13
:
if
rec
.
barcode
and
len
(
rec
.
barcode
)
>
13
:
raise
exceptions
.
UserError
(
"
El codigo de barras supera los 13
"
"
caracteres requeridos por afip
"
_
(
"
The barcode exceeds the 13 characters required by afip
"
)
)
@api.multi
@api.constrains
(
'
default_code
'
)
def
const_default_code
(
self
):
for
rec
in
self
:
if
len
(
rec
.
bar
code
)
>
50
:
if
rec
.
default_code
and
len
(
rec
.
default_
code
)
>
50
:
raise
exceptions
.
UserError
(
"
Referencia interna supera los 50
"
"
caracteres requeridos por afip
"
,
_
(
"
The internal reference exceeds the 50 characters required by afip
"
)
)
Menu
Explore
Projects
Groups
Topics
Snippets