Odoo Help


How to get sale order custom field value in invoice form

Atul Kumar jain
on 1/22/14, 5:57 AM 2,769 views

Hi I have created Two custom fields in my sale order but these field's not showing in invoice form i also add in invoice form view and columns and update the server but these value is not showing in invoice please help me how can i show these value in invoice form

Pleased post your answer

NetbeamERP Technology
on 3/19/14, 3:28 AM
shashank verma
On 1/22/14, 6:45 AM

Hello atul

supose your 2new fields are red and blue both in sale order & invoice

Go to sale module-> sale.py-> search below function

def _prepare_order_line_invoice_line(self, cr, uid, line, account_id=False, context=None):

        return {
           'red': line.red,      #customized field
           'blue':line.blue,    #customized field

            'name': line.name,
            'origin': line.order_id.name,
            'account_id': account_id,
            'price_unit': pu,
            'quantity': uosqty,
            'discount': line.discount,
            'uos_id': uos_id,
            'product_id': line.product_id.id or False,
            'invoice_line_tax_id': [(6, 0, [x.id for x in line.tax_id])],
            'note': line.notes,
            'account_analytic_id': line.order_id.project_id and line.order_id.project_id.id or False,

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.


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

0 follower(s)


Asked: 1/22/14, 5:57 AM
Seen: 2769 times
Last updated: 3/16/15, 8:10 AM