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
!9
12.0 stage
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
12.0 stage
12.0-stage
into
12.0
Overview
0
Commits
4
Pipelines
0
Changes
1
Merged
Gastón Bertolani
requested to merge
12.0-stage
into
12.0
1 year ago
Overview
0
Commits
4
Pipelines
0
Changes
1
Expand
0
0
Merge request reports
Compare
12.0
12.0 (base)
and
latest version
latest version
5d51c0c9
4 commits,
1 year ago
1 file
+
16
−
10
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/account_invoice.py
+
16
−
10
Options
@@ -168,16 +168,22 @@ class AccountInvoice(models.Model):
}
@api.onchange
(
'
partner_id
'
)
def
cons_partner
(
self
):
for
rec
in
self
:
lst
=
[
1
,
2
,
3
,
51
,
52
,
53
,
201
,
202
,
203
,
206
,
207
,
208
]
voucher_type
=
rec
.
_get_voucher_type
()
if
int
(
voucher_type
)
in
lst
:
if
rec
.
partner_id
.
document_type_id
.
name
!=
'
CUIT
'
\
or
not
rec
.
partner_id
.
vat
:
raise
exceptions
.
UserError
(
_
(
"
The client has a type of document other than CUIT
"
)
)
def
_onchange_partner_id
(
self
):
res
=
super
(
AccountInvoice
,
self
).
_onchange_partner_id
()
if
not
self
.
partner_id
:
return
res
caea_lst
=
[
1
,
2
,
3
,
51
,
52
,
53
,
201
,
202
,
203
,
206
,
207
,
208
]
try
:
voucher_type
=
self
.
_get_voucher_type
()
except
Exception
:
return
res
if
int
(
voucher_type
)
in
caea_lst
:
cuit_type
=
self
.
env
.
ref
(
'
base_vat_ar.document_cuit
'
)
if
self
.
partner_id
.
document_type_id
!=
cuit_type
or
not
self
.
partner_id
.
vat
:
raise
exceptions
.
UserError
(
_
(
"
The client has a type of document other than CUIT
"
)
)
return
res
# Constraints
@api.multi
Menu
Explore
Projects
Groups
Topics
Snippets