1)
You should not change core python modules, you
should create your own models that inherit OpenERP’s
models
2)
You should not change core XML files, you should
create your own views that inherit OpenERP’s views
3)
You should never create database fields in pgadmin –
all fields are created by OpenERP
If
you are ‘learning’ you can break rules 1 and 2 for a
while. You can NEVER break rule 3) – you are
bypassing ORM
4)
When you change python code, you need to restart the
server for it to see it. You also need to update
the module to have it add fields to the database.
5)
When you change XML, you need to update the module
to have OpenERP bring the XML into the database.
I
know you say you did this but I can tell from your
skill level you may not have done what you think you
did!
Since
you didn’t make the changes the right way you should
start the entire process again the right way before
trying to troubleshoot.
You
need to read the documentation and research some
examples of modules written by others that use best
practices.
To
add fields to a model and to a view, you can follow
my example at https://launchpad.net/openerp-add-user-sales-order
Ray.
From:
openerp-community-bounces+rcarnes=[email protected]
[mailto:openerp-community-bounces+rcarnes=[email protected]]
On Behalf Of Dale E. Moore
Sent: Wednesday, December 19, 2012 4:10 PM
To: [email protected]
Subject: [Openerp-community] Novice question;
Add field to 6.1 Employee form?
Please pardon my novice
question!
I hope to add some fields to
the Miscellaneous tab of the Employee form. I've
gotten the fields into the DB and Developper
mode, view fields says the fields are there,
but; they don't appear.
In
/usr/share/pyshared/openerp/addons/hr_contract/hr_contract.py
after
'contract_id':fields.function(_get_latest_contract,
string='Contract', type='many2one',
relation="hr.contract", help='Latest contract
of the employee'),
'drivers_license':
fields.char('Drivers License', size=30),
'drivers_license_expires':
fields.date('Drivers License Expires Date'),
'auto_insurance':
fields.char('Auto Insurance Policy', size=30),
'auto_insurance_expires': fields.date('Auto
Insurance Expires Date'),
I used pgadmin to add the
fields to hr_employee. In
/usr/share/pyshared/openerp/addons/hr_contract/hr_contract_view.xml
after
<field name="drivers_license"/>
<field name="drivers_license_expires"/>
<field name="auto_insurance"/>
<field name="auto_insurance_expires"/>
Then I Updated Modules. But
Human Resources, Employees, pick an employee,
Miscellaneous tab does not have the 4 new
fields.
Thanks for any help you can
provide,