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.

0

want to show the PICKING.NAME field in view stock.partial.picking.form

By
Tilfried Weissenberger
on 8/7/14, 5:54 AM 1,056 views

Hi,

I want to show the name field in the view stock.partial.picking.form. But since I must traverse upward the relations from partial picking > move > picking, I have not figured out how the XML must look like.

<form string="Stock partial Picking" version="7.0">
...
<field name="move_ids" context="{'hide_tracking': hide_tracking}">
    <tree editable="bottom" string="Product Moves">
            <field name="product_id" on_change="onchange_product_id(product_id)"/>
            <field name="name"/> <!-- doesnt exist, error -->

<form string="Stock partial Picking" version="7.0">
...
<field name="move_ids" context="{'hide_tracking': hide_tracking}">
    <tree editable="bottom" string="Product Moves">
            <field name="product_id" on_change="onchange_product_id(product_id)"/>
            <field name="move_id.picking_id.name"/> <!-- syntax error? -->

<form string="Stock partial Picking" version="7.0">
...
<field name="move_ids" context="{'hide_tracking': hide_tracking}">
    <tree editable="bottom" string="Product Moves">
            <field name="product_id" on_change="onchange_product_id(product_id)"/>
            <!-- no error, but also not shown (instead the move is shown) -->
            <field name="move_id">
                <form>
                    <field name="picking_id">
                        <form>
                            <field name="name"/>
                        </form>
                    </field>
                </form>
            </field>

anyone?

Tilfried Weissenberger
on 10/2/14, 7:26 AM
1

Ludo - Neobis

--Ludo - Neobis--
2387
| 2 2 5
Hoogvliet, Netherlands
--Ludo - Neobis--

Developer

Ludo - Neobis
On 10/2/14, 8:06 AM

Field name can only be the exact name of the field in your python code. The field on your python script in this is is propably a related field. If it does not yet exist you should create it first.

Then you can reference this field using the field name tag like so:

<field name="my_related_field_name" />

This should show you the field. 

Look in the existing code to find the code in order to create a related field.

ah, I understand, thank you! I will try that. should I modify this extension directly or should I create my own? (is there a kickstart/tutorial in that case, that you can point me to)?

Tilfried Weissenberger
on 10/3/14, 8:16 AM

You should create your own (small) module for this. Looking at previously made code is always the best thing I presume. Otherwise, you can always go to https://doc.odoo.com/trunk/server/ for a quick start on creating modules. When browsing existing code, look for fields.related and see how that is done. If you have any more questions, just ask.

Ludo - Neobis
on 10/3/14, 8:28 AM

great, thanks for your kickstart!

Tilfried Weissenberger
on 10/3/14, 9:00 AM

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

1 follower(s)

Stats

Asked: 8/7/14, 5:54 AM
Seen: 1056 times
Last updated: 3/16/15, 8:10 AM