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

Hello all!

We are in Odoo 10 on the invoice form view.

I have define a new button on each invoice lines.This button is invisible under conditions. See image below between Unit price and Taxes columns.

The problem : if the new button is invisible for each invoice lines, the column stays there empty. Can we hide the column if it is empty? If all my buttons are hidden.

Images :





View :

<xpath expr="//field[@name='invoice_line_ids']//field[@name='discount']" position="after">
                  <field name="tracking" invisible="1"/>
                  <field name="origin" invisible="1"/>
                  <button name="split_lot" string="Lot Split" type="object" icon="fa-list"
                     groups="stock.group_production_lot" attrs="{'invisible': ['|',('tracking', '=', 'none'),('origin', '=', False)]}" />                   
                </xpath>



EDIT #1

I have tried condition on xpath. It doesn't work. I can't manage it!



الصورة الرمزية
إهمال

In tree view can't hide column, only data is hidden, if you wish then make two tree view and hide them according to your condition

الكاتب

SHould I also use two different actions? How to make conditionnal view? With different groups?

الكاتب

I don't understand how I can display a entire view under condition. The only way I know for this is by group. with this king of line :

<field name="groups_id" eval="[(6, 0, [ref('base.group_erp_manager') ])]"/>

أفضل إجابة


<xpath expr="//field[@name='invoice_line_ids']//field[@name='discount']" position="after">
                  <field name="tracking" invisible="1"/>
                  <field name="origin" invisible="1"/>
                  <button name="split_lot" string="Lot Split" type="object" icon="fa-list"
                     groups="stock.group_production_lot" attrs="{'column_invisible': ['|',('tracking', '=', 'none'),('origin', '=', False)]}" />                   
                </xpath>

Try to use 'column_invisible' instead of 'invisible' in the attributes of the button

الصورة الرمزية
إهمال

FYI: column_invisible will work in Odoo 11 and above version only. He asked for Odoo 10.

المنشورات ذات الصلة الردود أدوات العرض النشاط
1
سبتمبر 24
3081
1
نوفمبر 24
1679
0
يونيو 24
911
1
سبتمبر 21
9457
1
يناير 24
17064