Community mailing list archives

community@mail.odoo.com

Re: adding a many2many data to xml record

by
Mohamed Hagag
- 06/28/2015 20:54:04

Thanks Ronald, it's working fine.


On 06/28/2015 09:53 PM, Ronald Wopereis wrote:
<blockquote cite="mid:CABr0iWZPoN4o55NkOWzs5mPbbhA=6RqiexyFhj3Q6p2=Gfz3wQ@mail.gmail.com" type="cite">
see page 64 and 65 of the excellent book "Odoo Development Essentials" author Daniel Reis

exerpt:
"The following example, taken from the Fleet app, replaces the list of related records of a tag_ids field:

<field name="tag_ids"
  eval=(6,0,
    [ref('vehicle_tag_leasing'),
     ref('fleet.vehicle_tag_compact'),
     ref('fleet.vehicle_tag_senior')]
 )]" />

where (6,_,[ids]) means replacing the list of linked records with the provided list.
The underscore symbol used above represents irrelevant values, usually filled with 0 or False"


2015-06-28 16:39 GMT+02:00 Mohamed M. Hagag <mohamedhagag1981@gmail.com>:

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