跳至內容
選單
此問題已被標幟
1987 瀏覽次數

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, ))
頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
6月 19
2503
0
6月 19
2495
0
3月 15
3063
2
1月 24
1557
2
3月 15
5787