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.

0

Product code in account invoice line

By
Oriol Gallart Garangou
on 9/14/15, 7:02 AM 353 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.

Thanks

1

Ahmed M.Elmubarak

--Ahmed M.Elmubarak--
2988
| 5 3 5
Sudan
--Ahmed M.Elmubarak--


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

Hello,

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

Thanks,

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

1 follower(s)

Stats

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