From c9be71a1ee63d6d092f54b8888ec1708c4b46e91 Mon Sep 17 00:00:00 2001 From: Jon Zaballa Date: Thu, 7 Mar 2019 18:23:51 +0100 Subject: [PATCH] [FIX] 11.0 Account Payment Order: domain bug on create line wizard When `populate` method is called and the wizard action is returned again to refresh the view, the dynamic domain of `move_line_ids` gets lost. Updating move_line_ids field and returning `ir.actions.do_nothing` solves the issue. --- account_payment_order/__manifest__.py | 2 +- account_payment_order/models/account_invoice.py | 2 +- account_payment_order/models/account_move.py | 2 +- account_payment_order/models/account_move_line.py | 2 +- .../models/account_payment_line.py | 2 +- .../models/account_payment_mode.py | 2 +- .../models/account_payment_order.py | 2 +- account_payment_order/models/bank_payment_line.py | 2 +- account_payment_order/models/res_bank.py | 2 +- .../wizard/account_invoice_payment_line_multi.py | 2 +- .../wizard/account_payment_line_create.py | 13 +++---------- 11 files changed, 13 insertions(+), 20 deletions(-) diff --git a/account_payment_order/__manifest__.py b/account_payment_order/__manifest__.py index dfef4ca3d..556601e59 100644 --- a/account_payment_order/__manifest__.py +++ b/account_payment_order/__manifest__.py @@ -8,7 +8,7 @@ { 'name': 'Account Payment Order', - 'version': '11.0.1.3.0', + 'version': '11.0.1.3.1', 'license': 'AGPL-3', 'author': "ACSONE SA/NV, " "Therp BV, " diff --git a/account_payment_order/models/account_invoice.py b/account_payment_order/models/account_invoice.py index 415c55d08..c738108d6 100644 --- a/account_payment_order/models/account_invoice.py +++ b/account_payment_order/models/account_invoice.py @@ -3,7 +3,7 @@ # © 2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -from odoo import models, fields, api, _ +from odoo import api, fields, models, _ from odoo.exceptions import UserError diff --git a/account_payment_order/models/account_move.py b/account_payment_order/models/account_move.py index f82073e68..bbcd1f536 100644 --- a/account_payment_order/models/account_move.py +++ b/account_payment_order/models/account_move.py @@ -1,7 +1,7 @@ # © 2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -from odoo import models, fields +from odoo import fields, models class AccountMove(models.Model): diff --git a/account_payment_order/models/account_move_line.py b/account_payment_order/models/account_move_line.py index 8211c6a74..a87f70f4d 100644 --- a/account_payment_order/models/account_move_line.py +++ b/account_payment_order/models/account_move_line.py @@ -3,7 +3,7 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from lxml import etree -from odoo import models, fields, api +from odoo import api, fields, models from odoo.osv import orm diff --git a/account_payment_order/models/account_payment_line.py b/account_payment_order/models/account_payment_line.py index b286a7541..b7d506f72 100644 --- a/account_payment_order/models/account_payment_line.py +++ b/account_payment_order/models/account_payment_line.py @@ -1,7 +1,7 @@ # © 2015-2016 Akretion - Alexis de Lattre # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -from odoo import models, fields, api, _ +from odoo import api, fields, models, _ from odoo.exceptions import UserError diff --git a/account_payment_order/models/account_payment_mode.py b/account_payment_order/models/account_payment_mode.py index 47d983a27..ca9aa3b10 100644 --- a/account_payment_order/models/account_payment_mode.py +++ b/account_payment_order/models/account_payment_mode.py @@ -4,7 +4,7 @@ # © 2016 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -from odoo import models, fields, api, _ +from odoo import api, fields, models, _ from odoo.exceptions import ValidationError diff --git a/account_payment_order/models/account_payment_order.py b/account_payment_order/models/account_payment_order.py index a9d679645..2a402c16f 100644 --- a/account_payment_order/models/account_payment_order.py +++ b/account_payment_order/models/account_payment_order.py @@ -5,7 +5,7 @@ # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). import base64 -from odoo import models, fields, api, _ +from odoo import api, fields, models, _ from odoo.exceptions import UserError, ValidationError diff --git a/account_payment_order/models/bank_payment_line.py b/account_payment_order/models/bank_payment_line.py index 4c9e509dd..3d96f48a7 100644 --- a/account_payment_order/models/bank_payment_line.py +++ b/account_payment_order/models/bank_payment_line.py @@ -1,7 +1,7 @@ # © 2015-2016 Akretion - Alexis de Lattre # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -from odoo import models, fields, api, _ +from odoo import api, fields, models, _ from odoo.exceptions import UserError diff --git a/account_payment_order/models/res_bank.py b/account_payment_order/models/res_bank.py index cfef540b1..7426ba51d 100644 --- a/account_payment_order/models/res_bank.py +++ b/account_payment_order/models/res_bank.py @@ -1,7 +1,7 @@ # © 2015-2016 Akretion - Alexis de Lattre # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -from odoo import models, api, _ +from odoo import api, models, _ from odoo.exceptions import ValidationError diff --git a/account_payment_order/wizard/account_invoice_payment_line_multi.py b/account_payment_order/wizard/account_invoice_payment_line_multi.py index 2ab034195..5c8bcee78 100644 --- a/account_payment_order/wizard/account_invoice_payment_line_multi.py +++ b/account_payment_order/wizard/account_invoice_payment_line_multi.py @@ -2,7 +2,7 @@ # © 2016 Akretion () # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -from odoo import models, api +from odoo import api, models class AccountInvoicePaymentLineMulti(models.TransientModel): diff --git a/account_payment_order/wizard/account_payment_line_create.py b/account_payment_order/wizard/account_payment_line_create.py index 50ad3417b..a019eccff 100644 --- a/account_payment_order/wizard/account_payment_line_create.py +++ b/account_payment_order/wizard/account_payment_line_create.py @@ -5,7 +5,7 @@ # © 2015-2016 Akretion () # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -from odoo import models, fields, api, _ +from odoo import api, fields, models class AccountPaymentLineCreate(models.TransientModel): @@ -126,16 +126,9 @@ class AccountPaymentLineCreate(models.TransientModel): domain = self._prepare_move_line_domain() lines = self.env['account.move.line'].search(domain) self.move_line_ids = lines - action = { - 'name': _('Select Move Lines to Create Transactions'), - 'type': 'ir.actions.act_window', - 'res_model': 'account.payment.line.create', - 'view_mode': 'form', - 'target': 'new', - 'res_id': self.id, - 'context': self._context, + return { + "type": "ir.actions.do_nothing", } - return action @api.onchange( 'date_type', 'move_date', 'due_date', 'journal_ids', 'invoice',