콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
3 답글
6630 화면

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
5월 16
5206
4
7월 20
8683
1
12월 19
6706
1
2월 18
5627
1
6월 17
6355