account_usability: avoir error when user doesn't have admin rights
This commit is contained in:
@@ -80,7 +80,8 @@ class AccountBankStatementLine(models.Model):
|
|||||||
|
|
||||||
def show_account_move(self):
|
def show_account_move(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
action = self.env.ref('account.action_move_line_form').read()[0]
|
action = self.env["ir.actions.actions"]._for_xml_id(
|
||||||
|
'account.action_move_line_form')
|
||||||
# Note: this action is on account.move, not account.move.line !
|
# Note: this action is on account.move, not account.move.line !
|
||||||
action.update({
|
action.update({
|
||||||
'views': False,
|
'views': False,
|
||||||
|
|||||||
@@ -231,7 +231,8 @@ class AccountMoveLine(models.Model):
|
|||||||
|
|
||||||
def show_account_move_form(self):
|
def show_account_move_form(self):
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
action = self.env.ref('account.action_move_line_form').read()[0]
|
action = self.env["ir.actions.actions"]._for_xml_id(
|
||||||
|
'account.action_move_line_form')
|
||||||
action.update({
|
action.update({
|
||||||
'res_id': self.move_id.id,
|
'res_id': self.move_id.id,
|
||||||
'view_id': False,
|
'view_id': False,
|
||||||
|
|||||||
Reference in New Issue
Block a user