|
|
@ -10,12 +10,12 @@ class PortalOpendons(CustomerPortal): |
|
|
|
values = super()._prepare_home_portal_values(counters) |
|
|
|
partner = request.env.user.partner_id |
|
|
|
if 'taxreceipt_count' in counters: |
|
|
|
taxreceipt_count=request.env['donation.tax.receipt'].search_count([('partner_id','=',int(partner.id))]) |
|
|
|
taxreceipt_count=request.env['donation.tax.receipt'].sudo().search_count([('partner_id','=',int(partner.id))]) |
|
|
|
|
|
|
|
values['taxreceipt_count'] = taxreceipt_count |
|
|
|
|
|
|
|
if 'donation_count' in counters: |
|
|
|
donation_count=request.env['donation.donation'].search_count(['&',('partner_id','=',int(partner.id)),('state','=','done')]) |
|
|
|
donation_count=request.env['donation.donation'].sudo().search_count(['&',('partner_id','=',int(partner.id)),('state','=','done')]) |
|
|
|
|
|
|
|
values['donation_count'] = donation_count |
|
|
|
|
|
|
@ -25,7 +25,7 @@ class PortalOpendons(CustomerPortal): |
|
|
|
def portal_my_taxreceipts(self, page=1, date_begin=None, date_end=None, sortby=None, **kw): |
|
|
|
values = self._prepare_portal_layout_values() |
|
|
|
partner = request.env.user.partner_id |
|
|
|
taxreceipt = request.env['donation.tax.receipt'] |
|
|
|
taxreceipt = request.env['donation.tax.receipt'].sudo().search([]) |
|
|
|
|
|
|
|
domain = [ |
|
|
|
('partner_id', '=',int(partner.id) ) |
|
|
@ -55,7 +55,7 @@ class PortalOpendons(CustomerPortal): |
|
|
|
step=self._items_per_page |
|
|
|
) |
|
|
|
# search the count to display, according to the pager data |
|
|
|
taxreceipts = taxreceipt.search(domain, order=sort_taxreceipt, limit=self._items_per_page, offset=pager['offset']) |
|
|
|
taxreceipts = taxreceipt.sudo().search(domain, order=sort_taxreceipt, limit=self._items_per_page, offset=pager['offset']) |
|
|
|
request.session['my_taxreceipt_history'] = taxreceipts.ids[:100] |
|
|
|
|
|
|
|
values.update({ |
|
|
|