3

I am trying to convert a SXW file into a RML file, using openerp_sxw2rml.py, but it is giving too errors and it is generating an empty RML file. I am sure that the content of the SXW is right, because I am using existing SXW files from the OpenERP modules, to check if they are being transformed in a right way.

I copied the account_balance.sxw from the account module, for example, and pasted it into openerp_sxw2rml folder to test it. Then I executed this:

sudo ./openerp_sxw2rml.py /opt/openerp7/addons/base_report_designer/openerp_sxw2rml/account_balance.sxw > /opt/openerp7/addons/base_report_designer/openerp_sxw2rml/account_balance.rml

And the result is the next:

./openerp_sxw2rml.py: 30: ./openerp_sxw2rml.py: 
OpenERP SXW2RML - The OpenERP's report engine

OpenERP SXW2RML is part of the OpenERP Report Project.
OpenERP Report is a module that allows you to render high quality PDF document
from an OpenOffice template (.sxw) and any relationl database.
: not found
./openerp_sxw2rml.py: 31: ./openerp_sxw2rml.py: __version__: not found
./openerp_sxw2rml.py: 34: ./openerp_sxw2rml.py: import: not found
./openerp_sxw2rml.py: 35: ./openerp_sxw2rml.py: import: not found
./openerp_sxw2rml.py: 36: ./openerp_sxw2rml.py: import: not found
./openerp_sxw2rml.py: 37: ./openerp_sxw2rml.py: import: not found
./openerp_sxw2rml.py: 38: ./openerp_sxw2rml.py: import: not found
from: can't read /var/mail/reportlab.lib.units
./openerp_sxw2rml.py: 40: ./openerp_sxw2rml.py: import: not found
./openerp_sxw2rml.py: 41: ./openerp_sxw2rml.py: import: not found
./openerp_sxw2rml.py: 43: ./openerp_sxw2rml.py: class: not found
./openerp_sxw2rml.py: 44: ./openerp_sxw2rml.py: General DOM API utilities.: not found
./openerp_sxw2rml.py: 45: ./openerp_sxw2rml.py: Syntax error: "(" unexpected

Why is this happening? Has anybody had the same problem?

Any help would be appreciated!

forvas
  • 9,801
  • 7
  • 62
  • 158

3 Answers3

3

First go to addons/base_report_designer/openerp_sxw2rml path and follow below command

General syntax

python openerp_sxw2rml.py src_path_of_sxw > dest_path_of_rml

Where scr_path_of_sxw is a source path of your .sxw file is store and dest_path_of_rml is a destination path where .rml file is store.

halfer
  • 19,824
  • 17
  • 99
  • 186
Bhavesh Odedra
  • 10,990
  • 12
  • 33
  • 58
  • Thank you Odedra! Your answer was right too, but I think that sajadkk answered earlier. I voted yours like an useful answer. – forvas Oct 31 '14 at 09:06
2

Run it using python

sudo python openerp_sxw2rml.py /opt/openerp7/addons/base_report_designer/openerp_sxw2rml/account_balance.sxw > /opt/openerp7/addons/base_report_designer/openerp_sxw2rml/account_balance.rml

(You have to specify python instead of ./ )

forvas
  • 9,801
  • 7
  • 62
  • 158
sajadkk
  • 764
  • 1
  • 5
  • 19
2

Following pull request fixes the issue: https://github.com/odoo/odoo-extra/pull/52

Sincerely,

Malte

mdik
  • 21
  • 2