2017-03-23 3 views
0

제품 라벨을 PDF로 생성하려고하는데 생성되었지만 제품 바코드가 없습니다.Odoo v10에서 PDF 보고서 생성시 바코드가 누락되었습니다.

하지만 Qweb과 동일한 제품 라벨을 HTML로 생성하므로 정상적으로 작동합니다.

이동 제품 선택이 :

enter image description here

생성 된 제품 라벨 등 : 제품 라벨 HTML과 같은 (일 파인) 생성

enter image description here

PDF (바코드 없음) :

enter image description here

이 내 Qweb을이다 : 당신이 당신의 경우 NGNIX에, 프록시 뒤에있는 경우

<?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

그것은 문제였다.

최초의 솔루션 : :하지만이 단계에 따라 문제를 해결할 수

1 odoo/애드온/보고서/모델/report.py 파일의 줄 번호 내부에 다음 줄을 추가 (205) :

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

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에게 감사드립니다. –