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

When I try to put two buttons in invoice and payment tree views , only one button appears and I don't know why !

This the code :

      <record id="action_update_period" model="ir.actions.server">

            <field name="name">mettre à jour la periode</field>

            <field name="model_id" ref="account.model_account_payment"/>

            <field name="state">code</field>

            <field name="code">

                if context.get('active_model') == 'account.payment' and context.get('active_ids'):

                    self.action_update_period_loop(cr, uid, context['active_ids'], context=context)

            </field>

        </record>

        

     <record id="ir_update_period" model="ir.values">

            <field eval="'client_action_multi'" name="key2"/>

            <field eval="'account.payment'" name="model"/>

            <field name="name">mettre à jour la periode</field>

            <field eval="'ir.actions.server,%d'%action_update_period" name="value"/>

        </record>  

<record id="action_update_period_invoice" model="ir.actions.server">

            <field name="name">mettre à jour la periode</field>

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

            <field name="state">code</field>

            <field name="code">

                if context.get('active_model') == 'account.invoice' and context.get('active_ids'):

                    self.action_update_period_invoice_loop(cr, uid, context['active_ids'], context=context)

            </field>

        </record>

        

     <record id="ir_update_period" model="ir.values">

            <field eval="'client_action_multi'" name="key2"/>

            <field eval="'account.invoice'" name="model"/>

            <field name="name">mettre à jour la periode</field>

            <field eval="'ir.actions.server,%d'%action_update_period_invoice" name="value"/>

        </record> 

this  code is in the same module

Thanks in advance !

الصورة الرمزية
إهمال
الكاتب

Thanks Jake


أفضل إجابة

Both of your ir.values records have the id ir_update_period. These need to be unique otherwise the second one will just update the first rather than create a second action.

Cheers 

Jake

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
0
سبتمبر 23
2517
0
سبتمبر 23
2201
2
يونيو 25
11799
6
أكتوبر 23
22887
3
مارس 24
10125