跳至內容
選單
此問題已被標幟
5 回覆
7875 瀏覽次數

What is the difference between init_xml,update_xml,data fields used in __openerp__.py file ?

頭像
捨棄
最佳答案

init_xml and update_xml deprcated parameters, use for new modules data instead.

  • init_xml - list of XML files with data that will load to DB at moment when you install module.
  • update_xml - list of XML files with data that will load to DB at moment when you install or update module.
  • data - list of XML, CSV or YAML files with data that will load to DB at moment when you install or update module. XML data file can have as install data and update data. It control by attribute noupdate of tag data.

    <openerp>
        <data>
            {install and update}
        </data>
        <data noupdate="1">
            {only install}
        </data>
    </openerp>
    
頭像
捨棄
作者

Thank you wowas

Hello wowas, It means both 'update_xml' and 'data' loads your data during installation of module as well as updation of module the only difference is 'data' provides facility to load data in either case. Is it true or am i misunderstood? Thanx.

But if you only use the "data" tag, how do you say noupdate on a csv?

最佳答案

I would like to add that `noupdate="1"` doesn't mean that it will not load on upgrading the module.

If you add a new `record` inside a `data` with `noupdate="1"` it will get loaded. At least in version 12. 

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
4月 24
2357
1
8月 22
3107
0
5月 17
7786
1
3月 15
4179
2
3月 15
4718