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 3550ad358e2398717a4f02f556fab3459221b12f
Showing with 8 additions and 2 deletions.
  1. +8 −2 addons/sale_timesheet/controllers/portal.py
@@ -15,9 +15,15 @@

class CustomerPortal(CustomerPortal):

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

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)])

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

def _invoice_get_page_view_values(self, invoice, access_token, **kw):
@@ -32,7 +38,7 @@ def _invoice_get_page_view_values(self, invoice, access_token, **kw):
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', '!=', False)]
domain = self.domain
searchbar_sortings = {
'date': {'label': _('Newest'), 'order': 'date desc'},
'name': {'label': _('Name'), 'order': 'name'},

0 comments on commit 3550ad3

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