Community mailing list archives

community@mail.odoo.com

Re: adding a many2many data to xml record

by
Mohamed Hagag
- 06/28/2015 20:55:01

Many thanks Dhaval, this was crystal clear and saved my time, appreciate your kind help .


Regards,


On 06/29/2015 01:01 AM, Dhaval Patel wrote:
<blockquote cite="mid:CAKLWWMXzZtEOJPSsjn88jY-fzJK4M9jMfEc=XyWOO4pWx1CZEw@mail.gmail.com" type="cite">

see bellow example XML:

 <record id="hr_payroll_structure_general" model="hr.payroll.structure">
            <field name="name">General Salary strucutre</field>
            <field name="code">GENERAL</field>
            <field name="parent_id" ref="hr_payroll.structure_base"/>
            <field name="rule_ids" eval="[(6, 0,
               ref('hr_salary_rule_a'),
                ref('hr_salary_rule_b'),
                ref('hr_salary_rule_c'),
                ref('hr_salary_rule_d))]"
            </field>
        </record>


On Sun, Jun 28, 2015, 8:09 PM Mohamed M. Hagag <mohamedhagag1981@gmail.com> wrote:

Dears,


I would like to know how to add many2many data in an xml record of module ?



for example salary structure with rule_ids, I tried this :


 <record id="hr_payroll_structure_general" model="hr.payroll.structure">
            <field name="name">General Salary strucutre</field>
            <field name="code">GENERAL</field>
            <field name="parent_id" ref="hr_payroll.structure_base"/>
            <field name="rule_ids">
                hr_salary_rule_a,
                hr_salary_rule_b,
                hr_salary_rule_c,
                hr_salary_rule_d,
            </field>
        </record>


and it didn't show an error but also it didn't link the salary structure to the rules.


any idea how to achieve it ?!



Regards,

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe