Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

4

How to read wizard data from .xsl file?

By
Anas Taji
on 5/12/13, 2:55 PM 1,724 views

I'm trying to let the user choose the barcode encoding type by popping a wizard before printing the "Product Label", so I can read the chosen encoding from that wizard in product_label.xls

<barCode code="XXXX"><xsl:value-of select="ean13" /></barCode>

Is is possible to write something instead of "XXXX" that reads wizard data?

In the reports we used to write something like [[ data['form']['XXXX'] ]], but how to do it in .xsl?

4

Anas Taji

--Anas Taji--
2203
| 6 7 8
Amman, Jordan
--Anas Taji--

Skype: anas.taji-sw

Email: anas.taji@smartway-jo.com

Anas Taji
On 5/13/13, 12:43 AM

I managed my way and found the solution, and I would like to share it.. :)

I added new function field to product.product object, and inside this function I have read the wizard table and return a proper result.

Then, I added the new field name in product_label.xml, then I were able to read the field value from product_label.xsl by the following code:

<xsl:variable name="temp_var"><xsl:value-of select="field_from_wizard"/></xsl:variable>
<xsl:if test="$temp_var='Code128'">
    <barCode code="Code128"><xsl:value-of select="field2" /></barCode>
</xsl:if>

This maybe not the optimal solution. however, it solved the problem.

Hope it will help someone else..%

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 5/12/13, 2:55 PM
Seen: 1724 times
Last updated: 3/16/15, 8:10 AM