Skip to Content
Menu
This question has been flagged
8444 Views

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
Discard
Related Posts Replies Views Activity
1
Nov 23
846
0
Sep 18
2228
2
Jul 24
8852
1
Dec 23
7568
1
Mar 22
12689