Odoo Help


how can add an existing field from a module to an other module?

on 8/3/15, 6:14 AM 637 views

how can add an existing field from a module to an other module?

for example I want to add "department_id" field (from hr module) to Asset form from accounting module(account_asset module)?

I think :

1. add this field in account_asset.py with this format:

'department_id': fields.many2one('hr.department', 'Department'),

2.add this field in postgresql with this format:

ALTER TABLE account_asset ALTER COLUMN department_id integer; ##I dont know what type should be use? (integer!!!)

but I have an error:

ERROR: relation "account_asset" does not exist

restart server

3.add this filed in interface from "manage view"

and after restart server, I have an error:

ProgrammingError: column account_asset_asset.department_id does not exist

please help


have you added module dependency in __openerp__.py file?

Solanki Shamji
on 8/3/15, 6:35 AM
On 8/3/15, 6:44 AM


Yes this field is store id so it is INTEGER.

you need to put hr module in __openerp__.py file in dependancy of your module account_asset.

in postgresql if you are using ubantu then

--> go inside your database

--> then \d  account_asset(your model name)

--> then you can see department id type as integer.

Hope this will help you if this will not display then let me know.

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: 8/3/15, 6:14 AM
Seen: 637 times
Last updated: 8/3/15, 6:45 AM