Bỏ qua để đến Nội dung
Odoo Menu
  • Đăng nhập
  • Dùng thử miễn phí
  • Ứng dụng
    Tài chính
    • Kế toán
    • Hóa đơn
    • Chi phí
    • Bảng tính (BI)
    • Tài liệu
    • Ký tên
    Bán hàng
    • CRM
    • Bán hàng
    • POS Cửa hàng
    • POS Nhà hàng
    • Đăng ký
    • Cho thuê
    Trang web
    • Trình tạo trang web
    • Thương mại điện tử
    • Blog
    • Diễn đàn
    • Trò chuyện trực tiếp
    • Học trực tuyến
    Chuỗi cung ứng
    • Tồn kho
    • Sản xuất
    • PLM
    • Mua hàng
    • Bảo dưỡng
    • Chất lượng
    Nhân sự
    • Nhân viên
    • Tuyển dụng
    • Ngày nghỉ
    • Đánh giá
    • Giới thiệu
    • Đội xe
    Marketing
    • Marketing trên MXH
    • Marketing qua email
    • Marketing qua SMS
    • Sự kiện
    • Tự động hóa Marketing
    • Khảo sát
    Dịch vụ
    • Dự án
    • Bảng chấm công
    • Dịch vụ hiện trường
    • Hỗ trợ
    • Kế hoạch
    • Lịch hẹn
    Năng suất
    • Thảo luận
    • Phê duyệt
    • IoT
    • VoIP
    • Kiến thức
    • WhatsApp
    Ứng dụng của bên thứ ba Studio Odoo Nền tảng Đám mây Odoo
  • Ngành
    Bán lẻ
    • Nhà sách
    • Cửa hàng quần áo
    • Cửa hàng nội thất
    • Cửa hàng tạp hóa
    • Cửa hàng đồ kim khí
    • Cửa hàng đồ chơi
    Ẩm thực & Dịch vụ lưu trú
    • Bar và quán rượu
    • Nhà hàng
    • Đồ ăn nhanh
    • Guest house
    • Nhà phân phối đồ uống
    • Khách sạn
    Bất động sản
    • Công ty môi giới bất động sản
    • Công ty kiến trúc
    • Xây dựng
    • Quản lý bất động sản
    • Làm vườn
    • Hiệp hội chủ sở hữu bất động sản
    Tư vấn
    • Công ty kế toán
    • Đối tác Odoo
    • Công ty marketing
    • Công ty luật
    • Tuyển dụng
    • Thanh tra & chứng nhận
    Sản xuất
    • Dệt may
    • Kim loại
    • Nội thất
    • Ẩm thực
    • Nhà máy bia
    • Quà tặng doanh nghiệp
    Sức khoẻ & fitness
    • CLB thể thao
    • Cửa hàng kính mắt
    • Trung tâm fitness
    • Chuyên gia chăm sóc sức khỏe
    • Hiệu thuốc
    • Tiệm làm tóc
    Thương mại
    • Dịch vụ sửa chữa
    • Phần cứng CNTT & Hỗ trợ
    • Hệ thống năng lượng mặt trời
    • Công ty sản xuất giày
    • Dịch vụ vệ sinh
    • Dịch vụ HVAC
    Khác
    • Tổ chức phi lợi nhuận
    • Cơ quan môi trường
    • Cho thuê biển quảng cáo
    • Nhiếp ảnh
    • Cho thuê xe đạp
    • Đại lý phần mềm
    Xem tất cả ngành
  • Cộng đồng
    Học tập
    • Khóa học
    • Tài liệu
    • Chứng chỉ
    • Đào tạo
    • Blog
    • Podcast
    Thúc đẩy đào tạo
    • Chương trình đào tạo
    • Trò chơi kinh doanh Scale Up!
    • Tham quan Odoo
    Nhận phần mềm
    • Tải xuống
    • So sánh các phiên bản
    • Phiên bản
    Hợp tác
    • Github
    • Diễn đàn
    • Sự kiện
    • Dịch thuật
    • Trở thành đối tác
    • Dịch vụ dành cho Đối tác
    • Đăng ký công ty kế toán của bạn
    Nhận dịch vụ
    • Tìm đối tác
    • Tìm kế toán
    • Gặp chuyên gia hỗ trợ
    • Dịch vụ Triển khai
    • Khách hàng tham khảo
    • Hỗ trợ
    • Nâng cấp
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Nhận một buổi demo
  • Bảng giá
  • Trợ giúp

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

  • CRM
  • e-Commerce
  • Kế toán
  • Tồn kho
  • PoS
  • Dự án
  • MRP
All apps
Bạn cần phải đăng ký để tương tác với cộng đồng.
Tất cả bài viết Người Huy hiệu
Thẻ (Xem tất cả)
odoo accounting v14 pos v15
Về diễn đàn này
Bạn cần phải đăng ký để tương tác với cộng đồng.
Tất cả bài viết Người Huy hiệu
Thẻ (Xem tất cả)
odoo accounting v14 pos v15
Về diễn đàn này
Hỗ trợ

how we use python parser file in odoo report

Đăng ký nhận tin

Nhận thông báo khi có hoạt động trên bài viết này

Câu hỏi này đã bị gắn cờ
reportsparserodooV8
7 Trả lời
13781 Lượt xem
Ảnh đại diện
kartik

i am use odoo version 8

i want to create custom report in account module.

 in "account_report.xml"

<report

id="custom_report_all_invoice"

model="account.invoice"

string="Sekoo Report all invoice"

report_type="qweb-pdf"

name="account.partnerledger_sekoo_all"

attachment_use="False"

file="account.partnerledger_sekoo_all"

/>


in my "partnerledger_sekoo_all.py"


import time

import datetime

from dateutil.relativedelta import relativedelta

from openerp.osv import osv

from openerp.report import report_sxw


class partnerledger_sekoo_all_report_parser(report_sxw.rml_parse):

     def __init__(self, cr, uid, name, context):

         super(partnerledger_sekoo_all_report_parser, self).__init__(cr, uid, name, context=context)

         self.localcontext.update({

               'time': time,

               'lines': self.lines,

              'get_partners':self._get_partners,

              'hello_world': self._hello_world,

              'invoices': self.invoices,

            })

     def invoices(self):

         self.cr.execute(

            "SELECT * FROM account_move_line l ")

           res = self.cr.dictfetchall()

           sum = 0.0

           if self.initial_balance:

              sum = self.init_bal_sum

              for r in res:

                 sum += r['debit'] - r['credit']

                 r['progress'] = sum

               full_account.append(r)

         return full_account

     def _hello_world(self):

        return "Hello World!"


class partnerledger_sekoo_all(osv.AbstractModel):

     _name = 'report.partnerledger_sekoo_all'

    _inherit = 'report.abstract_report'

    _template = 'partnerledger_sekoo_all'

    _wrapped_report_class = partnerledger_sekoo_all_report_parser



in "partnerledger_sekoo_all.xml"


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

<openerp>

<data>

<template id="partnerledger_sekoo_all">

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

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

<div class="page">

<h2>Sekoo Partner Ledger all</h2>

<span t-esc="hello_world()"/>

</t>

</t>

</template>

</data>

</openerp>


i also make entry in __openerp.py__ of xml file

and in __init.py__ import partnerledger_sekoo_all_report_parser


but in template that not show anything,

it return error like

"'NoneType' object is not callable" while evaluating

'hello_world()'

how can i solve that please help

0
Ảnh đại diện
Huỷ bỏ
Zbik

Do you have 'report' in depends, in __openerp__py?

Axel Mendoza

@Zbik i make entry of report.xml file in __openerp__.py it render template and not show any error but parser method hello_world() not accessible in .xml file please specify if anything else is required for parser in report also any detail doc for that

Ảnh đại diện
Axel Mendoza
Câu trả lời hay nhất

Hi @kartik

Your report name is 'account.partnerledger_sekoo_all' so you need to use it for the parser _template and _name in order to be used by Odoo. You could read a complete explanation and example at:

https://www.odoo.com/es_ES/forum/help-1/question/how-to-define-a-custom-methods-functions-to-be-used-in-a-qweb-report-how-to-define-and-use-a-report-parser-92244

Your case could be solved like:

class partnerledger_sekoo_all(osv.AbstractModel):

_name = 'report.account.partnerledger_sekoo_all'

_inherit = 'report.abstract_report'

_template = 'account.partnerledger_sekoo_all'

_wrapped_report_class = partnerledger_sekoo_all_report_parser
0
Ảnh đại diện
Huỷ bỏ
kartik
Tác giả

thank it wroks for me now i want to get all invoice objects with invoice lilne how can i get that in report.xml through parser file in odoo report

Axel Mendoza

Don't you have a function in the parser for that?. In the link above there is examples of how to do it

kartik
Tác giả

i want to get all invoice with invoice line in odoo report i try with this def invoices(self): self.cr.execute( "SELECT * FROM account_move_line l ") res = self.cr.dictfetchall() return res but it gives all record i want to get invoice list customer wise

Axel Mendoza

You could vote up if your post issue is solved

Ảnh đại diện
Zbik
Câu trả lời hay nhất

In __openerp__.py, try this

'depends': ['account','report']

UPDATE:

You comment lines and test again:

'lines': self.lines,

'get_partners':self._get_partners,

'invoices': self.invoices,


0
Ảnh đại diện
Huỷ bỏ
kartik
Tác giả

in accounts/__openerp__.py line already exist 'depends' : ['base_setup', 'product', 'analytic', 'board', 'edi', 'report'], after i add 'depends' : ['base_setup', 'product', 'analytic', 'board', 'edi', 'report','account'], so it return error 500: Internal Server Error Error Error message: account.invoice in log file it shows 2015-10-16 13:15:05,288 8204 ERROR bitnami_openerp openerp.addons.document.content_index: Cannot determine mime type. Traceback (most recent call last): File "C:\Bitnami\odoo-8.0-8\apps\odoo\Lib\site-packages\odoo-8.0_20150423-py2.7.egg\openerp\addons\document\content_index.py", line 167, in doIndex pop = Popen(['file','-b','--mime',fname], shell=False, stdout=PIPE) File "C:\Bitnami\odoo-8.0-8\python\lib\subprocess.py", line 709, in __init__ errread, errwrite) File "C:\Bitnami\odoo-8.0-8\python\lib\subprocess.py", line 957, in _execute_child startupinfo) WindowsError: [Error 2] The system cannot find the file specified 2015-10-16 13:15:07,450 8204 ERROR bitnami_openerp openerp.addons.document.content_index: Cannot determine mime type. Traceback (most recent call last): File "C:\Bitnami\odoo-8.0-8\apps\odoo\Lib\site-packages\odoo-8.0_20150423-py2.7.egg\openerp\addons\document\content_index.py", line 167, in doIndex pop = Popen(['file','-b','--mime',fname], shell=False, stdout=PIPE) File "C:\Bitnami\odoo-8.0-8\python\lib\subprocess.py", line 709, in __init__ errread, errwrite) File "C:\Bitnami\odoo-8.0-8\python\lib\subprocess.py", line 957, in _execute_child startupinfo) WindowsError: [Error 2] The system cannot find the file specified 2015-10-16 13:15:18,243 8204 INFO bitnami_openerp openerp.service.common: successful login from 'admin' using database 'bitnami_openerp' 2015-10-16 09:15:43,584 8988 WARNING bitnami_openerp openerp.addons.base.ir.ir_cron: Model `automatic.workflow.job` does not exist. 2015-10-16 09:16:43,622 8988 WARNING bitnami_openerp openerp.addons.base.ir.ir_cron: Model `automatic.workflow.job` does not exist.

Zbik

You create own custom module with this report and with this depends. If you only modify module account (it is NOT recommended), probably other error exist in code. Show your log file. PS. for new api in v8 see "Custom reports" - https://www.odoo.com/documentation/8.0/reference/reports.html

Zbik

answer updated

Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!

Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!

Đăng ký
Bài viết liên quan Trả lời Lượt xem Hoạt động
how can i get month wise reports for Bank, Revenue, Expenses
reports odooV8
Ảnh đại diện
0
thg 10 15
3925
How to register a parser for a qweb report Đã xử lý
invoice qweb reports parser odooV8
Ảnh đại diện
Ảnh đại diện
1
thg 9 15
7121
How to customize contact widget in qweb reports? Đã xử lý
qweb reports odooV8
Ảnh đại diện
Ảnh đại diện
2
thg 10 22
29902
QWebException: "Invalid template id: 'header_foobar'" while evaluating "translate_doc(doc_id, doc_model, 'partner_id.lang', 'account.report_invoice_foobar_document')"
qweb reports odooV8 QWebTemplateNotFound
Ảnh đại diện
0
thg 11 22
7325
Report Parser Odoo 8
qweb voucher reports parser
Ảnh đại diện
Ảnh đại diện
1
thg 3 16
6974
Cộng đồng
  • Khóa học
  • Tài liệu
  • Diễn đàn
Open source
  • Tải xuống
  • Github
  • Runbot
  • Dịch thuật
Dịch vụ
  • Lưu trữ Odoo.sh
  • Hỗ trợ
  • Nâng cấp
  • Phát triển tùy chỉnh
  • Đào tạo
  • Tìm kế toán
  • Tìm đối tác
  • Trở thành đối tác
Giới thiệu công ty
  • Công ty của chúng tôi
  • Tài sản thương hiệu
  • Liên hệ
  • Việc làm
  • Sự kiện
  • Podcast
  • Blog
  • Khách hàng
  • Pháp lý • Riêng tư
  • Bảo mật
الْعَرَبيّة 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 là bộ ứng dụng kinh doanh có open source đáp ứng tất cả các nhu cầu của công ty bạn: CRM, thương mại điện tử, kế toán, tồn kho, POS, quản lý dự án, v.v.

Định hướng giá trị riêng biệt của Odoo là tích hợp hoàn toàn và dễ dàng sử dụng.

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