콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
3 답글
36954 화면

I am trying to install new module which is dependent on sale along with demo data. Whenever I install the module it inserts demo data created by me as well as demo data preset in sale module. I would like to ignore demo data of dependent module e.g. sale and insert demo data which created by me in newly customized module. How to do it?

아바타
취소
베스트 답변

Hello Nitin,


First create database by running odoo service as below:


./odoo-bin -d db_name –without-demo=WITHOUT_DEMO


Then install the module for which you want to install demo data through following command:

./odoo-bin -d db_name -i module_name


And it will work ....


Thanks and Regards,

Aaquib Kardame.

아바타
취소
작성자

Great !! This is what I needed. Working. Thanks.

베스트 답변

Hi Nitin,

By default there is no easy way to do it in Odoo. If you create a new database you have to choose if it is a demo database or not. If you choose for a demo database all demo data from all modules will be loaded and there is no technical option to specify this per module. You could technically inherit the default Odoo module(s) and remove the demo data again but that's probably not a good idea to do.


If you do not work with a demo database you could move your own 'demo' data into default data though. The default data is always loaded which means all your data will be shown, also if it is no demo database. For example under /data you have a file named 'your_table.xml':

<?xml version="1.0" ?>
<odoo>
    <data noupdate="1">
        <record id="sample_record_1" model="your.table">
            <field name="name">First record</field>
        </record>
</odoo>

You can then load it in the __manifest__.py under 'data' like this:

'data': [data/your_table.xml']

Regards,

Yenthe


Regards,
Yenthe

아바타
취소
베스트 답변

Hi,
If you enable demo data, it will load the demo data of the all the module. In your case i feel it is better to load you data as data file, rather than demo file, so that the demo data of the other module will not get installed and you will get what you need.

 

See the sample data  file in the account module,



Link: https://github.com/odoo/odoo/blob/12.0/addons/account/data/data_account_type.xml

Thanks

아바타
취소
관련 게시물 답글 화면 활동
0
12월 19
4658
0
6월 19
2682
4
4월 25
79101
1
6월 19
14191
6
5월 24
50883