Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1261 Vizualizări
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?

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
2
mai 24
1686
0
iul. 15
3982
0
mai 24
835
0
mai 24
19
1
feb. 21
3543