Odoo Help

0

Purchase order

By
Umashankar Subramani
on 1/20/15, 12:08 AM 767 views

I am working on customizing the purchase module, in which i need to save the content of the purchase order in a newly created table whenever the purchase order is confirmed. I have developed a module in order to save the content to the table using create function but finally i got some errors. Please any one give some idea how to clear this error

This is the code

class inherit_purchase_update(models.Model):
    
    _inherit='purchase.order'
    

    def wkf_confirm_order(self, cr, uid, ids, context=None):
        id1=ids
        recs= self.pool.get('purchase.order.line').browse(cr,uid,id1,context=context)
        recd= self.pool.get('purchase.update').browse(cr,uid,ids,context=context)
        for rec in recs:
            cust_id=rec.partner_id.id
            price_unit= rec.price_unit
            prod_id= rec.product_id.id
            date_order=rec.order_id.date_order
            prod_qty= rec.product_qty
            rec1=recd.create(cr,uid,{'partner_id':cust_id,'date':date_order,'product_id':prod_id,'price_unit':price_unit,'product_qty':prod_qty})

ValueError: "create() takes exactly 2 arguments (4 given)" while evaluating u'wkf_confirm_order()'

 

plz purchase it immediatly

Abin C I
on 1/20/15, 12:12 AM

I got every values but the problem is while inserting into the tables

Umashankar Subramani
on 1/20/15, 12:21 AM
1

Try the following:

recd=self.pool.get('purchase.update')

for rec in recs:
            cust_id=rec.partner_id.id
            price_unit= rec.price_unit
            prod_id= rec.product_id.id
            date_order=rec.order_id.date_order
            prod_qty= rec.product_qty
            rec1=recd.create(cr,uid,                        
                {'partner_id':cust_id,'date':date_order,'product_id':prod_id,'price_unit':price_unit
                ,'product_qty':prod_qty})

Thanks Emipro Technologies Pvt. Ltd i got it , can u help me in learning odoo i am new to this field

Umashankar Subramani
on 1/20/15, 12:42 AM

Practically, we can help solving your problems via this forum, otherwise it is somewhat difficult to manage other communications, but we will try our best to help you out. Hope you understand. Thank you.

Emipro Technologies Pvt. Ltd.
on 1/20/15, 12:49 AM

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 1/20/15, 12:08 AM
Seen: 767 times
Last updated: 3/16/15, 8:10 AM