تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
3145 أدوات العرض

Hello Everyone,

Nice to meet you again!

I'm getting the following error(Parse Error) while installing the module

odoo.tools.convert.ParseError: while parsing File Path:39, near

Code Snippet

<record id="country_rule" model="ir.rule">

    <field name="name">Country</field>

    <field name="model_id" ref="model_model_name"/>

    <field name="domain_force">['|', ('company_id', 'child_of', company_ids), ('company_id', 'parent_of', company_ids)]</field>

</record>

I don't know what am i missing the above code, Can you help me to figure it out?


Thanks in Advance !

الصورة الرمزية
إهمال
أفضل إجابة

I think the model ref is not correct. What model do you actually want to apply your rule to? I guess something more like 'model_sale_order' or some custom model you created...

الصورة الرمزية
إهمال
أفضل إجابة

Try this

<record id="country_rule" model="ir.rule">
            <field name="name">Country</field>
            <field name="model_id" ref="base.model_res_country"/>
            <field name="domain_force">['|', ('company_id', 'child_of', company_ids), ('company_id', 'parent_of', company_ids)]</field>
        </record>
Thanks
الصورة الرمزية
إهمال
الكاتب

Hi Husain,

Thanks for your update, but that's also throwing the same error.

المنشورات ذات الصلة الردود أدوات العرض النشاط
1
مارس 23
1953
1
يوليو 25
2432
2
يوليو 25
7898
2
يوليو 25
4304
2
يوليو 25
4041