تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
9742 أدوات العرض

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();


الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
نوفمبر 23
2068
0
سبتمبر 18
3133
2
يوليو 24
10088
1
ديسمبر 23
8723
1
مارس 22
13942