I need your help please.
I try to set a value of group_invoice_so_lines to true in sale.config.settings using a custom module. In xml file i've added this code:
<?xml version="1.0" encoding="utf-8"?>
<function model="res.config.settings" name="set_default">
but the field value is alaways set to False.
Any idea ? how can I create a module to activate all features that I need.
The Model is a transientModel so you can not store data in xml.
But how to do what happends by clicking options:
look in 'openerp.addons.base.res.res_config.res_config_settings#execute()'
- For a field like 'default_XXX', ``execute`` sets the (global) default value of the field 'XXX' in the model named by ``default_model`` to the field's value.
- For a boolean field like 'group_XXX', ``execute`` adds/removes 'implied_group' to/from the implied groups of 'group', depending on the field's value. By default 'group' is the group Employee. Groups are given by their xml id.
- For a boolean field like 'module_XXX', ``execute`` triggers the immediate installation of the module named 'XXX' if the field has value ``True``.
- For the other fields, the method ``execute`` invokes all methods with a name that starts with 'set_'; such methods can be defined to implement the effect of those fields.
So your solution would be:
<record model="res.groups" id="base.group_user"> <field name="implied_ids" eval="[(4, ref('sale.group_invoice_so_lines'))]"/> </record>
As you grep in code 'group_invoice_so_lines' that the on_change also changes the "default_order_policy" so you need also add this to your xml.
<function id="sale_order_order_pol_default_set" model="ir.values" name="set_default" eval="('sale.order','order_policy', 'manual')"/>
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 7/19/14, 9:06 PM|
|Seen: 1860 times|
|Last updated: 3/16/15, 8:10 AM|