这个OpenERP按钮是如何工作的



我在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"/>

按钮类型是动作类型,因此它将触发一个动作,该动作由 module.xml_id 调用。

因此,它将在帐户模块中搜索名为action_account_invoice_refund的操作xml视图

该操作将在帐户模块的向导文件夹中找到

使用 grep 函数查找 xml

例如:

使用 grep -rn "action_account_invoice_refund" 。 在帐户模块文件夹中

它将显示

最新更新