【发布时间】:2014-01-16 10:34:02
【问题描述】:
我在 OpenERP xml 视图中遇到了一些代码,但我无法理解它是如何工作的。
<button name="%(account.action_account_invoice_refund)d" type='action' string='Refund' states='open,paid' icon="gtk-execute"/>
- % 是什么意思
- 最后的 d 是什么?
- 为什么会有账户(点)action_account_invoice_refund
系统中没有调用account_invoice_refund的方法,但是有一个类:
class account_invoice_refund(osv.osv_memory):
调用方法的传统按钮如下所示:
<button name="invoice_cancel" states="proforma2,open" string="Cancel" icon="gtk-cancel"/>
【问题讨论】:
-
我认为这个问题与stackoverflow.com/questions/14682253/…重复
-
链接的问题说,除非它是工作流(默认),否则类型必须是对象或操作。上面的 invoice_cancel 按钮调用 python 代码但没有 type=object
-
如果按钮从工作流中调用,那么它就是动作对象
标签: openerp