Skip to Content
Menu
This question has been flagged
1 Reply
3427 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

Avatar
Discard
Best Answer

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,

Avatar
Discard