diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2018-10-24 09:09:38 +0000 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2018-10-24 09:11:50 +0000 |
| commit | 0530b36a2dd5b7463b2b4e2d25e179436135f278 (patch) | |
| tree | 7a5b32164a480d536acf71a3eb45c5db1285cccf | |
| parent | 274f956f8d26ee7f41aee815ea8b8e434b7678e0 (diff) | |
[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
| -rw-r--r-- | addons/purchase/controllers/portal.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/addons/purchase/controllers/portal.py b/addons/purchase/controllers/portal.py index 3e7d39fb474..400b6ed51fa 100644 --- a/addons/purchase/controllers/portal.py +++ b/addons/purchase/controllers/portal.py @@ -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)
\ No newline at end of file + return request.render("purchase.portal_my_purchase_order", values) |
