Odoo Help

0

Access custom field on Saler Order from Invoice

By
Wintoro
on 7/16/14, 5:08 AM 2,191 views

Hi, please help....
i'am very beginner user OpenERP 7.0

i just add custom field on Saler Order with field name "x_jobname" (char, 50)

succesfully add to Form View use <field name="x_jobname" /> 

and on Sales Order report (pdf) use [[ o.x_jobname ]]

but still can't add to Invoice from view and invoice report (pdf)

how we can read from different model?

@Wintoro - Can you elaborate your question, what exactly you want to do. If possible share you code which is not working.

Hiren Vora - CEO at Emipro Technologies Pvt. Ltd. India
on 7/16/14, 5:32 AM

@Hiren Vora, thankyou for the advice the scenario as below : #1 -- Add custom field "*x_jobname*" type:char (50) from menu Setting->Database->Model-> *sales.order* ===> OK it's work #2 -- edit *Saler Order* form view from menu Debug -> Edit Form View -- add line ** ===> OK it's work #3 -- Modify Sales Order / Quotation report use OpenERP Report Designer on OpenOffice and add line *[[ o.x_jobname ]]* ===> OK it's work #4 -- edit *Invoice *form from menu Debug -> Edit Form View -- add line ** ===> *didn't work* #5 -- Modify *Invoice *report use OpenERP Report Designer on OpenOffice and add line *[[ o.x_jobname ]] *===> *didn't work* the problem on step 4 and 5 ==> i need show/include/reflect that additional field on *INVOICE* thank you very much in advance

Wintoro
on 8/3/14, 10:45 PM
0
Ben Bernard
On 7/17/14, 2:42 AM

You have to check relation between sale.order and INVOICE. For instance, if INVOICE has sale_id field with many2one relation to sale.order then in INVOICE report (sxw) you can call the custom field like,

[[ o.sale_id.x_jobname ]].

You can make direct relation as @Ludo suggest.

0
Ludo - Neobis
On 7/16/14, 6:18 AM

You need to add the field to the account.invoice model as well, or make a related field. I would suggest starting with a custom module instead of adjusting the database directly. That method is fine for demonstration purposes but not for actual adding functionality.

See documentation on this:

https://doc.odoo.com/trunk/server/03_module_dev_01/

Furthermore, the reports need to be adjusted as well. How this is done is also described in the documentation. I think you will figure it out. You can always look at the existing modules if you get stuck. There is a ton of informationt to be found there.

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

2 follower(s)

Stats

Asked: 7/16/14, 5:08 AM
Seen: 2191 times
Last updated: 3/16/15, 8:10 AM