+1 vote
9 views

I'm creating a custom packing list in odoo using odoo studio.

When I create a table with all the products there should be a few colums such as: #products, #products in a carton, #cartons.

I can simply add #products and #products in a carton using the standard fields with this code:

<xpath expr="/t/t/t/div/table/tbody/tr/td[6]" position="after">
    <td>
      <span t-field="table_line.product_qty"/>
    </td>
  </xpath>

or using "table_line.product_packaging.qty" in the t-field.

So I want to create a new field with the amount of packages by dividing #product by #products in carton. How could I do this, I searched and tried using:

<xpath expr="/t/t/t/div/table/tbody/tr/td[7]" position="after">
    <td>
      <span t-esc="table_line.product_qty/table_line.product_packaging.qty"/>
    </td>
  </xpath>

But this doesn't work.

in Back-end by (10k points) | 9 views

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
173 questions
146 answers
30 comments
11,977 users