Skip to content

Commit

Permalink
[FIX] account_invoice_import: Fixed external ids
Browse files Browse the repository at this point in the history
  • Loading branch information
Bastian Guenther authored and Bastian Guenther committed Dec 10, 2024
1 parent 5d9e292 commit 3817747
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion account_invoice_import/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{
"name": "Account Invoice Import",
"version": "13.0.1.0.0",
"version": "13.0.1.0.1",
"category": "Accounting & Finance",
"license": "AGPL-3",
"summary": "Import supplier invoices/refunds as PDF or XML files",
Expand Down
5 changes: 3 additions & 2 deletions account_invoice_import/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ def _compute_invoice_import_count(self):

def show_account_invoice_import_config(self):
self.ensure_one()
xmlid = "account_invoice_import.account_invoice_import_config_action"
action = self.env["ir.actions.act_window"].for_xml_id(xmlid)
action = self.env["ir.actions.act_window"].for_xml_id(
"account_invoice_import", "account_invoice_import_config_action"
)
action["context"] = {
"default_name": self.name,
"default_partner_id": self.id,
Expand Down
25 changes: 15 additions & 10 deletions account_invoice_import/wizard/account_invoice_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,8 +671,9 @@ def goto_partner_not_found(self, parsed_inv, error_message):
if country:
vals["partner_country_id"] = country.id
self.write(vals)
xmlid = "account_invoice_import.account_invoice_import_action"
action = self.env["ir.actions.act_window"].for_xml_id(xmlid)
action = self.env["ir.actions.act_window"].for_xml_id(
"account_invoice_import", "account_invoice_import_action"
)
action["res_id"] = self.id
return action

Expand Down Expand Up @@ -865,8 +866,9 @@ def import_invoice(self):

if not wiz_vals.get("import_config_id"):
wiz_vals["state"] = "config"
xmlid = "account_invoice_import.account_invoice_import_action"
action = self.env["ir.actions.act_window"].for_xml_id(xmlid)
action = self.env["ir.actions.act_window"].for_xml_id(
"account_invoice_import", "account_invoice_import_action"
)
action["res_id"] = self.id
else:
draft_same_supplier_invs = amo.search(
Expand All @@ -881,8 +883,9 @@ def import_invoice(self):
wiz_vals["state"] = "update"
if len(draft_same_supplier_invs) == 1:
wiz_vals["invoice_id"] = draft_same_supplier_invs[0].id
xmlid = "account_invoice_import.account_invoice_import_action"
action = self.env["ir.actions.act_window"].for_xml_id(xmlid)
action = self.env["ir.actions.act_window"].for_xml_id(
"account_invoice_import", "account_invoice_import_action"
)
action["res_id"] = self.id
else:
action = self.create_invoice_action(
Expand All @@ -909,8 +912,9 @@ def create_invoice_action(self, parsed_inv=None, import_config=None, origin=None
assert self.import_config_id
import_config = self.import_config_id.convert_to_import_config()
invoice = self.create_invoice(parsed_inv, import_config, origin)
xmlid = "account.action_move_in_invoice_type"
action = self.env["ir.actions.act_window"].for_xml_id(xmlid)
action = self.env["ir.actions.act_window"].for_xml_id(
"account", "action_move_in_invoice_type"
)
action.update(
{
"view_mode": "form,tree,kanban",
Expand Down Expand Up @@ -1424,8 +1428,9 @@ def update_invoice(self):
)
% self.invoice_filename
)
xmlid = "account.action_move_in_invoice_type"
action = self.env["ir.actions.act_window"].for_xml_id(xmlid)
action = self.env["ir.actions.act_window"].for_xml_id(
"account", "action_move_in_invoice_type"
)
action.update(
{
"view_mode": "form,tree,kanban",
Expand Down

0 comments on commit 3817747

Please sign in to comment.