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

I want to override the "Reverse" button of stock picking to be only visible to stock.group_stock_manager.

I have used the same method as usual to override buttons:

 

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_picking_form_extend" model="ir.ui.view">
<field name="name">stock.picking.form.extend</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form"/>
<field name="arch" type="xml">
<xpath expr="/form/header/button[@name='%(act_stock_return_picking)d']" position="replace">
<button name="%(act_stock_return_picking)d" string="Reverse" states="done" type="action" groups="stock.group_stock_manager"/>
</xpath>
</field>
</record>
</data>
</openerp>

But I get an error. It says the element cannot be located in parent view.

I have this in parent view:

 

<button name="%(act_stock_return_picking)d" string="Reverse" states="done" type="action" groups="base.group_user"/>

Note: If I override other button (without the '%' and 'd' characters) it works fine.

What am I doing wrong?

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

You can try - button[@string='Reverse']

الكاتب

Nope. That doesn't work.

It is not allowed to use "@string" in Odoo 9

أفضل إجابة

Hello MouTio

try this.

 <xpath expr="//form/header/button[@name='%(stock.act_stock_return_picking)d']" position="replace">

 

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
مايو 16
4992
4
يوليو 20
8362
1
ديسمبر 19
6414
1
فبراير 18
5316
1
يونيو 17
5935