Fix crash upon click on "Show History" on product form

This commit is contained in:
Alexis de Lattre
2019-09-17 11:27:04 +02:00
parent 5140094633
commit 76b113ed28

View File

@@ -4,7 +4,6 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, fields from odoo import models, fields
from odoo.tools.safe_eval import safe_eval
class ProductProduct(models.Model): class ProductProduct(models.Model):
@@ -43,6 +42,5 @@ class ProductProduct(models.Model):
self.ensure_one() self.ensure_one()
action = self.env.ref( action = self.env.ref(
'product_usability.product_price_history_action').read()[0] 'product_usability.product_price_history_action').read()[0]
action['domain'] = safe_eval(action['domain']) action['domain'] = [('product_id', '=', self.id)]
action['domain'].append(('product_id', '=', self.id))
return action return action