Ir al contenido
Menú
Se marcó esta pregunta
9138 Vistas

In odoo, I needed an update trigger, which  would not let any  user to update inserted data. I used following trigger function for rejecting update. The functio and trigger did work  but it gives error TypeError: unsupported operand type(s) for /: 'NoneType' and 'float'. How  can I resolve this ?

Function:

create function check_id_change() returns trigger language plpgsql as $account_invoice$

begin

if (TG_OP='UPDATE') THEN

    RAISE NOTICE 'CANNOT EDIT RECORDS';

    RETURN OLD;

END IF;

    RETURN NULL;

END;

$account_invoice$;


Trigger:

create trigger check_update_trigger

before update on account_invoice

for each row

execute procedure check_id_change();


Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
nov 23
1449
0
sept 18
2670
2
jul 24
9482
1
dic 23
8206
1
mar 22
13487