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

Can't save with the save button

By
Aijay Ogbugha
on 6/26/13, 6:19 AM 1,481 views

I created a form to get data for a store voucher. But on clicking the "save" button, it gives me this error:

except_osv: (u'ValidateError', u'The value "in" for the field "product_template.type" is not in the selection')

I don't know where to look. Please can someone help me with this. Any help will be appreciated Thank you

My view code:

<record id="store_issuing_voucher_form" model="ir.ui.view">
        <field name="name">store.issuing.voucher.form</field>
        <field name="model">store.issuing.voucher</field>
        <field name="arch" type="xml">
            <form string="Store Issuing Voucher" version="7.0"><sheet string="Store Issuing Voucher">


                        <group string="Requestor Details" col="4">
                            <field name="employee_id" on_change="onchange_employee_id(employee_id,department_id)" />
                            <field name="department_id"/>
                            <field name="date" />
                            <field name="organizational_id"  />
                            <field name="fund_code"  />
                            <field name="program_code"  />
                            <field name="location_code"  />
                            <field name="manager_id" />                                 
                        </group>
                    <group string="Product Item Details">

                        <notebook>
                    <page string="Store Products Lines">
                        <field name= "mystore_product_ids" />
                        <field name="note" placeholder="Add any note..." class="oe_inline" />
                    </page>

                        </notebook> 
                    </group>                        
                </sheet>
                <div class="oe_chatter">
                    <field name="message_follower_ids" widget="mail_followers"/>
                    <field name="message_ids" widget="mail_thread"/>
                </div>
            </form>
        </field>
    </record>
    <!-- End of Store Issuing Voucher Form View -->

     <!-- Store Issuing Voucher tree View -->


    <record id="store_issuing_voucher_tree" model="ir.ui.view">
        <field name="name">store.issuing.voucher.tree</field>
        <field name="model">store.issuing.voucher</field>
        <field name="type">tree</field>
        <field name="arch" type="xml">
            <tree string="Vouchers" >

                <field name="product_id"/> 
                <field name="employee_id"/>
                <field name="department_id" />
                <field name="organizational_id"/>
                <field name="program_code"/>
                <field name="value"/>
                <field name="date"/>

            </tree>
        </field>
    </record>

    <record id="store_issuing_voucher_form" model="ir.ui.view">
        <field name="name">store.issuing.voucher.form</field>
        <field name="model">store.issuing.voucher</field>
        <field name="arch" type="xml">
            <form string="Store Issuing Voucher" version="7.0">
                <sheet string="Store Issuing Voucher">
                    <group string="Requestor Details" col="4">
                        <field name="employee_id" on_change="onchange_employee_id(employee_id,department_id)" />
                        <field name="department_id"/>
                        <field name="date" />
                        <field name="organizational_id" />
                   </group>
                </sheet>
            </form>
        </field>
</record>

Post your view code, please.

Francesco OpenCode
on 6/26/13, 6:21 AM
0

patrick

--patrick--
1958
| 5 4 7
Baarn, Netherlands
--patrick--
patrick
On 6/26/13, 7:32 AM

Given your message

The value "in" for the field "product_template.type" is not in the selection'

it loks like there is one (or more) products which have the type 'in' instead of 'product' or 'service'.

In the code you posted I do not seen any reference to product_template. Have you installed additional modules (either from internet or own made)?

Thank you for your response Patrick. Am also surprised because i didn't make any reference to product_template.I only inherited product.product model. And I didn't install any additional modules at all. could the product.product model be the problem. somebody help please. Thank you

Aijay Ogbugha
on 6/26/13, 8:28 AM

Each product.product has a product.template. So implicitly you do something with product.template.... Anyway, did you import (or code) something into type, with the content 'in' (which is the reason for the error message).

patrick
on 6/26/13, 9:57 AM

No Patrick.I didn't code anything about type not to talk of 'in' content. That's why I'm surprised by this error. Are you saying I should dis-inherit the product.product model?? Thank you for your replies

Aijay Ogbugha
on 6/26/13, 11:02 AM

Can you post the py code? That would be helpful.

GH Mediacloud, Grover Menacho
on 7/9/13, 11:59 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: 6/26/13, 6:19 AM
Seen: 1481 times
Last updated: 3/16/15, 8:10 AM