Odoo中文社区可以通过以下两个域名访问:shine-it.net , odoo.net.cn

由于系统升迁的原因,本论坛部分较早期的内容存在格式和链接损坏失效的问题,并非本论坛系统本身的缺陷,望谅解

本社区没有维护任何QQ群讨论组,任何与本社区同名的QQ群讨论组的言论与本社区无关!

开发人员可以登录gitter讨论组: http://gitter.im/odoo-china/Talk, 需要github账号

如果您登录系统碰到问题,请在微信公众号留言:

Auto_setup 自动帮你完成建新库时必做几个操作



  • https://github.com/ccdos/into-openerp-addons/tree/master/auto_setup

    下载:<br / https://github.com/ccdos/into-openerp-addons/archive/master.zip br />
    本模块在Openerp创建数据库的时候 自动安装,目前做了三件事
    1. 调整 Settings 菜单下面 Modules 下面的几个菜单的顺序,
      主要是把 apps 移到后面, 把 Installed Modules 提前
    2. 把 admin 加到 Technical Features 组
    3. 自动安装好 指定模块

    4. 模块是 我自己需要的 安装状态, 使用前 请根据 注释 适度修改一下.

    开发这个模块的缘由是在 学习过程中,经常需要新建数据库, 上面三个步骤几乎是每次都要做的.

    本模块 不需要特意安装, 在新建数据库的时候会自动安装, 并完成上述工作

    2013.06.03 18:27
    by [email protected]



  • 嗯. 这个好....

    顶起...

    我以前都是使用自己修改过的 base_data.xml 来玩的.



  • 太棒了 🙂
    建议bzrerp加入,哈哈
    不过两个
    auto_setup.xml
    auto_setup_group.xml
    其中内容是否有重复?
    建议再加入语言、汇率等的默认设置



  • 你说的都很有道理

    现在遇到的问题是,
    模块的安装过程似乎 是延后的,
    就是 现在的模块安装的几条xml 没有即时执行, 只是存到了任务队列中,

    因此后果就是 , 后面 还不能立即进行 语言、汇率等的默认设置,
    因为模块还没真正安装好,

    把 xml 拆分成两个企图解决这问题, 没成功.

    希望大家一起来完善这样的模块,

    码农嘛, 对于重复劳动有 天生的厌恶 ,总想用自动的方法来完成



  • 删除/不用auto_setup_group.xml
    openerp.py

    &nbsp; &nbsp; &#039;data&#039;: [<br />&nbsp; &nbsp; &nbsp;  &#039;auto_setup.xml&#039;,<br />&nbsp; &nbsp; ],
    




    改了一下auto_setup.xml,测试成功。

    &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br />&lt;openerp&gt;<br />&nbsp; &nbsp; &lt;data&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;!--&lt;menuitem id=&quot;base.menu_module_tree&quot; parent=&quot;base.menu_management&quot; name=&quot;Installed Modules&quot; sequence=&quot;1&quot; action=&quot;base.open_module_tree&quot;/&gt;--&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;!--删除应用和更新两个菜单--&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;!--&lt;delete model=&quot;ir.ui.menu&quot; search=&quot;[(&#039;id&#039;,&#039;=&#039;,&#039;module_mi&#039;)]&quot; /&gt;--&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;delete model=&quot;ir.ui.menu&quot; id=&quot;base.module_mi&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;delete model=&quot;ir.ui.menu&quot; id=&quot;base.menu_module_updates&quot;/&gt;<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;!--与下面一条record功能相同,将组group_no_one赋予用户admin<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;record id=&quot;base.user_root&quot; model=&quot;res.users&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field eval=&quot;[(4, ref(&#039;base.group_no_one&#039;)), ]&quot; name=&quot;groups_id&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/record&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; --&gt;<br /><br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;!--将用户admin加入组group_no_one--&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;record model=&quot;res.groups&quot; id=&quot;base.group_no_one&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;users&quot; eval=&quot;[(4, ref(&#039;base.user_root&#039;))]&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/record&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;!--设置本公司(main partner)的国家为中国--&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;record id=&quot;base.main_partner&quot; model=&quot;res.partner&quot; context=&quot;{&#039;default_is_company&#039;: True}&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;country_id&quot; ref=&quot;base.cn&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/record&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;!--设置本公司(main company)的货币为CNY--&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;record id=&quot;base.main_company&quot; model=&quot;res.company&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;currency_id&quot; ref=&quot;base.CNY&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/record&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;record id=&quot;base.CNY&quot; model=&quot;res.currency&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;company_id&quot; ref=&quot;base.main_company&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/record&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;!--设人民币汇率为1,设人民币为本位币--&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;record id=&quot;base.rateCNY&quot; model=&quot;res.currency.rate&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;rate&quot;&gt;1&lt;/field&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/record&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;record id=&quot;base.CNY&quot; model=&quot;res.currency&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;base&quot; eval=&quot;True&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/record&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;!--自动安装account_accountant、...、base_import模块--&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;function model=&quot;ir.module.module&quot; name=&quot;install_module&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;value eval=&quot;&#91;&#039;account_accountant&#039;,&#039;sale&#039;,&#039;purchase&#039;,&#039;base_import&#039;]&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;/function&gt;<br /><br />&nbsp; &nbsp; &lt;/data&gt;<br />&lt;/openerp&gt;<br />
    



    要在新建数据库时默认选择中文,貌似只能改\addons\web\static\src\xml\base.xml
    查找en_US改为zh_CN 就行了。


Log in to reply