建立trigger解决odoo 11 安装应用后web页面为空的问题
-
CREATE OR REPLACE FUNCTION fix_mimetype ( ) RETURNS TRIGGER AS $$ BEGIN IF NEW.mimetype = 'text/plain' AND NEW.datas_fname LIKE '%.js' THEN UPDATE ir_attachment SET mimetype = 'text/javascript' WHERE id = NEW.id; END IF; RETURN NULL; END; $$language plpgsql; CREATE TRIGGER mimetype_changed AFTER INSERT OR UPDATE ON ir_attachment FOR EACH ROW EXECUTE PROCEDURE fix_mimetype();
-
@wenrongjing 感谢分享,帮你把代码用```包了一下
-
@digitalsatori thanks a lot