Odoo Help


Product code in account invoice line

Oriol Gallart Garangou
on 9/14/15, 7:02 AM 830 views

I want to add a new field (Code, for example) to account invoice line to get this code when we make an invoice in my company the users can use the default_code product to add new products in each line searching on it. The idea is separate the name and product_id from the product code with something like this:

default_code (Code) | product_id (Product) | name (Description)

searchable code | [Code] Name | [Code] Name

I tried to display in product_id field the [Code] and in name field the Name to "recycle" the to fields but I couldn't do it because one is a many2one field and the other one is a Text field and if one change the other one changes too.

I tried too to add in python code the field but nothing changes after restart the server.
So after the example this is the question:
It will be possible to do that I want with the option to add fields in the odoo configuration (in models options) or I need to develop yes or yes another module (called for example account.invoice.linewithcode)?
And another question related from the second is if I develop this module (which ineriths from account.invoice.line) I need to rewrite all account.invoice.line modules or adding only my required fields and the associated methods is enough.


--Ahmed M.Elmubarak--

Ahmed M.Elmubarak
On 9/14/15, 7:23 AM


I didn't get your question very clear ...

* if you'd like to change the appearance of the the product's name e.g:

you've a product with name: Paper, with code 123. Then you'd like this product appear as [123] Paper .

then you can achieve this using name_get function of the product, it is already showing the Internal reference in this manner.

* if you'd like to change the searching behavior, e.g insert the 123 get the Paper,

then you can use name_search function of the product.

I hope this will give you some clue


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

1 follower(s)


Asked: 9/14/15, 7:02 AM
Seen: 830 times
Last updated: 9/14/15, 7:23 AM