首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >odoo中的动态标签打印

odoo中的动态标签打印
EN

Stack Overflow用户
提问于 2015-11-20 13:27:28
回答 1查看 1.4K关注 0票数 1

我正在使用动态标签打印应用程序,它工作得很好,(我正在为不同的客户创建不同的标签)作为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的打印选项。如何解决这个问题?

EN

回答 1

Stack Overflow用户

发布于 2015-11-20 13:37:36

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

代码语言:javascript
复制
<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文件中创建一个方法,如下所示

代码语言:javascript
复制
@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

代码语言:javascript
复制
<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
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33819613

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档