Can we able to inherit and change the noupdate=“1” in odoo?

六月ゝ 毕业季﹏ 提交于 2019-12-21 05:30:21

问题


Is it possible to inherit from one xml and to change its updatable. I tried to inherit "Check Action Rules" to change the "interval_number" from 4 to 1 hours. To make it run every single hour. I don't think it may work because of noupdate="1". Anyone have any idea about this?


回答1:


Yes you can change the noupdate file by the help of hook. In the manifest file next to data add 'post_init_hook': 'post_init_hook',

create hooks.py file

def post_init_hook(cr, registry):
    env = api.Environment(cr, SUPERUSER_ID, {})
    orginalxml=env.ref('module.external id')
    orginalxml.write({'field_name_to_inherit':value,
    })


来源:https://stackoverflow.com/questions/41850027/can-we-able-to-inherit-and-change-the-noupdate-1-in-odoo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!