Hello, I am trying to pass in the field values of a form into a custom method when a user clicks on a button. The method is supposed to process the information entered in the form, but not necessarily to create a new record on some model. So far the only method that accepts the field values of a form is the create() method, which uses the vals{}. Is there a way to pass in the field values to a custom method/function other than create?
This question has been flagged
1
Reply
10483
Views
You can pass the field values in the custom method/function using browse method,
Example:-
def method_name(self, cr, uid, ids, context=None):
if context is None:
context = {}
values={}
for val in self.browse(cr, uid, ids, context=context):
values['field1'] = val.column1
values['field2'] = val.column2
values['field3'] = val.column3
return values
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up| Related Posts | Replies | Views | Activity | |
|---|---|---|---|---|
|
|
1
Jan 19
|
12855 | ||
|
|
1
Oct 17
|
5189 | ||
|
|
0
Sep 17
|
5665 | ||
|
How to access the vals dict.
Solved
|
|
4
Sep 15
|
8776 | |
|
|
2
Apr 15
|
6946 |