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.

2

How to get sale order custom field value in invoice form

By
Atul Kumar jain
on 1/22/14, 5:57 AM 2,204 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
1
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,
        }

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: 1/22/14, 5:57 AM
Seen: 2204 times
Last updated: 3/16/15, 8:10 AM