2017-01-18 8 views
0

У меня есть следующий шаблон Qweb:Перевод не загружен на odoo 10 предприятий

СЧЕТА

<div class="col-xs-12" style="font-family: Calibri Bold"> 
    </div> 
    <br></br> 
    <div class="col-xs-12"> 
     <div class="col-xs-5" style="height: 130px; border: 2px solid; padding: 10px 10px;font-family: Calibri"> 
      <div t-field="company.name"/> 
      <div t-field="company.street"/> 
      <div t-field="company.street2"/> 
      <div>VAT :<span style="color:white">.</span><span t-field="company.vat"/> 
      </div> 
     </div> 
     <div class="col-xs-offset-7 text-center" style="height: 130px; border: 2px solid; padding: 10px 10px;font-family: Calibri"> 
      <address t-field="o.partner_id" 
        t-field-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}' /> 
     </div> 
    </div> 
    <div class="col-xs-12" style=" height: 68px; margin-top:20px; margin-bottom: 25px;"> 
     <div class="col-xs-5" style="border: 2px solid; padding: 10px 10px; margin-bottom: 25px; font-family: Calibri"> 
      <div style="max-height:20px;"> 
      <h2 t-if="o.number" style="font-size:inherit;"> 
       Invoice Number :<span style="color:white">.</span> 
       <span t-field="o.number"/> 
      </h2> 
      </div> 
      <div t-if="o.date_invoice"> 
       Invoice Date :<span style="color:white">.</span> 
       <span t-field="o.date_invoice"/> 
      </div> 
     </div> 
     <div class="col-xs-offset-7 text-center col-xs-5" style="border: 2px solid; margin-top: -69px; margin-bottom: 25px; padding: 10px 10px;font-family: Calibri"> 
      <div t-if="o.partner_id.vat"> 
       VAT Number :<span style="color:white">.</span> 
       <span t-field="o.company_id.vat"/> 
      </div> 
     </div> 
    </div> 
    <br></br> 
    <div class="col-xs-12" style="font-family: Calibri Bold"> 
    </div> 
<div class="col-xs-12"> 
    <table class="table table-condensed"> 
     <thead> 
      <tr style="border: 2px solid; border-left: 2px solid; border-right: 2px solid; font-family: Calibri Bold;"> 
       <th style="border: 2px solid;">Description</th> 
       <th style="border: 2px solid;" class="text-center">Quantity</th> 
       <th style="border: 2px solid;" class="text-center">Unit Price</th> 
       <th style="border: 2px solid;" class="text-center">Discount</th> 
       <th style="border: 2px solid;" class="text-center">Amount</th> 
      </tr> 
     </thead> 
     <tbody style="border: 2px solid;font-family: Calibri" class="invoice_tbody"> 
      <tr t-foreach="o.invoice_line_ids" t-as="l"> 
       <td style="border-left: 2px solid;"> 
        <span t-field="l.name"/> 
       </td> 
       <td style="border-left: 2px solid;" class="text-center"> 
        <span t-field="l.quantity"/> 
       </td> 
       <td class="text-center" style="border-left: 2px solid;"> 
        <span t-field="l.price_unit"/> 
        <span t-field="l.uom_id" groups="product.group_uom"/> 
       </td> 
       <td class="text-center" style="border-left: 2px solid;"> 
       </td> 
       <td class="text-center" style="border-left: 2px solid; border-right: 2px solid"> 
        <span t-field="l.price_subtotal" 
         t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> 
       </td> 
      </tr> 
     </tbody> 
    </table> 
<div> 
    <div class="col-xs-13" t-if="o.payment_term_id"> 
     <div class="col-xs-6"> 
      <table class="table table-condensed"> 
       <thead> 
        <tr style="font-family: Calibri Bold;"> 
         <th>Payment Terms</th> 
         <th>Date</th> 
         <th class="text-right">Amount</th> 
        </tr> 
       </thead> 
       <tbody> 
        <tr style="font-family: Calibri"> 
         <td><span t-field="o.payment_term_id"/></td> 
         <td> 
          <span t-field="o.date_due"/> 
         </td> 
         <td class="text-right"> 
          <span t-field="o.discount_price"/> 
         </td> 
        </tr> 
       </tbody> 
      </table> 
     </div> 
    </div> 
</div> 
<div class="col-xs-offset-7"> 
    <table class="table table-condensed"> 
     <tr style="border: 2px solid;font-family: Calibri"> 
      <td class="text-right" style="border: 2px solid; border-left: 2px solid; border-right: 2px solid;"><span>Subtotal</span></td> 
      <td class="text-right" style="border: 2px solid; border-left: 2px solid; border-right: 2px solid;"> 
       <span t-field="o.amount_untaxed" t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> 
      </td> 
     </tr> 
     <tr style="font-family: Calibri"> 
      <td class="text-right" style="border: 2px solid; border-left: 2px solid; border-right: 2px solid;"><span>Discount</span></td> 
      <td class="text-right" style="border: 2px solid; border-left: 2px solid; border-right: 2px solid;"> 
      </td> 
     </tr> 
     <tr style="font-family: Calibri"> 
      <td class="text-right" style="border: 2px solid; border-left: 2px solid; border-right: 2px solid;"><span>VAT</span></td> 
      <td class="text-right" style="border: 2px solid; border-left: 2px solid; border-right: 2px solid;"> 
       <span t-field="o.amount_tax" t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> 
      </td> 
     </tr> 
     <tr style="font-family: Calibri"> 
      <td class="text-right" style="border: 2px solid; border-left: 2px solid; border-right: 2px solid;"><span>Amount</span></td> 
      <td class="text-right" style="border: 2px solid; border-left: 2px solid; border-right: 2px solid;"> 
       <span t-field="o.amount_total" t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> 
      </td> 
     </tr> 
     <tr style="font-family: Calibri"> 
      <td class="text-right" style="border: 0px solid; border-left: 0px solid; border-right: 0px solid; font-family: Calibri Bold;"></td> 
      <td class="text-right" style="border: 0px solid; border-left: 0px solid; border-right: 0px solid; font-family: Calibri Bold;"></td> 
     </tr> 
     <tr style="font-family: Calibri"> 
      <td class="text-right" style="border: 4px solid; border-left: 4px solid; border-right: 4px solid; font-family: Calibri Bold;"><span>Total</span></td> 
      <td class="text-right" style="border: 4px solid; border-left: 4px solid; border-right: 4px solid; font-family: Calibri Bold;"> 
       <span t-field="o.amount_total" t-field-options='{"widget": "monetary", "display_currency": "o.currency_id"}'/> 
      </td> 
     </tr> 
    </table> 
</div> 

</div> 

</div> 
<div class="footer" style="border-top:2px solid"> 
    <div class="col-xs-12 text-center"> 
     <table class="col-xs-12 text-center"> 
      <tr style="height: 34px;font-family: Calibri"> 
       <td> 


       </div> 
       </td> 
      </tr> 
     </table> 
    </div> 
</div> 

Я также настроить некоторые переводы для голландского языка путем создания файла my_module/i18n/nl.po Th е содержимое файла является:

#. module: custom 
#: view:website:account.report_invoice_document 
msgid "Telephone" 
msgstr "Telefoon" 

#. module: custom 
#: view:website:account.report_invoice_document 
msgid "Invoice Number" 
msgstr "Factuurnummer" 

#. module: custom 
#: view:website:account.report_invoice_document 
msgid "Invoice Date :" 
msgstr "Factuurdatum : " 

#. module: custom 
#: view:website:account.report_invoice_document 
msgid "INVOICE" 
msgstr "FACTUUR" 

#. module: custom 
#: view:website:account.report_invoice_document 
msgid "Invoice Number" 
msgstr "Factuur nummer" 

#. module: custom 
#: view:website:account.report_invoice_document 
msgid "VAT" 
msgstr "BTW" 

#. module: custom 
#: view:website:account.report_invoice_document 
msgid "Discount" 
msgstr "Korting" 

#. module: custom 
#: view:website:account.report_invoice_document 
msgid "Refund" 
msgstr "Creditnota" 

В то время как я могу видеть из журналов, что этот файл загружается и переводы загружены, они не отображаются в отчете.

Когда я иду в Настройки -> Переводы -> Переведенные условия Я могу видеть, что мои термины были переведены правильно. Но они не отображаются в отчете. В отчете есть attachment_use="False"

ответ

0

мне удалось решить эту проблему, углубляясь немного глубже во всей функциональности перевода, я опишу процесс здесь, чтобы решить эту проблему для дальнейшего использования:

Я напишу причины, почему эти переводы были не загружается здесь для справок:

1) Прежде всего, переводы, записанные в файле ро должен соответствовать именно те, в шаблоне Qweb. Строки в шаблоне qweb не должны содержать другие теги, например: Номер НДС:.

Строка «Номер НДС:» здесь не может быть переведена из-за элемента диапазона . Если вы предоставили перевод для номера НДС: должны также включать весь элемент span.

2) Удалить уже существующие переводы для вашей строки, потому что они не будут перезаписаны. (Включить режим отладки -> Настройки -> Переводы -> Переведено Условия)

3) Загрузите новые переводы, перейдя в (Активировать режим отладки -> Настройки -> Переводы -> Синхронизировать Условия)

4) Необязательно: если у нас есть отчет, убедитесь, что вы сняли флажок Reload from Attachment, чтобы старый отчет не загружался при тестировании.

0

Настоящий рабочий документ представлен в модуле website. Они имеют этот шаблон:

<template id="show_sign_in" customize_show="True" inherit_id="website.layout" name="Show Sign In"> 
    <xpath expr="//ul[@id='top_menu']" position="inside"> 
     <li class="divider" groups="base.group_public"/> 
     <li groups="base.group_public"> 
      <a t-attf-href="/web/login"> 
       <b>Sign in</b> 
      </a> 
     </li> 
    </xpath> 
</template> 

Это как переводится:

#. module: website 
#: model:ir.ui.view,arch_db:website.show_sign_in 
msgid "<b>Sign in</b>" 
msgstr "<b>Aanmelden</b>" 

Добрый день.

 Смежные вопросы

  • Нет связанных вопросов^_^