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

[8] Odoo Custom Report Page

Abonare

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

Această întrebare a fost marcată
qwebreportodooV8
3 Răspunsuri
4684 Vizualizări
Imagine profil
Randy Raharjo

I have my own custom module, named master.py

from openerp.osv import fields, osv
from openerp.tools.translate import _
from openerp import tools
import datetime
import itertools

class mmr_brand(osv.osv):
_name = "mmr.brand"
_description = "Brand Module for PT.MMR, for easier input and prevent duplication."

_columns = {
'name': fields.char("Brand", required=True),
'notes' : fields.char("Notes"),
}

mmr_brand()

class mmr_unit(osv.osv):
_name = "mmr.unit"
_description = "Unit Module for PT.MMR, for easier input and prevent duplication."

_columns = {
'name': fields.char("Unit", required=True),
'notes' : fields.char("Notes"),
}

mmr_unit()


class mmr_product(osv.osv):

_name = "mmr.product"
_description = "Product Module for PT.MMR, refer to Product doc."

_columns = {
'brand': fields.many2one("mmr.brand", "Brand", required=True),
'name': fields.char("Name", required=True),
'unit': fields.many2one("mmr.unit", "Unit", required=True),
'minimumSellPrice': fields.float("Minimum sell price"),
}

mmr_product()

With view named master,

<openerp>
<data>
<record id="mmr_product_list" model="ir.ui.view">
<field name="name">mmr.product.list</field>
<field name="model">mmr.product</field>
<field name="arch" type="xml">
<tree string="Product" version="7.0">
<field name="brand" />
<field name="name" />
<field name="unit" />
<field name="minimumSellPrice" />
</tree>
</field>
</record>

<record id="mmr_product_form" model="ir.ui.view">
<field name="name">mmr.product.form</field>
<field name="model">mmr.product</field>
<field name="arch" type="xml">
<form string="Product" version="7.0" >
<header>
<button name="%(report_example)d" string="Print" type="action"/>
</header>
<group>
<field name="brand" />
<field name="name" />
<field name="unit" />
<field name="minimumSellPrice" />
</group>
</form>
</field>
</record>

<record id="mmr_brand_list" model="ir.ui.view">
<field name="name">mmr.brand.list</field>
<field name="model">mmr.brand</field>
<field name="arch" type="xml">
<tree string="Brand" version="7.0">
<field name="name" />
<field name="notes" />
</tree>
</field>
</record>

<record id="mmr_brand_form" model="ir.ui.view">
<field name="name">mmr.brand.form</field>
<field name="model">mmr.brand</field>
<field name="arch" type="xml">
<form string="Brand" version="7.0" >
<group>
<field name="name" />
<field name="notes" />
</group>
</form>
</field>
</record>

</data>
</openerp>

And Menu named menu_master,

<openerp>
<data>
<record id="multi_action_master_mmr_product" model="ir.actions.act_window">
<field name="name">Product</field>
<field name="res_model">mmr.product</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>

<menuitem id="mmr_menu" name="MMR" sequence="111" groups="base.group_user"/>

<menuitem id="mmr_menu_product" name="Product" parent="mmr_menu" sequence="1" />
<menuitem id="multi_menu_master_product" action="multi_action_master_mmr_product" name="Product" parent="mmr_menu_product" sequence="1" />

</data>
</openerp>

I also have created xml containing report template, i named the file reportExample.xml and placed it in view folder

<?xml version="1.0" encoding="utf-8"?>
<!--Custom report.-->
<openerp>
<data>

<template id="report_example">
<t t-call="report.external_layout">
<div class="page">
<div class="row">
<h3>Title</h3>
</div>
</div>
</t>
</template>

</data>
</openerp>

Then I also create xml named MMR_report.xml, containing

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<report
id="custom_report_example"
model="mmr.product"
string="Example"
report_type="qweb-pdf"
name="mmr.report_example"
attachment_use="False"
file="mmr.report_example"
/>
</data>
</openerp>

Also, I already noticed __openerp__ file about my new report

 'update_xml': [  
'view/reportExample.xml',
'view/master.xml',
'menu/menu_master.xml',
],

As you can see, I already insert button which I expect to show my custom report page when i pressed it. Unfortunately it doesn't work. Can someone explain what wrong with it?

0
Imagine profil
Abandonează
Imagine profil
Ankit H Gandhi(AHG)
Cel mai bun răspuns

Dear Mrpingu,

Your code is good but you do one mistake in button so please replace your code with my code.

Your code

<button name="%(report_example)d" string="Print" type="action"/>  

My code

<button name="%(custom_report_example)d" string="Print" type="action"/>


Hope this help full for you

Thanks & Regards

Ankit H Gandhi.

1
Imagine profil
Abandonează
Imagine profil
Randy Raharjo
Autor Cel mai bun răspuns

Thx Ankit Gandhi for the answer!


So I will write what I learn from this:

1.    To make report you need to write the template and fill the ID. You can just fill the template with <h2>Test<\h2> for testing purpose

2.    Then you will need to register your report using <report> tag. You can fill the ID, model(what class you want this report about), name and file (Your module folder name.Your template ID) 

3. Voila! Your class should have print button beside more dropdown button

4. Hope it helps!


0
Imagine profil
Abandonează
Imagine profil
Zbik
Cel mai bun răspuns

You define security rights in ir.model.access.csv for your custom module.

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
How to restrict user to save print report in their local system?
qweb report odooV8
Imagine profil
0
dec. 17
4406
How to dynamically change report Name odoo v8
qweb report odooV8
Imagine profil
Imagine profil
1
sept. 17
5884
How to create report (fields based on existing model)
qweb report odooV8
Imagine profil
Imagine profil
2
feb. 17
8104
How to change footer position/height in qweb reports ? Rezolvat
qweb report odooV8
Imagine profil
Imagine profil
1
aug. 16
17672
Vertical header in invoice and sale_order reports
qweb report odooV8
Imagine profil
0
ian. 16
3990
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