[FIX] purchase: matching domain

The domain used for the `purchase_count` variable should be in line with
the domain used to retrieve the PO list at
https://github.com/odoo/odoo/blob/68dafa0620fb8e36c9a1a58da0668bede2c3699b/addons/purchase/controllers/portal.py#L50

opw-1894625

closes odoo/odoo#28096
This commit is contained in:
Nicolas Martinelli
2018-10-24 09:11:50 +00:00
parent 274f956f8d
commit 0530b36a2d
+4 -3
View File
@@ -14,8 +14,9 @@ class CustomerPortal(CustomerPortal):
def _prepare_portal_layout_values(self):
values = super(CustomerPortal, self)._prepare_portal_layout_values()
partner = request.env.user.partner_id
values['purchase_count'] = request.env['purchase.order'].search_count([])
values['purchase_count'] = request.env['purchase.order'].search_count([
('state', 'in', ['purchase', 'done', 'cancel'])
])
return values
def _purchase_order_get_page_view_values(self, order, access_token, **kwargs):
@@ -98,4 +99,4 @@ class CustomerPortal(CustomerPortal):
return request.redirect('/my')
values = self._purchase_order_get_page_view_values(order_sudo, access_token, **kw)
return request.render("purchase.portal_my_purchase_order", values)
return request.render("purchase.portal_my_purchase_order", values)