Skip to content
Permalink
Browse files

[IMP] sale_timesheet: show only ordered timesheet

  • Loading branch information...
pka-odoo committed Apr 16, 2019
1 parent 61ef388 commit fb16d0633cef56e413b4eddc392567a0573a3921
Showing with 5 additions and 10 deletions.
  1. +5 −10 addons/sale_timesheet/controllers/portal.py
@@ -14,15 +14,13 @@

class CustomerPortal(CustomerPortal):

def get_domain_my_timesheet(self):
return [('partner_id', '=', request.env.user.partner_id.id), ('timesheet_invoice_id', '!=', False)]

def _prepare_portal_layout_values(self):
values = super(CustomerPortal, self)._prepare_portal_layout_values()

domain = ['&', '|', '&', ('timesheet_invoice_type', '=', 'billable_time'),
('timesheet_invoice_id', '!=', False),
('timesheet_invoice_type', '=', 'billable_fixed'),
('so_line', '!=', False)]

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

def _invoice_get_page_view_values(self, invoice, access_token, **kw):
@@ -36,10 +34,7 @@ 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 = ['&', '|', '&', ('timesheet_invoice_type', '=', 'billable_time'),
('timesheet_invoice_id', '!=', False),
('timesheet_invoice_type', '=', 'billable_fixed'),
('so_line', '!=', False)]
domain = self.get_domain_my_timesheet()

searchbar_sortings = {
'date': {'label': _('Newest'), 'order': 'date desc'},

0 comments on commit fb16d06

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