2017-03-23 11 views
0

製品ラベルをPDFに生成しようとしていますが、生成されていますが製品バーコードがありません。Odoo v10でPDFレポートを生成する際にバーコードが表示されない

しかし、私は同じQwebを使って製品ラベルをHTMLに生成しても問題ありません。

製品に移動し、2を選択: HTML(作業ファイン)として製品ラベル生成

enter image description here

:として製品ラベルを生成

enter image description here

をPDF(不足しているバーコード):

enter image description here

これは私のQWEBです:

<?xml version="1.0"?> 
<t t-name="product.report_productlabel"> 
<t t-call="report.html_container"> 
<div class="page"> 
    <style> 

    </style> 

    <t t-foreach="docs" t-as="template"> 
    <t t-foreach="template.product_variant_ids" t-as="product"> 

     <div class="col-xs-6" style="padding:0;"> 
     <table style="border-spacing:0;margin-bottom:0;height: 110px;border: 2px solid black;" class="table"> 
      <thead> 
      <tr style="width: 3in;"> 
       <td style="width: 2.63in;text-align: center;background-color: #fff;" colspan="2" class="col-xs-8 danger"> 
       <strong style="text-transform: uppercase;"> 
        <t t-esc="product.name"/> 
       </strong> 
       </td> 
      </tr> 
      </thead> 
      <tbody> 
      <tr style="width: 1in;"> 
       <td style="text-align: center; border-top: 0px solid #fff; padding: 0px 5px 0px 5px;" class="col-xs-5"> 
       <h4 style="border: 4px solid #ff4040;border-radius: 9px;background-color: #ffff00;padding: 10px 12px 10px 12px;font-size: 26px;margin-top: 0px;margin-bottom: 0px;"> 
        <strong t-field="product.list_price" /> 

        <strong> 
        <t t-esc="product.company_id.currency_id.symbol"/> 
        </strong> 
       </h4> 
       </td> 
       <td style="text-align: center;border-top: 0px solid #fff;padding: 0px 5px 0px 5px;" class="col-xs-7"> 
       <img class="img-responsive" 
        t-att-src="'data:image/png;base64,%s' % res_company.logo" 
        style="background-color: #fff;margin-left: auto;margin-right: auto;width: auto;height: 16px;margin-bottom: 8px;"/> 
       <img class="img-responsive" t-if="product.barcode" 
        t-att-src="'/report/barcode/?type=%s&amp;value=%s&amp;width=%s&amp;height=%s' % ('EAN13', product.barcode, 650, 200)" 
        style="height: 20px;width: 100%;"/> 
       <span style=""> 
        <t t-esc="product.barcode"/> 
       </span> 
       </td> 
      </tr> 
      </tbody> 
     </table> 
     </div> 

    </t> 
    </t> 
</div> 

答えて

1

あなたのケースNGNIXには、プロキシの背後にある問題でした。しかし、私は、以下のステップにそれを修正することができます:

最初のソリューション:

#base_url = irconfig_obj.get_param('report.url') or irconfig_obj.get_param('web.base.url') 
base_url = irconfig_obj.get_param('web.base.url.report') 

1- odoo /アドオン/レポート/モデル/ report.pyファイル内の行番号205の次の行を追加します。

2サーバパラメータweb.base.url.reportを値「http://127.0.0.1:8069」(実行ポート)を追加します。

(デバッグActived付き)設定に移動 - >パラメータ - >システム パラメータ - >

、3-再起動Odooサーバーを作成し、それは動作します。 @CZoellnerへ

/etc/init.d/odoo restart 

UPDATEのおかげ:

@CZoellner推奨作業すぎて、コードには何も変更しないでください:

第二の溶液(推奨):

1 - サーバーパラメータurl.reportを値 "http://127.0.0.1:8069"(実行ポート)で追加または更新します。

(デバッグActived付き)設定に移動 - >パラメータ - >システム パラメータ - >

2 - 再起動Odooサーバーを作成し、それは動作します。

/etc/init.d/odoo restart 

参考:パラメータを追加するhttps://github.com/odoo/odoo/issues/1105

+0

'report.url'は十分ではありませんか?私はこのパラメータを追加することなく問題なく、nginxでいくつかのOdooインスタンスを設定しました。コードを変更する必要はありません。 – CZoellner

+0

sgin(https)でnginxをお持ちですか?私の問題は製品ラベルを生成することだけでした。私は 'report.url'だけを変更しようとします。あなたのお返事に感謝@CZoellner。 –

関連する問題