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

Error ValueError: Wrong value for inward.item_category: in one2many field

By
Anas Ali
on 8/20/15, 2:44 PM 767 views

ValueError: Wrong value for inward.item_category: {u'time_in': False, u'vehicle_type': False, u'lc': False, u'vehicle': False, u'invoice_ref': False, u'bilty': False, u'date': False, u'gin': False, u'time_out': False, u'document_type': False, u'id': False, u'supplier_details': False}

.py file


class inwardpass(models.Model):

_name='inwardpass'

date = fields.Date('Date', required=True)

document_type = fields.Boolean('LC or PO')

invoice_ref = fields.Char('Invoice Ref #')

gin = fields.Char('GIN #')

lc = fields.Char('LC Ref.#/PO #')

bilty = fields.Char('Bilty ')

time_out = fields.Date('Time Out', required=True)

vehicle = fields.Char('Vehicle')

time_in = fields.Date('Time In', required=True)

vehicle_type = fields.Char('Vehicle Type')

supplier_details= fields.Char('Supplier Details')

Details = fields.One2many('inward','item_category',ondelete='cascade')

class inward(models.Model):

_name = 'inward'

item_category = fields.One2many('inwardpass','Details','Item Category')

uom = fields.Char('UOM')

qty = fields.Char('QTY')

item = fields.Char('Item Category')


XML file


<notebook position="after">

<page string="Details">

<group col="4" colspan="4" string="General">

<field name="Details"  >

<tree>

<field name="item" placeholder="Item Category" />

<field name="uom" placeholder="UMO"/>

<field name="qty" placeholder="Quantity"/>

</tree>

</field>

</group>

</page>

</notebook>


0

Ahmed M.Elmubarak

--Ahmed M.Elmubarak--
2988
| 5 3 5
Sudan
--Ahmed M.Elmubarak--


Ahmed M.Elmubarak
On 8/23/15, 10:04 AM

Hello,

In one2many field you should have a many2one field as inverse name in the related model. which you haven't,

your two fields with types One2many, kindly check this link for more details


Regards,

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/20/15, 2:44 PM
Seen: 767 times
Last updated: 8/23/15, 10:04 AM