Enforce access rights when searching in wizard
If there are no constraint based on the records on the search domain, we must enforce the access rights to limit the execution to the user accesses. issue10229 review335931002
This commit is contained in:
1 parent
715b57d6de
commit
e580c1ac87
2 files changed
+6
-3
No files matched your search
+4
-3
@@ -2825,9 +2825,10 @@ class UpdateChart(Wizard):
|
||||
Account = pool.get('account.account')
|
||||
|
||||
defaults = {}
|
||||
charts = Account.search([
|
||||
('parent', '=', None),
|
||||
], limit=2)
|
||||
with Transaction().set_context(_check_access=True):
|
||||
charts = Account.search([
|
||||
('parent', '=', None),
|
||||
], limit=2)
|
||||
if len(charts) == 1:
|
||||
defaults['account'] = charts[0].id
|
||||
return defaults
|
||||
|
||||
@@ -1476,6 +1476,8 @@ class OpenAccount(Wizard):
|
||||
if not Transaction().context.get('fiscalyear'):
|
||||
fiscalyears = FiscalYear.search([
|
||||
('state', '=', 'open'),
|
||||
('company', '=',
|
||||
self.record.company.id if self.record else None),
|
||||
])
|
||||
else:
|
||||
fiscalyears = [FiscalYear(Transaction().context['fiscalyear'])]
|
||||
|
||||
Reference in new issue
Block a user