Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
969 Visualizzazioni

Hi community,

on a report which we are using to create labels I want to create a barcode which combines 2 information – the material ID and the quantity that is moved. (GS1 code standard)

The material ID alone I already have:

<span t-field="o.product_id.barcode" t-options="{'widget': 'barcode', 'symbology': 'auto', 'img_style': 'width:80mm;height:20mm'}">product barcode</span>

And the qty is already shown as text on the label:

<span t-out="str(o.quantity).replace('.', ',')"/>

 

But now, I want to combine both into 1 text string and then create the barcode for that.

Unfortunately, I'm not so experienced in html and don't know how to do it.

In Excel formular it would look something like (maybe that helps in understanding):

​ New textstring = “01”&o.product_id.barcode&”#37”&o.quantity

 

Hope my request is actually quite easy, if you have the experience and that one of you does have it ;)

Below the whole code if needed.

 

BR

  Alexander

 

 

<data>

  <xpath expr="/t[@t-name='xx_location_picker.report_location_label_pallet_full_page_copy_3']" position="replace" mode="inner">

    <t t-call="web.html_container" t-lang="en_US">

      <t t-foreach="docs" t-as="picking">

        <t t-set="move_lines" t-value="picking.move_line_ids.filtered(lambda ml: ml.product_id.xx_use_location_picking)"/>

        <t t-foreach="move_lines" t-as="o">

          <div class="article o_report_layout_standard">

            <div class="page">

              <div class="row mb-2">

                <div class="col-8">

                  <span t-field="o.product_id.barcode" t-options="{'widget': 'barcode', 'symbology': 'auto', 'img_style': 'width:80mm;height:20mm'}">product barcode</span>

                  <div class="col-12" style="text-align: left;font-size: 12px">product</div>

                  <br/>

                </div>

                <div class="col-4">

                  <div t-out="o.product_packaging_id.barcode" style="padding:1px;" t-options="{'widget': 'barcode', 'symbology': 'auto', 'img_style': 'width:80mm;height:20mm'}"/>

                  <div class="col-12" style="text-align: right;font-size: 12px">packaging_quantity</div>

                </div>

              </div>

              <div class="row mt-5" style="border: 2px solid black;height: 10em;">

                <h1 style="text-align: center;padding: 25px 0;font-size: 80px">

                  <strong>

                    <t t-out="o.location_dest_id.name"/>

                  </strong>

                </h1>

              </div>

              <div class="row" style="margin-top: 5px">

                <div class="col-6" style="border: 2px solid black;">

                  <h2>

                    <strong>

                      <t t-out="o.product_id.default_code"/>

                    </strong>

                  </h2>

                </div>

                <div class="col-2" style="text-align: center;">

                  <br/>

                </div>

                <div class="col-4" style="text-align: right;border: 2px solid black;">

                  <h2>

                    <strong>

                      <span t-out="str(o.quantity).replace('.', ',')"/>

                      <span t-field="o.product_uom_id"/>

                    </strong>

                  </h2>

                </div>

              </div>

              <div class="row" style="margin-top: 5px">

                <div class="col-12" style="border: 2px solid black;">

                  <h2>

                    <strong>

                      <t t-out="o.product_id.name"/>

                    </strong>

                  </h2>

                </div>

              </div>

              <div class="row" style="margin-top: 5px">

                <div class="col-12" style="text-align: right">

                  <h2>

                    <strong>

                      <span t-out="picking._get_validation_date_formatted()"/>

                    </strong>

                  </h2>

                </div>

              </div>

              <div class="row" style="margin-top: 5px">

                <div class="col-12" style="text-align: center">

                  <h2>

                    <strong>

                      <t t-out="o.location_dest_id.barcode" t-options="{'widget': 'barcode', 'symbology': 'auto', 'img_style': 'width:80mm;height:20mm'}"/>

                    </strong>

                    <div class="col-12" style="text-align: center;font-size: 12px">location</div>

                  </h2>

                </div>

              </div>

            </div>

          </div>

        </t>

      </t>

    </t>

  </xpath>

</data>

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
lug 25
1153
1
mag 24
1819
2
apr 24
1795
2
feb 24
1155
1
mag 24
2708