Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1980 Visualizzazioni

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
giu 19
2503
0
giu 19
2492
0
mar 15
3059
2
gen 24
1556
2
mar 15
5787