[FIX] account_move_template: sudo action

This commit is contained in:
ps-tubtim
2021-12-16 13:52:51 +07:00
committed by Andrea Gidalti
parent 6188726b43
commit 8e5667c507

View File

@@ -93,7 +93,7 @@ Valid dictionary to overwrite template lines:
if not self.line_ids:
return self.generate_move()
action = self.env.ref("account_move_template.account_move_template_run_action")
result = action.read()[0]
result = action.sudo().read()[0]
result.update({"res_id": self.id, "context": self.env.context})
# Overwrite self.line_ids to show overwrite values
@@ -183,7 +183,7 @@ Valid dictionary to overwrite template lines:
)
move = self.env["account.move"].create(move_vals)
action = self.env.ref("account.action_move_journal_line")
result = action.read()[0]
result = action.sudo().read()[0]
result.update(
{
"name": _("Entry from template %s") % self.template_id.name,