This question has been flagged
7 Replies
5974 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>
Avatar
Discard

Post your view code, please.

Best Answer

Before you can save your products/partners after install the account module.

You must configure your chart of accounts.

Avatar
Discard
Best Answer

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)?

Avatar
Discard
Author

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

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).

Author

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

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