我正在使用动态标签打印应用程序,它工作得很好,(我正在为不同的客户创建不同的标签)作为Dynamic label setup
我为demooo-1、Company-3、Company-2 \f25 ..And -2创建了标签-2\f25 I got labels list -2
它工作正常,但是当我进入-2\f25 demooo-2 \f6记录时,我不想要-3\f25 Company-3 \f6和-2\f25 Company-2 \f6的打印选项。如何解决这个问题?
发布于 2015-11-20 13:37:36
在窗体视图中创建一个按钮
<record id="invoice_form" model="ir.ui.view">
<field name="name">account.invoice.form</field>
<field name="model">account.invoice</field>
<field name="arch" type="xml">
<form string="Invoice">
<header>
<button name="invoice_print" string="Print" type="object" attrs="{'invisible':['|',('sent','=',True), ('state', '!=', 'open')]}" class="oe_highlight" groups="base.group_user"/>
</header>
</form>
</field>
</field>
</record>在Python Logic文件中创建一个方法,如下所示
@api.multi
def invoice_print(self):
""" Print the invoice and mark it as sent, so that we can see more
easily the next step of the workflow
"""
self.ensure_one()
return self.env['report'].get_action(self, 'account.report_invoice')如下所示创建一个Report.Xml
<template id="report_invoice">
<t t-call="report.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="moduleName.report_invoice_document" t-lang="o.partner_id.lang"/>
</t>
</t>
</template>https://stackoverflow.com/questions/33819613
复制相似问题