Skip to Content
Menu
This question has been flagged
4 Replies
6336 Views

Hi, I have problems when i try make report with format xls.


file .py :

import xlwt 
from datetime import datetime
import time
from openerp.osv import orm 
from openerp.addons.report_xls.report_xls import report_xls
from openerp.addons.report_xls.utils import rowcol_to_cell, _render
from .wtc_kb_daily_report import wtc_daily_report_print
from openerp.tools.translate import translate
import logging
_logger = logging.getLogger(__name__)


and error message : 

Traceback (most recent call last):
File "/home/heru/odoo/openerp-8.0/openerp/service/server.py", line 901, in preload_registries
registry = RegistryManager.new(dbname, update_module=update_module)
File "/home/heru/odoo/openerp-8.0/openerp/modules/registry.py", line 324, in new
openerp.modules.load_modules(registry._db, force_demo, status, update_module)
File "/home/heru/odoo/openerp-8.0/openerp/modules/loading.py", line 354, in load_modules
force, status, report, loaded_modules, update_module)
File "/home/heru/odoo/openerp-8.0/openerp/modules/loading.py", line 263, in load_marked_modules
loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
File "/home/heru/odoo/openerp-8.0/openerp/modules/loading.py", line 149, in load_module_graph
load_openerp_module(package.name)
File "/home/heru/odoo/openerp-8.0/openerp/modules/module.py", line 312, in load_openerp_module
__import__('openerp.addons.' + module_name)
File "/home/heru/odoo/openerp-8.0/openerp/modules/module.py", line 77, in load_module
mod = imp.load_module('openerp.addons.' + module_part, f, path, descr)
File "/home/heru/odoo/addons/KOIN_BUMI/wtc_kb_daily_report/__init__.py", line 5, in <module>
import report
File "/home/heru/odoo/addons/KOIN_BUMI/wtc_kb_daily_report/report/__init__.py", line 1, in <module>
import wtc_kb_daily_report_report_xls
File "/home/heru/odoo/addons/KOIN_BUMI/wtc_kb_daily_report/report/wtc_kb_daily_report_report_xls.py", line 47, in <module>
class journal_detail_account_report_xls(report_xls):
NameError: name 'report_xls' is not defined


anybody, can tell me what is the solution for my case ?

thanks in advance.


<sorry my language is bad>

 

Avatar
Discard
Best Answer

I think that you need to put report_xls in your addons_path.

Maybe Report XLS (OCA) module is what you need for.

But it needs to be installed in your database to be used.

Avatar
Discard
Author

Hi Axel, I finish install module report_xls. but i don't know, how i use this module ?

You can check __openerp__.py for more info, it points to https://www.odoo.com/apps/modules/8.0/account_journal_report_xls to be used as example

Best Answer

I think you are using odoo V8 then you can use this module as a reference -->

https://www.odoo.com/apps/modules/8.0/account_move_line_report_xls/

The fields that you want to print in excel need to pass using parser  and also need to specify the cell width.

its also usable with odoo V9 

Avatar
Discard
Related Posts Replies Views Activity
0
Mar 15
3392
0
Jan 22
76
6
Dec 16
9942
0
Jul 19
3886
3
Oct 24
328