[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: Simon Lejeune (sle) <sle@openerp.com>
This commit is contained in:
svs-odoo
2019-09-02 14:13:11 +00:00
parent b70803dc04
commit ee14dc0302
+2 -2
View File
@@ -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