【问题标题】:Odoo13-CE: Module: Sales: How can I style quotation-pdf and quotation-customer previewOdoo13-CE:模块:销售:如何设置报价单-pdf 和报价单-客户预览的样式
【发布时间】:2022-02-04 21:17:56
【问题描述】:

模块:销售:报价 我想在客户预览中更改文本样式和按钮颜色。 我想为 pdf 文件添加填充和边距。

有哪些选项可以进行这些更改?

【问题讨论】:

    标签: python xml odoo odoo-13


    【解决方案1】:

    要自定义客户预览,您需要更改 sale portal templates

    DownloadPrint 按钮在sale_order_portal_template 模板中定义:

    <div class="o_download_pdf btn-toolbar flex-sm-nowrap">
        <div class="btn-group flex-grow-1 mr-1 mb-1">
            <a class="btn btn-secondary btn-block o_download_btn" t-att-href="sale_order.get_portal_url(report_type='pdf', download=True)" title="Download">
                <i class="fa fa-download"/>
                Download
            </a>
        </div>
        <div class="btn-group flex-grow-1 mb-1">
            <a class="btn btn-secondary btn-block o_print_btn o_portal_invoice_print" t-att-href="sale_order.get_portal_url(report_type='pdf')"
               id="print_invoice_report" title="Print" target="_blank">
                <i class="fa fa-print"/>
                Print
            </a>
        </div>
    </div>
    
    

    要更改按钮文本样式和颜色,您可以更改classstyle 属性,在以下示例中,我们使用btn-primary 代替btn-secondary 类:

    <template id="sale_order_portal_template" name="My Sales Orders" inherit_id="sale.sale_order_portal_template">
        <xpath expr="//a[hasclass('o_download_btn')]" position="attributes">
            <attribute name="class">btn btn-primary btn-block o_download_btn</attribute>
        </xpath>
    </template>
    

    页面内容定义在一个id为quote_content的div中

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多