[FIX] rma_account_unreconciled: Remove 'account_reconcile_oca' dependency

RMA lines should be able to reconcile either with OCA or Enterprise reconcile tools.
This commit is contained in:
BernatPForgeFlow
2024-06-20 13:10:36 +02:00
parent d83db3b81c
commit def1b22feb
2 changed files with 10 additions and 15 deletions

View File

@@ -9,7 +9,7 @@
"summary": "Integrates RMA with Invoice Processing", "summary": "Integrates RMA with Invoice Processing",
"author": "ForgeFlow", "author": "ForgeFlow",
"website": "https://github.com/ForgeFlow/stock-rma", "website": "https://github.com/ForgeFlow/stock-rma",
"depends": ["account_move_line_rma_order_line", "rma", "account_reconcile_oca"], "depends": ["account_move_line_rma_order_line", "rma"],
"data": [ "data": [
"views/rma_line_view.xml", "views/rma_line_view.xml",
], ],

View File

@@ -2,6 +2,7 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html)
from odoo import _, api, fields, models from odoo import _, api, fields, models
from odoo.exceptions import UserError
from odoo.osv import expression from odoo.osv import expression
@@ -77,17 +78,11 @@ class RmaOrderLine(models.Model):
amls = ( amls = (
action.get("domain") and aml_model.search(action.get("domain")) or aml_model action.get("domain") and aml_model.search(action.get("domain")) or aml_model
) )
accounts = amls.mapped("account_id") if getattr(aml_model, "action_reconcile", False):
action_context = { return amls.action_reconcile()
"show_mode_selector": False, elif getattr(aml_model, "action_reconcile_manually", False):
"account_ids": accounts.ids, return amls.action_reconcile_manually()
"active_model": "account.move.line", else:
"active_ids": amls.ids, raise UserError(
} _("Could not find a method to open the reconciliation view.")
action_def = self.env["ir.actions.act_window"]._for_xml_id(
"account_reconcile_oca.account_account_reconcile_act_window"
) )
action_def["context"] = action_context
action_def["domain"] = [("id", "in", amls.ids)]
action_def["context"]["default_account_move_lines"] = amls.ids
return action_def