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