Skip to Content
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Aprobări
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Estate Managament
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor

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

  • CRM
  • e-Commerce
  • Contabilitate
  • Inventar
  • PoS
  • Proiect
  • MRP
All apps
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
All Posts Oameni Insigne
Etichete (View all)
odoo accounting v14 pos v15
Despre acest forum
Suport

QWebException: unexpected EOF while parsing (, line 1)

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
qwebvoucherreportqweb-report
1 Răspunde
12939 Vizualizări
Imagine profil
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
Imagine profil
Abandonează
Imagine profil
Anonymous
Autor Cel mai bun răspuns

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
Imagine profil
Abandonează
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Înscrie-te
Related Posts Răspunsuri Vizualizări Activitate
ValueError The _name attribute report.test_module.report_test_doc is not valid. [Qweb]
qweb voucher report
Imagine profil
Imagine profil
Imagine profil
2
dec. 18
16088
Report Parser [Qweb]
qweb voucher report
Imagine profil
0
mar. 16
6300
odoo 16 report target new page scss
qweb report
Imagine profil
Imagine profil
1
apr. 25
2184
Missing external identifier on new external layout template Rezolvat
qweb report
Imagine profil
Imagine profil
2
mar. 25
2776
Translate month name in t-esc Qweb report Rezolvat
qweb report
Imagine profil
Imagine profil
Imagine profil
Imagine profil
Imagine profil
4
nov. 24
8140
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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