Odoo 도움말

0

1
2 응답
1
mike United States
13. 4. 24. 오후 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
Avatar

Francesco OpenCode Italy

--Francesco OpenCode--

3919
| 7 8 11
Grottaglie, Italy
--Francesco OpenCode--

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

Francesco OpenCode Italy
13. 4. 24. 오후 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 United States
13. 4. 24. 오후 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