[REF] Portal Controller : Remove domain from account and purchase
The list of visible records are anyway based on access_rights. State has been removed from the domain. If the portal must be customized for a model, access rights / rules can be added to do so. Task ID : 30985
This commit is contained in:
@@ -11,19 +11,12 @@ from odoo.http import request
|
||||
|
||||
|
||||
class PortalAccount(CustomerPortal):
|
||||
|
||||
def _get_account_invoice_domain(self):
|
||||
partner = request.env.user.partner_id
|
||||
domain = [
|
||||
('type', 'in', ['out_invoice', 'out_refund']),
|
||||
('message_partner_ids', 'child_of', [partner.commercial_partner_id.id]),
|
||||
('state', 'in', ['open', 'paid', 'cancel'])
|
||||
]
|
||||
return domain
|
||||
|
||||
def _prepare_portal_layout_values(self):
|
||||
values = super(PortalAccount, self)._prepare_portal_layout_values()
|
||||
invoice_count = request.env['account.invoice'].search_count(self._get_account_invoice_domain())
|
||||
invoice_count = request.env['account.invoice'].search_count([
|
||||
('type', 'in', ['out_invoice', 'out_refund'])
|
||||
])
|
||||
values['invoice_count'] = invoice_count
|
||||
return values
|
||||
|
||||
@@ -45,7 +38,7 @@ class PortalAccount(CustomerPortal):
|
||||
partner = request.env.user.partner_id
|
||||
AccountInvoice = request.env['account.invoice']
|
||||
|
||||
domain = self._get_account_invoice_domain()
|
||||
domain = []
|
||||
|
||||
searchbar_sortings = {
|
||||
'date': {'label': _('Invoice Date'), 'order': 'date_invoice desc'},
|
||||
|
||||
@@ -15,12 +15,7 @@ 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'].sudo().search_count([
|
||||
'|',
|
||||
('message_partner_ids', 'child_of', [partner.commercial_partner_id.id]),
|
||||
('partner_id', 'child_of', [partner.commercial_partner_id.id]),
|
||||
('state', 'in', ['purchase', 'done', 'cancel'])
|
||||
])
|
||||
values['purchase_count'] = request.env['purchase.order'].search_count([])
|
||||
return values
|
||||
|
||||
def _purchase_order_get_page_view_values(self, order, access_token, **kwargs):
|
||||
@@ -35,11 +30,7 @@ class CustomerPortal(CustomerPortal):
|
||||
partner = request.env.user.partner_id
|
||||
PurchaseOrder = request.env['purchase.order']
|
||||
|
||||
domain = [
|
||||
'|',
|
||||
('message_partner_ids', 'child_of', [partner.commercial_partner_id.id]),
|
||||
('partner_id', 'child_of', [partner.commercial_partner_id.id]),
|
||||
]
|
||||
domain = []
|
||||
|
||||
archive_groups = self._get_archive_groups('purchase.order', domain)
|
||||
if date_begin and date_end:
|
||||
|
||||
Reference in New Issue
Block a user