문제

Excuse me for my english

Today I'm trying to develop a new module in OpenERP v7. My module works fine exactly as I want, but when I share it with my teammates, after been install it they must insert lot of data manually to test all module's features. So I suggest to create a xml file wich contains some demo data.

I follows the documentation in this link

https://doc.openerp.com/trunk/server/03_module_dev_01/

Here is the content of my openerp.py

{
'author'        : "Oussama",
'version'       : '0.1',
'name'          : "School Management",
'description'   : "My Module for school",
'category'      : 'School',
'sequence'      : 0,
'depends'       : ['base'],
'demo'          : ['school_demo.xml'],
'installable'   : True,
'application'   : True,
'auto_install'  : False,
}

My school_demo.xml structure based on the official documentation

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data>
        <record id="job_1" model="ao_sc_job">
            <field name="name">Teacher</field>
        </record>
        <record id="job_2" model="ao_sc_job">
            <field name="name">Director</field>
        </record>
    </data>
</openerp>

In this file I try to add just two records in the table 'ao_sc_job', but when I restart the server, update my module I didn't find any records in 'ao_sc_job' table.

I don't know if I missed something. Any help would be greatly appreciated.

Thanks.

도움이 되었습니까?

해결책

  1. Check your model name : You may have the model names like "ao.sc.job" cross check with your py file for the model name. You have to use the model name not the table name there.
  2. Make sure you update the module. you can use -u module_name option on restarting the server. Or you have to upgrade the module from GUI after restating the server.
  3. Make sure that your Database is created with "Load Demo data" option
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top