Browse Source

bug affichage icone site web

bug affichage factures avec acomptes
dev-rcn
root 3 years ago
parent
commit
69363d2dfe
2 changed files with 17 additions and 5 deletions
  1. +13
    -5
      controllers/kalachakra.py
  2. +4
    -0
      views/event.xml

+ 13
- 5
controllers/kalachakra.py View File

@ -32,13 +32,15 @@ class Kalachakra_PortalAccount(CustomerPortal):
user_id=int(request.env.context.get('uid'))
user=request.env['res.users'].search([('id','=',user_id)])
#KALACHAKRA : on affiche que les factures de l'utilisateur liées à une retraite
booking_registrations=request.env['event.registration'].sudo().search([('booking_event','=',True),('partner_id','=',int(user.partner_id))])
booking_registrations=request.env['event.registration'].sudo().search([('partner_id','=',int(user.partner_id))])
invoice_ids=booking_registrations.invoice_id.ids
down_payment_invoice_ids=booking_registrations.down_payment_invoice_id.ids
AccountInvoice = request.env['account.move'].search([('id','in',invoice_ids)])
AccountInvoice_d = request.env['account.move'].search([('id','in',down_payment_invoice_ids)])
domain = [('id','in',invoice_ids),('move_type', 'in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt'))]
domain = ['|',('id','in',down_payment_invoice_ids),('id','in',invoice_ids),('move_type', 'in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt'))]
searchbar_sortings = {
@ -66,7 +68,7 @@ class Kalachakra_PortalAccount(CustomerPortal):
domain += [('create_date', '>', date_begin), ('create_date', '<=', date_end)]
# count for pager
invoice_count = AccountInvoice.search_count(domain)
invoice_count = request.env['account.move'].search_count(domain)
# pager
pager = portal_pager(
@ -77,7 +79,7 @@ class Kalachakra_PortalAccount(CustomerPortal):
step=self._items_per_page
)
# content according to pager and archive selected
invoices = AccountInvoice.search(domain, order=order, limit=self._items_per_page, offset=pager['offset'])
invoices = request.env['account.move'].search(domain, order=order, limit=self._items_per_page, offset=pager['offset'])
request.session['my_invoices_history'] = invoices.ids[:100]
@ -102,11 +104,17 @@ class Kalachakra_PortalAccount(CustomerPortal):
user=request.env['res.users'].search([('id','=',user_id)])
booking_registrations=request.env['event.registration'].sudo().search([('booking_event','=',True),('partner_id','=',int(user.partner_id))])
invoice_ids=booking_registrations.invoice_id.ids
down_payment_invoice_ids=booking_registrations.down_payment_invoice_id.ids
invoice_count = request.env['account.move'].search_count([('id','in',invoice_ids),
('move_type', 'in', ('out_invoice', 'in_invoice', 'out_refund', 'in_refund', 'out_receipt', 'in_receipt')),
]) if request.env['account.move'].check_access_rights('read', raise_exception=False) else 0
values['invoice_count'] = invoice_count
invoice_count_d = request.env['account.move'].search_count([('id','in',down_payment_invoice_ids),
('move_type', 'in', ('out_invoice', 'in_invoice', 'out_refund', 'in_refund', 'out_receipt', 'in_receipt')),
]) if request.env['account.move'].check_access_rights('read', raise_exception=False) else 0
values['invoice_count'] = invoice_count+invoice_count_d
return values
class KalaAuthSignupHome(Home):


+ 4
- 0
views/event.xml View File

@ -85,7 +85,10 @@
<field name="inherit_id" ref="event.view_event_form" />
<field name="arch" type="xml">
<xpath expr="//div[@name='button_box']" position="replace">
<field name="website_url" invisible="1"/>
<field name="is_published" widget="website_redirect_button"/>
<div class="oe_button_box" name="button_box" attrs="{'invisible':[('booking_event','=',False)]}" groups="base.group_user">
<button name="%(act_booking_event_registration_from_event)d"
type="action"
context="{'search_default_expected': True,'booking_view':True}"
@ -105,6 +108,7 @@
<field name="seats_expected" widget="statinfo" string="Attendees"/>
</button>
</div>
</xpath>
<xpath expr="//field[@name='stage_id']" position="before">
<button name="add_event_to_google_agenda" type="object" attrs="{'invisible':[('calendar_event_id','!=',False)]}" string="Add event to google agenda" class="btn btn-warning"/>


Loading…
Cancel
Save