Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
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.
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  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
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 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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 9/14/15, 7:02 AM|
|Seen: 432 times|
|Last updated: 9/14/15, 7:23 AM|