2015-11-20 45 views
1

打印我使用动态标签打印应用程序,它做工精细,为Dynamic label setup动态标签在odoo

(我创造不同客户的不同标签),我创建标签demooo-1,公司-3,公司 - 2 ..和我labels list

其工作正常,但我不希望公司-3和公司-2,打印选项,当我进入demooo-2纪录....怎么解决这个

回答

0

在您的窗体视图中创建一个按钮

<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逻辑文件中创建一个方法像下面

@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') 

创建像下面

<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> 
+0

谢谢jainik一个report.xml将,但我没有得到如何给特定发票ID作为表单视图中打印按钮的操作,(这里我为不同的记录创建不同的动态报告)。是否有可能给域的报告选项使某些记录不可见。 – Sai1919

+0

@ Sai1919你能详细解释一下你的问题吗? –

+0

您是否在打印选项或更多选项菜单上创建域名? –