Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
7482 Lượt xem

I've installed the following modules in my OpenERP 7 server, running on Ubuntu 12.04.

account_financial_report_webkit
base_headers_webkit
invoice_webkit
report_webkit
sale_order_webkit

Unfortunately, I'm getting errors on every webkit report I try to print. Here are the trackebacks I'm getting:

#------------------------------------
Sales Order Report
#------------------------------------
Webkit render!

Traceback (most recent call last):
File "/opt/openerp/7.0/addons/report_webkit/webkit_report.py", line 278, in create_single_pdf
*self.parser_instance.localcontext)
File "/usr/lib/python2.7/dist-packages/mako/template.py", line 302, in render return runtime._render(self, self.callable_, args, data)
File "/usr/lib/python2.7/dist-packages/mako/runtime.py", line 660, in _render *
_kwargs_for_callable(callable_, data))
File "/usr/lib/python2.7/dist-packages/mako/runtime.py", line 692, in _render_context _exec_template(inherit, lclcontext, args=args, kwargs=kwargs)
File "/usr/lib/python2.7/dist-packages/mako/runtime.py", line 718, in _exec_template callable_(context, args, *kwargs)
File "memory:0x7f573c08b210", line 36, in render_body

File "/opt/openerp/7.0/server/openerp/osv/orm.py", line 486, in __getattr__ raise AttributeError(e)
AttributeError: "Field 'address' does not exist in object 'browse_record(res.partner, 1)'"

#------------------------------------
Customer Invoice
#------------------------------------
Webkit render!

Traceback (most recent call last):
File "/opt/openerp/7.0/addons/report_webkit/webkit_report.py", line 266, in create_single_pdf
**self.parser_instance.localcontext)
File "/usr/lib/python2.7/dist-packages/mako/template.py", line 302, in render return runtime._render(self, self.callable_, args, data)
File "/usr/lib/python2.7/dist-packages/mako/runtime.py", line 661, in _render return context._pop_buffer().getvalue()
File "/usr/lib/python2.7/dist-packages/mako/util.py", line 134, in getvalue
return self.delim.join(self.data).encode(self.encoding, self.errors)
TypeError: sequence item 233: expected string or Unicode, bool found

#------------------------------------
Supplier Invoice
#------------------------------------
Webkit render!

Traceback (most recent call last):
File "/opt/openerp/7.0/addons/report_webkit/webkit_report.py", line 266, in create_single_pdf
**self.parser_instance.localcontext)
File "/usr/lib/python2.7/dist-packages/mako/template.py", line 302, in render return runtime._render(self, self.callable_, args, data)
File "/usr/lib/python2.7/dist-packages/mako/runtime.py", line 661, in _render return context._pop_buffer().getvalue()
File "/usr/lib/python2.7/dist-packages/mako/util.py", line 134, in getvalue return self.delim.join(self.data).encode(self.encoding, self.errors)
TypeError: sequence item 163: expected string or Unicode, bool found

#------------------------------------

So, my webkit deployment is not going well at all. :-| Any suggestions for me?

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

Anybody? Anything?? Camptocamp, are you there?

Câu trả lời hay nhất

Hello,

please choose this branch

https://code.launchpad.net/~sale-core-editors/sale-reports/7.0 (for v7)

instead of https://code.launchpad.net/~sale-core-editors/sale-reports/ (for v6.1)

The bug : AttributeError: "Field 'address' does not exist in object 'browse_record(res.partner, 1)'" prove that it is 6.1 version (not the same party model : 2 tables in v6.1, 1 for v7, no more field address in 'res.partner')

Do not remove rml

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

I am using the 7.0 branches. The contents of branch.conf for the sale-reports module: parent_location = http://bazaar.launchpad.net/~sale-core-editors/sale-reports/7.0/

The contents of branch.conf for the account-invoice-report module: parent_location = http://bazaar.launchpad.net/~account-core-editors/account-invoice-report/7.0/

Câu trả lời hay nhất

Hi,

I had a similar error when printing invoices. I could solve it with a change of the account_invoice.mako template. Search at the bottom of the file:

    %if inv.fiscal_position :
        <br/>
        <p class="std_text">
        ${inv.fiscal_position.note | n}
        </p>
    %endif

And replace it with the following code:

%if inv.fiscal_position and inv.fiscal_position.note :
    <br/>
    <p class="std_text">
    ${inv.fiscal_position.note | n}
    </p>
%endif

As you can see, I've added a further argument in the if statement. The attribute inv.fiscal_position.note seemed to return a boolean False.

Best regards,

Reinhard

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

I had the same problem.

The solution is to remove the selection in the check box "Add RML Header" under "Settings -> Technical -> Actions -> Reports" in the respective report.

It seems that Webkit Report and RML Header do not work together. You can select the Webkit header in the webkit tab.

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

I tried that and now get this traceback (abridged): File "/usr/lib/python2.7/dist-packages/mako/runtime.py", line 661, in _render return context._pop_buffer().getvalue() File "/usr/lib/python2.7/dist-packages/mako/util.py", line 134, in getvalue return self.delim.join(self.data).encode(self.encoding, self.errors) TypeError: sequence item 231: expected string or Unicode, bool found

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 3 15
6666
2
thg 3 15
6289
1
thg 3 15
5012
1
thg 3 15
6166
0
thg 3 15
4319