Skip to Content
Odoo Menu
  • Zaloguj się
  • Wypróbuj za darmo
  • Aplikacje
    Finanse
    • Księgowość
    • Fakturowanie
    • Wydatki
    • Arkusz kalkulacyjny (BI)
    • Dokumenty
    • Podpisy
    Sprzedaż
    • CRM
    • Sprzedaż
    • PoS Sklep
    • PoS Restauracja
    • Subskrypcje
    • Wypożyczalnia
    Strony Internetowe
    • Kreator Stron Internetowych
    • eCommerce
    • Blog
    • Forum
    • Czat na Żywo
    • eLearning
    Łańcuch dostaw
    • Magazyn
    • Produkcja
    • PLM
    • Zakupy
    • Konserwacja
    • Jakość
    Zasoby Ludzkie
    • Pracownicy
    • Rekrutacja
    • Urlopy
    • Ocena pracy
    • Polecenia Pracownicze
    • Flota
    Marketing
    • Marketing Społecznościowy
    • E-mail Marketing
    • SMS Marketing
    • Wydarzenia
    • Automatyzacja Marketingu
    • Ankiety
    Usługi
    • Projekt
    • Ewidencja czasu pracy
    • Usługi Terenowe
    • Helpdesk
    • Planowanie
    • Spotkania
    Produktywność
    • Dyskusje
    • Zatwierdzenia
    • IoT
    • VoIP
    • Baza wiedzy
    • WhatsApp
    Aplikacje trzecich stron Studio Odoo Odoo Cloud Platform
  • Branże
    Sprzedaż detaliczna
    • Księgarnia
    • Sklep odzieżowy
    • Sklep meblowy
    • Sklep spożywczy
    • Sklep z narzędziami
    • Sklep z zabawkami
    Żywienie i hotelarstwo
    • Bar i Pub
    • Restauracja
    • Fast Food
    • Pensjonat
    • Dystrybutor napojów
    • Hotel
    Agencja nieruchomości
    • Agencja nieruchomości
    • Biuro architektoniczne
    • Budowa
    • Zarządzanie nieruchomościami
    • Ogrodnictwo
    • Stowarzyszenie właścicieli nieruchomości
    Doradztwo
    • Biuro księgowe
    • Partner Odoo
    • Agencja marketingowa
    • Kancelaria prawna
    • Agencja rekrutacyjna
    • Audyt i certyfikacja
    Produkcja
    • Tekstylia
    • Metal
    • Meble
    • Jedzenie
    • Browar
    • Prezenty firmowe
    Zdrowie & Fitness
    • Klub sportowy
    • Salon optyczny
    • Centrum fitness
    • Praktycy Wellness
    • Apteka
    • Salon fryzjerski
    Transakcje
    • Złota rączka
    • Wsparcie Sprzętu IT
    • Systemy energii słonecznej
    • Szewc
    • Firma sprzątająca
    • Usługi HVAC
    Inne
    • Organizacja non-profit
    • Agencja Środowiskowa
    • Wynajem billboardów
    • Fotografia
    • Leasing rowerów
    • Sprzedawca oprogramowania
    Przeglądaj wszystkie branże
  • Community
    Ucz się
    • Samouczki
    • Dokumentacja
    • Certyfikacje
    • Szkolenie
    • Blog
    • Podcast
    Pomóż w nauce innym
    • Program Edukacyjny
    • Scale Up! Gra biznesowa
    • Odwiedź Odoo
    Skorzystaj z oprogramowania
    • Pobierz
    • Porównaj edycje
    • Wydania
    Współpracuj
    • Github
    • Forum
    • Wydarzenia
    • Tłumaczenia
    • Zostań partnerem
    • Usługi dla partnerów
    • Zarejestruj swoją firmę rachunkową
    Skorzystaj z usług
    • Znajdź partnera
    • Znajdź księgowego
    • Spotkaj się z doradcą
    • Usługi wdrożenia
    • Opinie klientów
    • Wsparcie
    • Aktualizacje
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Zaplanuj demo
  • Cennik
  • Pomoc

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

  • CRM
  • e-Commerce
  • Księgowość
  • Zapasy
  • PoS
  • Projekt
  • MRP
All apps
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
Wszystkie posty Osoby Odznaki
Tagi (Zobacz wszystko)
odoo accounting v14 pos v15
O tym forum
Pomoc

[SOLVED]- Generate reports from wizards-Empty Pages !?

Zaprenumeruj

Otrzymaj powiadomienie o aktywności w tym poście

To pytanie dostało ostrzeżenie
wizardpythonxmlqwebreports
4 Odpowiedzi
10795 Widoki
Awatar
Mostafa Mohamed Abdel Monaem



I updated the code but it generate error in calling `gen_student_attendance_report` function in ther report

Hint : if i remove the table of `gen_student_attendance_report` function the report print successfully

Here is my error :

except_orm: (u'"gen_student_attendance_report() got multiple values for keyword argument \'context\'" while evaluating\n\'o.gen_student_attendance_report(o.id)\'', (<class 'openerp.addons.base.ir.ir_qweb.QWebException'>, QWebException(ValueError(u'"gen_student_attendance_report() got multiple values for keyword argument \'context\'" while evaluating\n\'o.gen_student_attendance_report(o.id)\'',),), <traceback object at 0x7f3478bd0a28>))

Here is my python code :

from openerp.osv import osv,fields
import time

class fci_attendance_analysis (osv.osv):
_name='fci.attendance.analysis'
_rec_name='student_id'

_columns={
'standard_id':fields.many2one('fci.standard',string='Standard',required=True),
'group_id':fields.many2one('fci.standard.groups',string='Group'),
'date':fields.date('Date Of generation',readonly=True),
'_date':fields.date('Date'),
'student_id':fields.many2one('fci.student',string='Student'),
'number_of_absence': fields.integer( 'Number Of Absence'),
'terms_id': fields.many2one('fci.terms', string='Term',required=True),
'subject_id':fields.many2one('fci.subject',string='Subject',required=True),
'state': fields.selection([('s','by Subject'),('t','By Student')],string='Select Report Type',required=True),
}
_defaults = {
'state': 't',
'date': time.strftime("%Y-%m-%d")
}
def gen_student_attendance_report(self,cr, uid, ids, context=None ):
datas = {}
if context is None:context = {}
noobs_data=[]
data = self.read(cr, uid, ids, ['state','subject_id','student_id'], context=context)
stu= data[0]['student_id']
sub=data[0]['subject_id']
darsh=int(stu[0])
sasa=int(sub[0])
if data[0]['state'] == 't':
cr.execute(
"select DISTINCT ON (s.name) s.name as student_name,d.name as subject_name,attendance_date from fci_attendance_line ,fci_student s,fci_subject d where s.id=%d and d.id=%d and present=False "% (
darsh,sasa))
noobs = cr.dictfetchall()
cr.execute(
"select DISTINCT ON (s.name) s.name as student_name,d.name as subject_name,attendance_date from fci_attendance_line ,fci_student s,fci_subject d where s.id=%d and d.id=%d and present=False "% (
darsh,sasa))
noobs_details = cr.dictfetchall()
for details_ids in noobs_details:
for datae in noobs:
details_ids[datae['student_name']] = str(datae['student_name'])+str(datae['subject_name']) + str(datae['attendance_date'])
noobs_data.append(details_ids)

datas = {
'ids': [],
'model': 'fci.attendance.analysis',
'form': noobs_data[0]
}
return {
'type': 'ir.actions.report.xml',
'report_name': 'FCI_ERP.abcence_report_stu_document',
'datas': datas
}

fci_attendance_analysis()

here is my wizard code :

<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data>
<record id="fci_attendance_analysis_form" model="ir.ui.view">
<field name="name">fci.attendance.analysis.form</field>
<field name="model">fci.attendance.analysis</field>
<field name="priority" eval="8"/>
<field name="arch" type="xml">
<form string="Time Table Report" version="7.0">
<header>
<span groups="base.group_user">
<button special="cancel" string="Close" type="object"
icon="terp-dialog-close"/>
<button string="Generate Time Table Report" type="object"
name="gen_student_attendance_report"/>
</span>
</header>
<sheet>
<separator string="Select Teacher/Student" colspan="4"/>
<div>
<group colspan="4" cols="4">
<field name="state"/>
<field name="standard_id"/>
<field name="date"/>
<field name="terms_id"/>
<field name="subject_id"/>
</group>
<group col="4" colspan="4">
<field name="group_id"
attrs="{'required':[('state','=','t')],'invisible':[('state','!=','t')]}"/>
<field name="student_id"
attrs="{'required':[('state','=','t')],'invisible':[('state','!=','t')]}"/>
</group>
</div>
</sheet>
</form>
</field>
</record>

<record model="ir.actions.act_window" id="fci_attendance_analysis_reports_view">
<field name="name">Generate Time Table Report</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">fci.attendance.analysis</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
<field name="domain">[]</field>
<field name="context">{}</field>
</record>
<record model="ir.actions.act_window.view" id="fci_attendance_analysis_reports_view_form">
<field name="act_window_id" ref="fci_attendance_analysis_reports_view"/>
<field name="sequence" eval="20"/>
<field name="view_mode">form</field>
<field name="view_id" ref="fci_attendance_analysis_form"/>
</record>
</data>
</openerp>

and here is my report.xml :


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

<data>
<template id="abcence_report_stu_document">
<style type="text/css">
table.gridtable {
font-family: verdana,arial,sans-serif;
font-size:14px;
color:#333333;
border-width: 1px;
border-color: #666666;
border-collapse: collapse;
}
table.gridtable th {
border-width: 1px;
padding: 9px;
border-style: solid;
border-color: #666666;
background-color: #dedede;
}
table.gridtable td {
border-width: 1px;
padding: 9px;
border-style: solid;
border-color: #666666;
background-color: #ffffff;
}
</style>

<t t-call="report.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="report.external_layout">
<div class="font">
<div class="page">
<div class="row text-center">
<h2>
<b>
<span t-field='res_company.name'/>
</b>
</h2>
</div>
<para>
<font color="white">......</font>
</para>
<para>
<font color="white">......</font>
</para>
<para>
<font color="white">......</font>
</para>
<div class="row text-center">
<h2>
<strong>
كشف غياب الطالب
<p>
<span t-esc="o.student_id.name"/>
</p>
فى مادة
<p>
<span t-esc="o.subject_id.name"/>
</p>
</strong>
</h2>
</div>
<para>
<font color="white">......</font>
</para>
<para>
<font color="white">......</font>
</para>
<para>
<font color="white">......</font>
</para>
<para>
<font color="white">......</font>
</para>
<table class="gridtable">
<tbody>
<tr>
<th>Student Name</th>
<th>Standard</th>
<th>Group</th>
</tr>
<tr>
<td>
<span t-esc="o.student_id.name"/>
</td>
<td>
<span t-esc="o.standard_id.name"/>
</td>
<td>
<span t-esc="o.group_id.name"/>
</td>
</tr>
</tbody>
</table>
<para>
<font color="white">......</font>
</para>
<para>
<font color="white">......</font>
</para>
<table class="gridtable">
<tbody>
<tr>
<th>Subject Name</th>
<th>Absence Day</th>
</tr>
<tr t-foreach="o.gen_student_attendance_report(datas)" t-as="a">
<td>
<span t-esc="datas.get('student_name')"/>
</td>
<td>
<span t-esc="datas.get('attendance_date') "/>
</td>

</tr>

</tbody>
</table>
<para>
<font color="white">......</font>
</para>
<para>
<font color="white">......</font>
</para>
</div>
</div>
</t>
</t>
</t>
</template>
</data>
</openerp>

and here is my report tag :

<report
string="Student Report Absence"
id="report_Absence_subject"
model="fci.attendance.analysis"
report_type="qweb-pdf"
name="FCI_ERP.abcence_report_stu_document"
file="FCI_ERP.abcence_report_stu_document"/>

 i Hope i find some help :(

0
Awatar
Odrzuć
Mostafa Mohamed Abdel Monaem
Autor

Any help !!!

Awatar
Anil Kesariya
Najlepsza odpowiedź

Hello  John carter,

I faced the same issue before, even I asked that question already.

If you are using parser, for report than it create problem, because it passing wrong doc model.

To get exact model you have to override one method and have to expclitly pass few arguments for for qweb report. Click below link for more information.

Click Here


Hope this will helps.


Rgds,

Anil.



2
Awatar
Odrzuć
Mostafa Mohamed Abdel Monaem
Autor

so what should i do ? where is should add this new class and what is 'report.model'

Awatar
Mostafa Mohamed Abdel Monaem
Autor Najlepsza odpowiedź

.

0
Awatar
Odrzuć
Podoba Ci się ta dyskusja? Dołącz do niej!

Stwórz konto dzisiaj, aby cieszyć się ekskluzywnymi funkcjami i wchodzić w interakcje z naszą wspaniałą społecznością!

Zarejestruj się
Powiązane posty Odpowiedzi Widoki Czynność
How to Open Qweb Report ONly from wizard? Rozwiązane
python xml qweb reports odoo10
Awatar
Awatar
Awatar
3
cze 20
6209
Fields from QWeb Report Shifted/Move upon updating from another version
xml qweb reports
Awatar
0
sty 25
2245
missing headers, footers and CSS layout (i.e. are ugly) on server. Odoo v8 Rozwiązane
python xml qweb
Awatar
1
paź 15
5595
[Odoo SH] How to order by child fields ?
python xml qweb OdooSH
Awatar
Awatar
1
lut 21
3422
[odoo-9: QWEB]How to generate multiple report, togather from wizard?
wizard qweb reports odoo9
Awatar
Awatar
1
lip 16
4708
Społeczność
  • Samouczki
  • Dokumentacja
  • Forum
Open Source
  • Pobierz
  • Github
  • Runbot
  • Tłumaczenia
Usługi
  • Hosting Odoo.sh
  • Wsparcie
  • Aktualizacja
  • Indywidualne rozwiązania
  • Edukacja
  • Znajdź księgowego
  • Znajdź partnera
  • Zostań partnerem
O nas
  • Nasza firma
  • Zasoby marki
  • Skontaktuj się z nami
  • Oferty pracy
  • Wydarzenia
  • Podcast
  • Blog
  • Klienci
  • Informacje prawne • Prywatność
  • Bezpieczeństwo Odoo
الْعَرَبيّة 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 to pakiet aplikacji biznesowych typu open source, które zaspokoją wszystkie potrzeby Twojej firmy: CRM, eCommerce, księgowość, inwentaryzacja, punkt sprzedaży, zarządzanie projektami itp.

Unikalną wartością Odoo jest to, że jest jednocześnie bardzo łatwe w użyciu i w pełni zintegrowane.

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