This question has been flagged
2 Replies
5812 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?

Avatar
Discard

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

Author

@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

Best Answer

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.

Avatar
Discard
Best Answer

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.

Avatar
Discard