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.

1

TypeError: write() takes at most 6 arguments (8 given) [Closed]

By
priyankahdp
on 4/10/13, 4:52 PM 5,984 views

The Question has been closed

by
priyankahdp
on 04/20/2013 03:19:24
  File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/addons/bpl/bpl.py", line 100, in create
    no_define_object_browse.write(cr, uid, {'current_no': emp_no})
  File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/osv/orm.py", line 374, in function_proxy
    return attr(self._cr, self._uid, [self._id], *args, **kwargs)
TypeError: write() takes at most 6 arguments (8 given)
2013-04-10 18:44:36,733 23633 ERROR demo openerp.netsvc: write() takes at most 6 arguments (8 given)

I tried to override the write function. in that i need to update another model's (bpl.company.define) column also.so i used the write() method.but its give above error & need to sort it. please advice me and explaint which parameters need to pass for the write() method (except cr,uid).

I upload my model class here. & view class here.

Line number 100 in bpl.py

now error is like this

ProgrammingError: operator does not exist: integer = boolean
LINE 1: ...=1,write_date=(now() at time zone 'UTC') where id IN (false)
                                                             ^
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.
3

Mohammad Alhashash

--Mohammad Alhashash--
2075
| 5 5 8
Giza, Egypt
--Mohammad Alhashash--

Developer

Mohammad Alhashash
On 4/10/13, 4:59 PM

Line 100 is incorrect:

no_define_object_browse.write(cr, uid, {'current_no': emp_no})

When you call a method through a browse record, arguments cr, uid, id and context that were used to get the browse object are sent automatically by the proxy method.

Line should be changed to:

no_define_object_browse.write({'current_no': emp_no})

Dear Mohammad,now another error occur. Post edited.

priyankahdp
on 4/11/13, 2:08 AM

!!!! You should create a new question for your new problem.

Mohammad Alhashash
on 4/11/13, 2:12 AM

Thanks it was helpful to me

Mohamed Essakali
on 4/25/13, 9:47 PM

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 4/10/13, 4:52 PM
Seen: 5984 times
Last updated: 3/16/15, 8:10 AM