跳至内容
菜单
此问题已终结

Hi community,

I want to make the value of an existing Boolean field in res.config.settings(group_route_so_line) into true while installing my custom module.I have tried to rewrite the field but it don't work for me.How can i achieve that, am using odoo11.

Thanks

形象
丢弃
编写者 最佳答案

Hi,

Thanks for the help guys

i solved my issue by following code

<data noupdate="0">
<record id="sales_team.group_sale_manager" model="res.groups">
<field name="implied_ids" eval="[(4, ref('sale_stock.group_route_so_lines'))]"/>
</record>
</data>

I have just added my required user group to the group corresponding to group_route_so_line using code.

Thanks for the response

形象
丢弃
最佳答案

you can register post init hook in manifest or create <function/> entry in the data file and call model method for add implied group like

​<function model="res.config.settings" name="set_implied_group"/>

@api.model
def set_implied_group(self):
    self.env.ref('base.group_user').write({'implied_ids': [(4, self.env.ref('sale_stock.group_route_so_lines').id)]})    ​


形象
丢弃
相关帖文 回复 查看 活动
2
5月 20
7396
5
2月 19
7695
1
3月 18
4092
1
11月 17
7803
3
5月 25
11324