Skip to content
Permalink
Browse files

[IMP] sale_timesheet: added domain for ordered and delivered

  • Loading branch information...
pka-odoo committed Mar 25, 2019
1 parent 26aad76 commit 140deb58782d9f6cbcd3d2b3f76c1d4332031c18
Showing with 11 additions and 2 deletions.
  1. +11 −2 addons/sale_timesheet/controllers/portal.py
@@ -17,7 +17,13 @@ class CustomerPortal(CustomerPortal):

def _prepare_portal_layout_values(self):
values = super(CustomerPortal, self)._prepare_portal_layout_values()
values['timesheet_count'] = request.env['account.analytic.line'].search_count([('so_line', '!=', False)])

domain = ['&', '|', '&', ('so_line.product_id.invoice_policy', '=', 'delivery'),
('timesheet_invoice_id', '!=', False),
('so_line.product_id.invoice_policy', '!=', 'delivery'),
('so_line', '!=', False)]

values['timesheet_count'] = request.env['account.analytic.line'].search_count(domain)
return values

def _invoice_get_page_view_values(self, invoice, access_token, **kw):
@@ -31,8 +37,11 @@ def _invoice_get_page_view_values(self, invoice, access_token, **kw):
@http.route(['/my/timesheets', '/my/timesheets/page/<int:page>'], type='http', auth="user", website=True)
def portal_my_timesheets(self, page=1, sortby=None, filterby=None, search=None, search_in='all', groupby='project', **kw):
values = self._prepare_portal_layout_values()
domain = ['&', '|', '&', ('so_line.product_id.invoice_policy', '=', 'delivery'),
('timesheet_invoice_id', '!=', False),
('so_line.product_id.invoice_policy', '!=', 'delivery'),
('so_line', '!=', False)]

domain = [('so_line', '!=', False)]
searchbar_sortings = {
'date': {'label': _('Newest'), 'order': 'date desc'},
'name': {'label': _('Name'), 'order': 'name'},

0 comments on commit 140deb5

Please sign in to comment.
You can’t perform that action at this time.