Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Coopdevs OCB mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Odoo
Coopdevs OCB mirror
Commits
9ef3a929
Commit
9ef3a929
authored
9 years ago
by
Quentin De Paoli
Browse files
Options
Downloads
Patches
Plain Diff
[FIX] account_bank_statement_import: raise proper error (osv not defined)
parent
f9a462f3
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
addons/account_bank_statement_import/account_bank_statement_import.py
+3
-3
3 additions, 3 deletions
...nt_bank_statement_import/account_bank_statement_import.py
with
3 additions
and
3 deletions
addons/account_bank_statement_import/account_bank_statement_import.py
+
3
−
3
View file @
9ef3a929
...
...
@@ -129,7 +129,7 @@ class AccountBankStatementImport(models.TransientModel):
if
currency_code
:
currency
=
self
.
env
[
'
res.currency
'
].
search
([(
'
name
'
,
'
=ilike
'
,
currency_code
)],
limit
=
1
)
if
not
currency
:
raise
osv
.
except_osv
(
_
(
"
No currency found matching
'
%s
'
.
"
)
%
currency_code
)
raise
UserError
(
_
(
"
No currency found matching
'
%s
'
.
"
)
%
currency_code
)
if
currency
==
company_currency
:
currency
=
False
...
...
@@ -148,10 +148,10 @@ class AccountBankStatementImport(models.TransientModel):
# If importing into an existing journal, its currency must be the same as the bank statement
if
journal
:
journal_currency
=
journal
.
currency_id
if
currency
==
None
:
if
currency
is
None
:
currency
=
journal_currency
if
currency
and
currency
!=
journal_currency
:
statement_cur_code
=
currency
==
False
and
company_currency
.
name
or
currency
.
name
statement_cur_code
=
not
currency
and
company_currency
.
name
or
currency
.
name
journal_cur_code
=
not
journal_currency
and
company_currency
.
name
or
journal_currency
.
name
raise
UserError
(
_
(
'
The currency of the bank statement (%s) is not the same as the currency of the journal (%s) !
'
)
%
(
statement_cur_code
,
journal_cur_code
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment