Skip to Content
Menu
This question has been flagged

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

Portretas
Atmesti
Autorius Best Answer

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

Portretas
Atmesti
Best Answer

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)]})    ​


Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
2
geg. 20
7385
5
vas. 19
7686
1
kov. 18
4084
1
lapkr. 17
7788
3
geg. 25
11323