Passa al contenuto
Odoo Menu
  • Accedi
  • Provalo gratis
  • App
    Finanze
    • Contabilità
    • Fatturazione
    • Note spese
    • Fogli di calcolo (BI)
    • Documenti
    • Firma
    Vendite
    • CRM
    • Vendite
    • Punto vendita Negozio
    • Punto vendita Ristorante
    • Abbonamenti
    • Noleggi
    Siti web
    • Configuratore sito web
    • E-commerce
    • Blog
    • Forum
    • Live chat
    • E-learning
    Supply chain
    • Magazzino
    • Produzione
    • PLM
    • Acquisti
    • Manutenzione
    • Qualità
    Risorse umane
    • Dipendenti
    • Assunzioni
    • Ferie
    • Valutazioni
    • Referral dipendenti
    • Parco veicoli
    Marketing
    • Social marketing
    • E-mail marketing
    • SMS marketing
    • Eventi
    • Marketing automation
    • Sondaggi
    Servizi
    • Progetti
    • Fogli ore
    • Assistenza sul campo
    • Helpdesk
    • Pianificazione
    • Appuntamenti
    Produttività
    • Comunicazioni
    • Approvazioni
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    App di terze parti Odoo Studio Piattaforma cloud Odoo
  • Settori
    Retail
    • Libreria
    • Negozio di abbigliamento
    • Negozio di arredamento
    • Alimentari
    • Ferramenta
    • Negozio di giocattoli
    Cibo e ospitalità
    • Bar e pub
    • Ristorante
    • Fast food
    • Pensione
    • Grossista di bevande
    • Hotel
    Agenzia immobiliare
    • Agenzia immobiliare
    • Studio di architettura
    • Edilizia
    • Gestione immobiliare
    • Impresa di giardinaggio
    • Associazione di proprietari immobiliari
    Consulenza
    • Società di contabilità
    • Partner Odoo
    • Agenzia di marketing
    • Studio legale
    • Selezione del personale
    • Audit e certificazione
    Produzione
    • Tessile
    • Metallo
    • Arredamenti
    • Alimentare
    • Birrificio
    • Ditta di regalistica aziendale
    Benessere e sport
    • Club sportivo
    • Negozio di ottica
    • Centro fitness
    • Centro benessere
    • Farmacia
    • Parrucchiere
    Commercio
    • Tuttofare
    • Hardware e assistenza IT
    • Ditta di installazione di pannelli solari
    • Calzolaio
    • Servizi di pulizia
    • Servizi di climatizzazione
    Altro
    • Organizzazione non profit
    • Ente per la tutela ambientale
    • Agenzia di cartellonistica pubblicitaria
    • Studio fotografico
    • Punto noleggio di biciclette
    • Rivenditore di software
    Carica tutti i settori
  • Community
    Apprendimento
    • Tutorial
    • Documentazione
    • Certificazioni 
    • Formazione
    • Blog
    • Podcast
    Potenzia la tua formazione
    • Programma educativo
    • Scale Up! Business Game
    • Visita Odoo
    Ottieni il software
    • Scarica
    • Versioni a confronto
    • Note di versione
    Collabora
    • Github
    • Forum
    • Eventi
    • Traduzioni
    • Diventa nostro partner
    • Servizi per partner
    • Registra la tua società di contabilità
    Ottieni servizi
    • Trova un partner
    • Trova un contabile
    • Incontra un esperto
    • Servizi di implementazione
    • Testimonianze dei clienti
    • Supporto
    • Aggiornamenti
    GitHub Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Richiedi una demo
  • Prezzi
  • Aiuto

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilità
  • Magazzino
  • PoS
  • Progetti
  • MRP
All apps
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
Assistenza

QWebException: unexpected EOF while parsing (, line 1)

Iscriviti

Ricevi una notifica quando c'è un'attività per questo post

La domanda è stata contrassegnata
qwebvoucherreportqweb-report
1 Rispondi
12933 Visualizzazioni
Avatar
Anonymous

I created a custom module that computes total invoice from each customer or supplier payment voucher. It returns an error whenever I call the report.

QWebException: unexpected EOF while parsing (, line 1)

module: module_pdc

models/outstanding_pdc.py


from openerp import fields, api, models, exceptions

from datetime import datetime

from openerp.tools.translate import _

import openerp.addons.decimal_precision as dp

class AccountOutstandingPostDatedCheck(models.Model):

_name = 'account.post.dated.check.outstanding'

_description = 'Outstanding Receivable'

name = fields.Char(string='Reference No.')

is_customer = fields.Boolean('Customers')

is_supplier = fields.Boolean('Suppliers')

outstanding_pdc_line_ids = fields.One2many('account.post.dated.check.outstanding.line', 'outstanding_line_id', 'Outstanding Receivable Line')

@api.model

def create(self, values):

sequence_obj = self.env['ir.sequence']

values.update({'name' : sequence_obj.next_by_code('pdc.outstanding.ref')})

return super(AccountOutstandingPostDatedCheck,self).create(values)

@api.multi

def check_outstanding_pdc(self):

customer = self.is_customer

supplier = self.is_supplier

# Create object classes to access records.

account_voucher = self.env['account.voucher']

outstanding_pdc_line_ids = self.env['account.post.dated.check.outstanding.line']

# Clear the list before execution of the main process:

if self.outstanding_pdc_line_ids.ids != []:

self.outstanding_pdc_line_ids.unlink()

#Search the voucher within the selected period

date_today = datetime.now().date()

date_today = date_today.strftime("%Y-%m-%d")

pdc_vouchers = []

if customer and supplier:

raise exceptions.ValidationError(_('Select only one partner.'))

if not customer and not supplier:

raise exceptions.ValidationError(_('Select one partner.'))

elif customer:

pdc_vouchers = account_voucher.search([('post_dated', '=', True), ('state','=','posted'), ('partner_id.customer', '=', True), ('payment_details.type', '=', 'check'), ('payment_details.date_due', '>', date_today)])

elif supplier:

pdc_vouchers = account_voucher.search([('post_dated', '=', True), ('state','=','posted'), ('partner_id.supplier', '=', True), ('payment_details.type', '=', 'check'), ('payment_details.date_due', '>', date_today)])

# Loop through each Voucher and collect its Partner Ids.

partners = []

for voucher in pdc_vouchers:

if voucher.partner_id not in partners: partners.append(voucher.partner_id)

receivable = 0.00

envelope = 0.00

pdc = 0.00

for partner in partners:

for pdc_voucher in pdc_vouchers:

if pdc_voucher.partner_id == partner:

for voucher_line in pdc_voucher.line_ids:

receivable += voucher_line.amount_original

if not voucher_line.move_line_id.invoice.reconciled:

envelope += voucher_line.move_line_id.invoice.residual

pdc = receivable - envelope

vals = {

'outstanding_line_id' : self.ids[0],

'partner_id': partner.id,

'receivable': receivable,

'pdc': pdc,

'envelope': envelope

}

receivable = 0.00

envelope = 0.00

pdc = 0.00

outstanding_pdc_line_ids.create(vals)

class AccountPostDatedCheckOutstandingLine(models.Model):

_name = "account.post.dated.check.outstanding.line"

_description = "Outstanding Receivable Line"

outstanding_line_id = fields.Many2one('account.post.dated.check.outstanding', 'Outstanding Receivable Line')

partner_id = fields.Many2one('res.partner', 'Partner')

receivable = fields.Float('Receivable')

pdc= fields.Float('PDC')

envelope = fields.Float('Envelope')


views/report_outstanding_pdc_layout.xml

<?xml version="1.0" encoding="UTF-8" ?>

<openerp>

<data>

<template id="outstanding_pdc_header">

<div class="header">

<div class="row" style="text-align:center;">

<div class="col-xs-12">

<br/>

<h2>Outstanding Receivable</h2>

<t t-if="o.outstanding_pdc_line_ids.partner_id.customer">

<th>(Customers)</th>

</t>

<t t-if="o.outstanding_pdc_line_ids.partner_id.supplier">

<th>(Suppliers)</th>

</t>

</div>

</div>

</div>

</template>

<template id="outstanding_pdc_footer">

<div class="footer">

<div class="row">

<div class="col-xs-5">

<span t-esc="time.strftime('%A, %B %d, %Y')"/>

</div>

<div class="col-xs-3" style="text-right">

<![CDATA[&nbsp;]]>

</div>

<div class="col-xs-1">

<![CDATA[&nbsp;]]>

</div>

<div class="col-xs-3" style="text-right">

Page: <span class="page"/> of <span class="topage"/>

</div>

</div> `

</div>

</template>

<template id="outstanding_pdc_layout">

<t t-call="module_pdc.outstanding_pdc_header"/>

<t t-raw="0"/>

<t t-call="module_pdc.outstanding_pdc_footer"/>

</template>

</data>

</openerp>


views/report_outstanding_pdc.xml

<?xml version="1.0" encoding="utf-8"?>

<openerp>

<data>

<template id="report_outstanding_pdc_document">

<t t-call="report.html_container">

<t t-foreach="docs" t-as="o">

<t t-call="module_pdc.outstanding_pdc_layout">

<div class="page">

<table class="table table-condensed">

<thead>

<tr>

<th class="col-xs-3">Name</th>

<th class="col-xs-3">Receivable</th>

<th class="col-xs-3">PDC</th>

<th class="col-xs-3">Envelope</th>

</tr>

</thead>

<tr t-foreach="o.outstanding_pdc_line_ids" t-as="or">

<td class="col-xs-3">

<span t-field="or.partner_id"/>

</td>

<td class="col-xs-3">

<span t-field="or.receivable"/>

</td>

<td class="col-xs-3">

<span t-field="or.pdc"/>

</td>

<td class="col-xs-3">

<span t-field="or.envelope"/>

</td>

</tr>

<t t-set="rec" t-value="0.00"/>

<t t-foreach="o.outstanding_pdc_line_ids" t-as="r">

<t t-set="rec" t-value="rec+r.receivable"/>

</t>

<t t-set="pd" t-value="0.00"/>

<t t-foreach="o.outstanding_pdc_line_ids" t-as="p">

<t t-set="pd" t-value="pd+p.pdc"/>

</t>

<t t-set="env" t-value="0.00"/>

<t t-foreach="o.outstanding_pdc_line_ids" t-as="e">

<t t-set="env" t-value="env+e.envelope"/>

</t>

<tr>

<th class="col-xs-3"><strong>Total:</strong></th>

<th class="col-xs-3" t-esc="rec"/>

<th class="col-xs-3" t-esc="pd"/>

<th class="col-xs-3" t-esc="env"/>

</tr>

</table>

</div>

</t>

</t>

</t>

</template>

</data>

</openerp>





0
Avatar
Abbandona
Avatar
Anonymous
Autore Risposta migliore

I found what was the problem in my template.

<tr t-foreach="o.outstanding_pdc_line_ids" t-as="or">

Instead of **or**, I used different name for my one2many field.

0
Avatar
Abbandona
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!

Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!

Registrati
Post correlati Risposte Visualizzazioni Attività
ValueError The _name attribute report.test_module.report_test_doc is not valid. [Qweb]
qweb voucher report
Avatar
Avatar
Avatar
2
dic 18
16084
Report Parser [Qweb]
qweb voucher report
Avatar
0
mar 16
6299
odoo 16 report target new page scss
qweb report
Avatar
Avatar
1
apr 25
2182
Missing external identifier on new external layout template Risolto
qweb report
Avatar
Avatar
2
mar 25
2775
Translate month name in t-esc Qweb report Risolto
qweb report
Avatar
Avatar
Avatar
Avatar
Avatar
4
nov 24
8138
Community
  • Tutorial
  • Documentazione
  • Forum
Open source
  • Scarica
  • Github
  • Runbot
  • Traduzioni
Servizi
  • Hosting Odoo.sh
  • Supporto
  • Aggiornamenti
  • Sviluppi personalizzati
  • Formazione
  • Trova un contabile
  • Trova un partner
  • Diventa nostro partner
Chi siamo
  • La nostra azienda
  • Branding
  • Contattaci
  • Lavora con noi
  • Eventi
  • Podcast
  • Blog
  • Clienti
  • Note legali • Privacy
  • Sicurezza
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo è un gestionale di applicazioni aziendali open source pensato per coprire tutte le esigenze della tua azienda: CRM, Vendite, E-commerce, Magazzino, Produzione, Fatturazione elettronica, Project Management e molto altro.

Il punto di forza di Odoo è quello di offrire un ecosistema unico di app facili da usare, intuitive e completamente integrate tra loro.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now