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

Hi at all,

I have a running odoo 8.0 system. At one Sales Order I get the following Error. 

 File "/usr/lib/python2.7/dist-packages/openerp/models.py", line 5320, in ensure_one
    raise except_orm("ValueError", "Expected singleton: %s" % self)
QWebException: "ValueError
Expected singleton: account.invoice.tax(728, 727)" while evaluating
"translate_doc(doc_id, doc_model, 'partner_id.lang', 'account.report_invoice_document')"

I tried to reproduce it but without success, neither I found a solution. 

Does anyone has an idea, how I can solve this and print the Invoice PDF? 


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

Hello 

you have to add loop on the account_invoice_tax. 

you are getting multiple records instead on single record. that's why this  Expected Singleton error you are getting.

for ex:    <t t-foreach="line.tax_id" t-as="tax_id">
            <span t-field="tax_id.name"/>
           </t>
Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Hi Mitul, 

thanks for your fast reply. It seems as this should be the solution. But where do I find "account_invoice_tax" to change it? Is it a report or a model or something else?

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

into report you can from where error is comes. like into sale order you are made changes and print. at that time you got the error like expected singleton. so check the sale order lines tax value is print on report or not? if print then also check how you print the value or amount on report. ?

Tác giả

Your workaround helped a lot. Our salesman did the wrong tax entry. The Qweb report couldn't manage two entries and throwed the error. After changing this everything worked as it should.

Thanks for your help!

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 3 24
1732
3
thg 10 22
5913
0
thg 10 17
4342
3
thg 7 17
4669
1
thg 6 16
3465