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

Dear all, I ask another help on Odoo v14.


In the purchase order I don't want to use the name of the product, but the internal reference. So I supposed that going in "Reports > Purchase Order > Views > report_purchaseorder_document" I had to change this value:

line.name

with this:

line.default_code

This edit doesn't work, an error occured. Reading on this forum, I found a lot of people that wrote to use "l." (instead of "line."), but these tips were for old versions of Odoo. Also trying with "l." the pdf printing has the same error.


The error is above. Could anyone kindly help me to understand why it doesn't like default_code? Thank you very much!


Error to render compiling AST
AttributeError: 'NoneType' object has no attribute '_fields'
Template: purchase.report_purchaseorder_document
Path: /t/t/div/table/tbody/t[2]/tr/t[1]/td[1]/span
Node: 

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

there are 3 line.name make sure you modified first occurance.

Tác giả

Thank Cybrosys, you solved the question!

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

Hi,
Instead of 'line.default_code' use 'line.product_id.default_code'. Because default_code is not the field defined in the model of order line but in the model of product.

Regards

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 3 25
1177
0
thg 12 24
1448
1
thg 11 24
1689
0
thg 8 24
1677
1
thg 3 24
2488