Skip to content
Snippets Groups Projects
Commit ee14dc03 authored by svs-odoo's avatar svs-odoo
Browse files

[FIX] purchase: units purchased product button


Before this commit, user got a traceback when he clicks on Units
Purchased button from product view form.
The issue was we asked to the purchase report to be based on a field who
doesn't exist anymore.
The fix only replaces `unit_quantity` for `qty_ordered`.

closes odoo/odoo#36342

Signed-off-by: default avatarSimon Lejeune (sle) <sle@openerp.com>
parent b70803dc
No related branches found
No related tags found
No related merge requests found
......@@ -42,7 +42,7 @@ class ProductTemplate(models.Model):
action = self.env.ref('purchase.action_purchase_order_report_all').read()[0]
action['domain'] = ['&', ('state', 'in', ['purchase', 'done']), ('product_tmpl_id', 'in', self.ids)]
action['context'] = {
'graph_measure': 'unit_quantity',
'graph_measure': 'qty_ordered',
'search_default_orders': 1,
'time_ranges': {'field': 'date_approve', 'range': 'last_365_days'}
}
......@@ -77,7 +77,7 @@ class ProductProduct(models.Model):
action['context'] = {
'search_default_last_year_purchase': 1,
'search_default_status': 1, 'search_default_order_month': 1,
'graph_measure': 'unit_quantity'
'graph_measure': 'qty_ordered'
}
return action
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment