تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1253 أدوات العرض
In odoo16 I have dynamically created a few buttons on the formview.
Onclick of the button an rpc call is made:

rpc.query({
model: 'name.of.the.model',
method: 'update_field_from_button',
args: [[],recordId,name],})


below is the function called using rpc:

def update_field_from_button(self, record_id, name):
if record_id and name:
record = self.browse(record_id)
record.write({'name': name})


also for reference, the form view on which the above two code segments are working is called like this:

form = self.env['name.of.the.model'].create({})
return {
'name': "End Task",
'type': 'ir.actions.act_window',
'view_mode': 'form',
'res_model': 'name.of.the.model',
'res_id': form.id,
'target': 'new',
}

P.S.- this is not a transient model, just a "model" although it opens like a wizard via the above return statement.


I have checked the values of the field of that particular record, (via terminal) and it is getting updated there (on click of the button).
But the values don't appear in the form view when this updation takes place.

how do I solve this?

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
2
مايو 24
1686
0
يوليو 15
3981
0
مايو 24
835
0
مايو 24
19
1
فبراير 21
3543