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

TypeError: cannot convert dictionary update sequence element #0 to a sequence

By
Jithin
on 9/5/16, 7:11 AM 273 views

@api.model

def action_purchase_order(self):

    rec= self.env['purchase.order'].create({

        'partner_id' : self.vendors.id,

        'store_id' : self.store_id.id,

        'purchase_order_type' : self.order_type.id,

        'date_order' : self.date_order.id,

        'product_id' : self.product_id.id,

        'date_planned' : self.date_order.id,

        'product_qty' : self.name.id,

        'brand_id' : self.brand_id.id,

        'product_id' : self.product_id.id,

        'part_number': self.part_number.id,

        'date_planned' : self.date_order.id,

        'product_qty' : self.quantity_no.id,

    })

    return rec




pls identify the mistake!!!!!

2
ayman mohammed adam
On 9/6/16, 5:57 AM

dear jithin

I think you must replace @api.model to @api.one


I hope I helped you ...

thanks ayman i got the answer.

@api.model to @api.multi

Jithin
on 9/6/16, 6:25 AM

ok

ayman mohammed adam
on 9/6/16, 7:58 AM
1
Divyang Jariwala
On 10/27/16, 1:07 AM

Hello Jithin

Simplification for you doubt.

@api.model is used when you don't have a record set (ID of record) in self.
@api.multi or @api.one is used when you have a record set with self.

I Hope now you are clear with this. :) 

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: 9/5/16, 7:11 AM
Seen: 273 times
Last updated: 11/11/16, 5:28 AM