我们能否继承和更改noupdate =" 1"在odoo? [英] Can we able to inherit and change the noupdate="1" in odoo?

查看:883
本文介绍了我们能否继承和更改noupdate =" 1"在odoo?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以从一个xml继承并更改其可更新。我试图继承检查操作规则将interval_number从4更改为1小时。让它每一小时运行一次。因为noupdate =1,我认为它不会起作用。有人对此有任何想法吗?

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?

推荐答案

是的,您可以通过hook的帮助更改noupdate文件。在数据旁边的清单文件中添加'post_init_hook':'post_init_hook',

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',

创建hooks.py文件

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,
    })

这篇关于我们能否继承和更改noupdate =" 1"在odoo?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆