Skip to Content
Odoo Menu
  • Prisijungti
  • Išbandykite nemokamai
  • Programėlės
    Finansai
    • Apskaita
    • Pateikimas apmokėjimui
    • Sąnaudos
    • Skaičiuoklė (BI)
    • Dokumentai
    • Pasirašymas
    Pardavimai
    • CRM
    • Pardavimai
    • Kasų sistema - Parduotuvė
    • Kasų sistema - Restoranas
    • Prenumeratos
    • Nuoma
    Svetainės
    • Svetainių kūrėjimo įrankis
    • El. Prekyba
    • Internetinis Tinklaraštis
    • Forumas
    • Tiesioginis pokalbis
    • eMokymasis
    Tiekimo grandinė
    • Atsarga
    • Gamyba
    • PLM
    • Įsigijimai
    • Priežiūra
    • Kokybė
    Žmogaus ištekliai
    • Darbuotojai
    • Įdarbinimas
    • Atostogos
    • Įvertinimai
    • Rekomendacijos
    • Transporto priemonės
    Rinkodara
    • Socialinė rinkodara
    • Rinkodara el. paštu
    • SMS rinkodara
    • Renginiai
    • Rinkodaros automatizavimas
    • Apklausos
    Paslaugos
    • Projektas
    • Darbo laiko žiniaraščiai
    • Priežiūros tarnyba
    • Pagalbos tarnyba
    • Planavimas
    • Rezervacijos
    Produktyvumas
    • Diskucija
    • Patvirtinimai
    • IoT
    • VoIP
    • Žinių biblioteka
    • WhatsApp
    Trečiųjų šalių programos Odoo Studija Odoo debesijos platforma
  • Pramonės šakos
    Mažmeninė prekyba
    • Knygynas
    • Drabužių parduotuvė
    • Baldų parduotuvė
    • Maisto prekių parduotuvė
    • Techninės įrangos parduotuvė
    • Žaislų parduotuvė
    Food & Hospitality
    • Barai ir pub'ai
    • Restoranas
    • Greitasis maistas
    • Guest House
    • Gėrimų platintojas
    • Hotel
    Nekilnojamasis turtas
    • Real Estate Agency
    • Architektūros įmonė
    • Konstrukcija
    • Estate Managament
    • Sodininkauti
    • Turto savininkų asociacija
    Konsultavimas
    • Accounting Firm
    • Odoo Partneris
    • Marketing Agency
    • Teisinė firma
    • Talentų paieška
    • Auditai & sertifikavimas
    Gamyba
    • Textile
    • Metal
    • Furnitures
    • Maistas
    • Brewery
    • Įmonių dovanos
    Sveikata & Fitnesas
    • Sporto klubas
    • Akinių parduotuvė
    • Fitneso Centras
    • Sveikatos praktikai
    • Vaistinė
    • Kirpėjas
    Trades
    • Handyman
    • IT įranga ir palaikymas
    • Saulės energijos sistemos
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Kiti
    • Nonprofit Organization
    • Aplinkos agentūra
    • Reklaminių stendų nuoma
    • Fotografavimas
    • Dviračių nuoma
    • Programinės įrangos perpardavėjas
    Browse all Industries
  • Bendrija
    Mokykitės
    • Mokomosios medžiagos
    • Dokumentacija
    • Sertifikatai
    • Mokymai
    • Internetinis Tinklaraštis
    • Tinklalaidės
    Skatinkite švietinimą
    • Švietimo programa
    • Scale Up! Verslo žaidimas
    • Aplankykite Odoo
    Gaukite programinę įrangą
    • Atsisiųsti
    • Palyginkite versijas
    • Leidimai
    Bendradarbiauti
    • Github
    • Forumas
    • Renginiai
    • Vertimai
    • Tapkite partneriu
    • Services for Partners
    • Registruokite jūsų apskaitos įmonę
    Gaukite paslaugas
    • Susiraskite partnerį
    • Susirask buhalterį
    • Susitikti su konsultantu
    • Diegimo paslaugos
    • Klientų rekomendavimas
    • Palaikymas
    • Atnaujinimai
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Gaukite demo
  • Kainodara
  • Pagalba

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

  • CRM
  • e-Commerce
  • Apskaita
  • Atsarga
  • PoS
  • Projektas
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Žymos (View all)
odoo accounting v14 pos v15
About this forum
Pagalba

Is it possible to generate reports with dynamic columns?

Prenumeruoti

Get notified when there's activity on this post

This question has been flagged
reportingreport
1 Atsakyti
10763 Rodiniai
Portretas
Yakito

Hello,

This is another of mine "is it possible" rather than "how to" questions. I need to understand the possibilities and limitations of reports before embarking into the creation of a custom module.

For this I need to understand if it is possible to create reports with X number of columns. X will come from the amenities a hotel have. So it will change depending on the hotel selected from a wizard before generating the report.

Lets say Hotel XYZ has 5 amenities I need a report with 5 columns where I will show the payments each guest made for each amenity, then Hotel YYY will have 10 amenities and I need to do the same but for all 10 amenities.

Will it be possible to code a report (I am currently using the OpenOffice plugin but any thing that work would be fine) flexible enough to do this with OpenERP?

Thanks for any tip!

0
Portretas
Atmesti
Portretas
Timo Talvitie, Vizucom Oy
Best Answer

At least the Mako reports should be flexible enough for your needs. With them you can create HTML tables and use for loops to format the rows and columns to fit your dataset. Even though you're working with HTML and CSS to format and style the data, the result will still be a PDF file.

If you want to see a basic example of how the Mako reports work, you can download a very nice module called sale_order_webkit, it's made by camptocamp and is available at v6apps.openerp.com/addon/6581

The example deals with pulling data from a single model, but if you're working with a complex dataset and need data from many tables, you can also directly query the database with cr.execute and pass the result to be formatted with Mako. We tried this direct query approach with some timesheet-related data and it worked very well.

Edit: here's a small code snippet from a .mako file

<table>
    <tr>
        % for key,value in month_data(emp_id).iteritems():
            <td>
                ${value}
            </td>
        % endfor
    </tr>
</table>

-emp_id and month_data are attached to the report parser on the fly with self.localcontext.update(), after which they are accessible by the .mako template

class TimesheetReportParser(report_sxw.rml_parse):
    def __init__(self, cr, uid, name, context):
        super(TimesheetReportParser, self).__init__(cr, uid, name, context=context)
        emp_id = context['active_id']

        self.localcontext.update({
            'emp_id': emp_id, 
            'month_data': self._fetch_hours,
        })

-emp_id is the employee ID of the person whose timesheet report is currently being generated

-month_data's contents are provided by a _fetch_hours() function that is also defined inside the parser class, it does a cr.execute() and returns a dictionary of values related to the current employee. Those values are then printed out in a for loop in the .mako file

1
Portretas
Atmesti
Yakito
Autorius

Thanks a lot! I will be testing Mako reports right now. So basically they work in the same way as building a website? That is very interesting. Thanks again

Timo Talvitie, Vizucom Oy

As far as the formatting goes, pretty much yes. I added a quick example of the .mako side to show the basic idea.

Enjoying the discussion? Don't just read, join in!

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

Registracija
Related Posts Replies Rodiniai Veikla
Chaning the Reportname
reporting report
Portretas
Portretas
1
liep. 24
2115
Where is the best updated info about all options in reports here?
reporting report
Portretas
Portretas
1
kov. 15
4240
report in open erp through interface
reporting report
Portretas
0
kov. 15
4403
when i make rml report i got an named "(<type 'exceptions.KeyError'>, KeyError(u'report.bi',), <traceback object at 0xb301052c>)
reporting report
Portretas
0
kov. 15
4754
How many types of reports are available?
reporting report
Portretas
Portretas
1
kov. 15
550
Bendrija
  • Mokomosios medžiagos
  • Dokumentacija
  • Forumas
Atvirasis kodas
  • Atsisiųsti
  • Github
  • Runbot
  • Vertimai
Paslaugos
  • Odoo.sh talpinimas
  • Palaikymas
  • Atnaujinti
  • Pritaikytas programavimo kūrimas
  • Švietimas
  • Susirask buhalterį
  • Susiraskite partnerį
  • Tapkite partneriu
Apie mus
  • Mūsų įmonė
  • Prekės ženklo turtas
  • Susisiekite su mumis
  • Darbo pasiūlymai
  • Renginiai
  • Tinklalaidės
  • Internetinis Tinklaraštis
  • Klientai
  • Teisinis • Privatumas
  • Saugumas
الْعَرَبيّة 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 yra atvirojo kodo verslo programų rinkinys, kuris apima visas įmonės poreikius: CRM, El. Prekybą, Apskaitą, Atsargų, Kasų sistemą, Projektų valdymą ir kt.

Unikali Odoo vertės pasiūla – būti tuo pačiu metu labai lengvai naudojama ir visiškai integruota sistema.

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