[14.0][FIX] account_loan, account_loan_line & account_loan_generate_entries: fix read
This commit is contained in:
parent
df43fc0a44
commit
40ef27d26e
@ -442,15 +442,17 @@ class AccountLoan(models.Model):
|
||||
|
||||
def view_account_moves(self):
|
||||
self.ensure_one()
|
||||
action = self.env.ref("account.action_move_line_form")
|
||||
result = action.read()[0]
|
||||
result = self.env["ir.actions.act_window"]._for_xml_id(
|
||||
"account.action_move_line_form"
|
||||
)
|
||||
result["domain"] = [("loan_id", "=", self.id)]
|
||||
return result
|
||||
|
||||
def view_account_invoices(self):
|
||||
self.ensure_one()
|
||||
action = self.env.ref("account.action_move_out_invoice_type")
|
||||
result = action.read()[0]
|
||||
result = self.env["ir.actions.act_window"]._for_xml_id(
|
||||
"account.action_move_out_invoice_type"
|
||||
)
|
||||
result["domain"] = [("loan_id", "=", self.id), ("move_type", "=", "in_invoice")]
|
||||
return result
|
||||
|
||||
|
@ -412,8 +412,9 @@ class AccountLoanLine(models.Model):
|
||||
|
||||
def view_account_moves(self):
|
||||
self.ensure_one()
|
||||
action = self.env.ref("account.action_move_line_form")
|
||||
result = action.read()[0]
|
||||
result = self.env["ir.actions.act_window"]._for_xml_id(
|
||||
"account.action_move_line_form"
|
||||
)
|
||||
result["context"] = {
|
||||
"default_loan_line_id": self.id,
|
||||
"default_loan_id": self.loan_id.id,
|
||||
@ -427,8 +428,9 @@ class AccountLoanLine(models.Model):
|
||||
|
||||
def view_account_invoices(self):
|
||||
self.ensure_one()
|
||||
action = self.env.ref("account.action_move_out_invoice_type")
|
||||
result = action.read()[0]
|
||||
result = self.env["ir.actions.act_window"]._for_xml_id(
|
||||
"account.action_move_out_invoice_type"
|
||||
)
|
||||
result["context"] = {
|
||||
"default_loan_line_id": self.id,
|
||||
"default_loan_id": self.loan_id.id,
|
||||
|
@ -20,8 +20,9 @@ class AccountLoanGenerateWizard(models.TransientModel):
|
||||
|
||||
def run_leasing(self):
|
||||
created_ids = self.env["account.loan"].generate_leasing_entries(self.date)
|
||||
action = self.env.ref("account.action_move_out_invoice_type")
|
||||
result = action.read()[0]
|
||||
result = self.env["ir.actions.act_window"]._for_xml_id(
|
||||
"account.action_move_out_invoice_type"
|
||||
)
|
||||
if len(created_ids) == 0:
|
||||
return
|
||||
result["domain"] = [("id", "in", created_ids), ("type", "=", "in_invoice")]
|
||||
@ -29,8 +30,9 @@ class AccountLoanGenerateWizard(models.TransientModel):
|
||||
|
||||
def run_loan(self):
|
||||
created_ids = self.env["account.loan"].generate_loan_entries(self.date)
|
||||
action = self.env.ref("account.action_move_line_form")
|
||||
result = action.read()[0]
|
||||
result = self.env["ir.actions.act_window"]._for_xml_id(
|
||||
"account.action_move_line_form"
|
||||
)
|
||||
if len(created_ids) == 0:
|
||||
return
|
||||
result["domain"] = [("id", "in", created_ids)]
|
||||
|
Loading…
Reference in New Issue
Block a user