Skip to Content
Menu
This question has been flagged
1248 Views

Hello I am working on a project with version 8 of odoo.

but I have a problem. I want to change the value of a field1 field when another field2 field will pass to true.

The field1 field will take the value of fields3 which is in a table that field2 and different from table of field1.

My code refreshes the page, but I want to change the values without updating the page and at the same time changing the value of field1 in this table.

here is my code


def reload_page(selfcruidasset_idcontext=None):
        return {
            'type''ir.actions.client',
            'tag''reload',
        }
def create_move(selfcruididscontext=None):
    asset_obj = self.pool.get('table_field1')
    for asset in asset_obj.browse(
                cruidlist(set(asset_ids)), context=context):
            asset.write({'valeur_amortie'amortissement'vnc' : vnc})
            if len(ids) == 1 and context.get('create_move_from_button'):
                return self.reload_page(cruidasset.id, context)
            cr.execute('UPDATE immobilisation SET valeur_amortie= valeur_amortie +  , vnc = %s WHERE id= %s', (valeur_amortie, vnc_immo, asset.id, ))
Avatar
Discard
Related Posts Replies Views Activity
1
Jun 19
2006
0
Jun 19
1799
0
Mar 15
2345
2
Jan 24
890
2
Mar 15
4989