Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Is it possible to display delivery address on project task?

By
Rebel
on 5/24/13, 10:42 AM 1,033 views

Is it possible to display the delivery address in the project task form? I want to use this field on the printed report. Or can I use this field in the report editor without adding the field in the form?

I want to display partner_shipping_id.name from the sale.order table. The default partner_shipping_id from res.partner is not always correct. The project_task table does not have a sale_order_id, but does have a sale_line_id. This sale_line_id is linked to the id field of the tabel sale_order_line, but this table does not contain the partner_shipping_id.

How can I add the partner_shipping_id to the sale_order_line table, or what is the best solution to display the partner_shipping_id field (from sale.order) in the project.task table/form/print? (either is fine, as I can then use it in the report designer)

1

Davide Corio

--Davide Corio--
1822
| 4 3 7
Bricherasio, Italy
--Davide Corio--

Odoo Evangelist and Consultant

Davide Corio
On 5/24/13, 10:52 AM

Since the sale order line is linked to its sale order via the order_id field, you can do:

o.sale_line_id.order_id.partner_shipping_id

That sounds logical but when I use [[ o.sale_line_id.order_id.partner_shipping_id ]] or [[ o.sale_line_id.order_id.partner_shipping_id.name ]] it just shows up blank. I am using this in a custom report, I edited the .sxw file overwrote the .rml file and deinstalled the module. Updated module list and reinstalled, and the places where I added these fields it shows nothing.

Rebel
on 5/24/13, 11:24 AM

[[ o.sale_line_id.order_id.partner_shipping_id.street ]] [[ o.sale_line_id.order_id.partner_shipping_id.city]] and [[ o.sale_line_id.order_id.partner_shipping_id.zip]] don't work either sadly

Rebel
on 5/24/13, 11:31 AM

Do I need to import sale.order or res.parter in the __init__.py of my module? Right now it's just importing the report.

Rebel
on 5/24/13, 11:34 AM

of course, partner_shipping_id refers to an object. you'll need to specify the correct field you want to display. on v7 i think there's a field that sum up all the address infos at once, but i cannot remember the field name.

Davide Corio
on 5/24/13, 11:34 AM

How do I specify the correct field if not like: [[ o.sale_line_id.order_id.partner_shipping_id.street ]] ? What do I add after the partner_shipping_id to refer to street, city or zip? I don't mind them being in three separate fields, I can just add the code after each other to display it on one line. Unless I can not specify these single fields?

Rebel
on 5/24/13, 11:37 AM

that should work. i suggest to inspect and check the address via pdb

Davide Corio
on 5/24/13, 11:39 AM

Oddly only [[ display_address(o.sale_line_id.order_id.partner_shipping_id) ]] seemed to work, but thanks for your feedback and pushing me in the right direction. Couldn't have done it without you, appreciate you taking the time. :)

Rebel
on 5/24/13, 11:59 AM

display_address is what i couldn't remember :) nice you made it

Davide Corio
on 5/24/13, 12:04 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 5/24/13, 10:42 AM
Seen: 1033 times
Last updated: 3/16/15, 8:10 AM