Odoo Help

0

1
2 الإجابات
1
mike الولايات المتّحدة
24‏/4‏/2013 5:47 م

Fixed! This...

def app_approve(self, cr, uid, ids, context={}):

Should have been this...

def app_approve(self, cr, uid, ids, vals, context):

It was an impedance mismatch because either vals was missing or I had multiple values for context (or both). I needed to pass self through the wrapper and not return the wrapper as self because at the end of it all I was attempting self.write anyway.

Also, I had an unrelated mistake in original code for _transaction_history instead of passing vals to the create method pass vals.copy() to prevent resetting values in vals with values for self.

0
الصورة الرمزية

Francesco OpenCode ايطاليا

--Francesco OpenCode--

3909
| 7 8 11
Grottaglie, ايطاليا
--Francesco OpenCode--

Italian Odoo (OpenERP) Modules Developer LINKEDIN: http://www.linkedin.com/in/francescoapruzzese

Francesco OpenCode ايطاليا
24‏/4‏/2013 4:41 م

Self has write but cr not, if you call this function

return func(cr, uid, ids, vals, context)

you obtain an error becase the firts parameter (cr) must be self

return self.func(cr, uid, ids, vals, context)
1 تعليق
mike الولايات المتّحدة
24‏/4‏/2013 4:51 م

but then it complains: line 345 in wrapped return func(self, cr, uid, vals, context) TypeError: app_approve() takes at most 5 arguments (6 given). So self is passed anyway and the reason I didn't call with it before. This is normal from wrapped functions? Seems like it shouldn't be...

اطرح سؤالاً
Writer
441
mike
الوسوم
Keep Informed
0 متابعين
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