[FIX] a_tax_balance: use '_for_xml_id' method to get actions
parent
ad1f6c969c
commit
0013001245
|
@ -180,11 +180,11 @@ class AccountTax(models.Model):
|
|||
domain = self.get_move_lines_domain(
|
||||
tax_or_base=tax_or_base, financial_type=financial_type
|
||||
)
|
||||
action = self.env.ref("account.action_account_moves_all_tree")
|
||||
vals = action.sudo().read()[0]
|
||||
vals["context"] = {}
|
||||
vals["domain"] = domain
|
||||
return vals
|
||||
xmlid = "account.action_account_moves_all_tree"
|
||||
action = self.env["ir.actions.act_window"]._for_xml_id(xmlid)
|
||||
action["context"] = {}
|
||||
action["domain"] = domain
|
||||
return action
|
||||
|
||||
def view_tax_lines(self):
|
||||
self.ensure_one()
|
||||
|
|
|
@ -40,13 +40,13 @@ class WizardOpenTaxBalances(models.TransientModel):
|
|||
|
||||
def open_taxes(self):
|
||||
self.ensure_one()
|
||||
action = self.env.ref("account_tax_balance.action_tax_balances_tree")
|
||||
act_vals = action.sudo().read()[0]
|
||||
xmlid = "account_tax_balance.action_tax_balances_tree"
|
||||
action = self.env["ir.actions.act_window"]._for_xml_id(xmlid)
|
||||
# override action name doesn't work in v12 or v10
|
||||
# we need to build a dynamic action on main keys
|
||||
vals = {
|
||||
x: act_vals[x]
|
||||
for x in act_vals
|
||||
x: action[x]
|
||||
for x in action
|
||||
if x
|
||||
in (
|
||||
"res_model",
|
||||
|
|
Loading…
Reference in New Issue