odoo 使用协程,异步,gevent,打补丁
打补丁得时候需要在方法中实现,如果直接在外部调用猴子补丁,在odoo服务启动时,就会出现锁异常,会出现死锁,
错误的示范:
from odoo import api, fields, models from dateutil.relativedelta import relativedelta from ..controllers.cls_get_trans_info import SpiderTrans from odoo import exceptions import gevent import logging from gevent import monkey monkey.patch_all() # 这是一个错误的示例 class ClassName(models.Model): _name = 'model.name' ...
正确的示范:
from odoo import api, fields, models from dateutil.relativedelta import relativedelta from ..controllers.cls_get_trans_info import SpiderTrans from odoo import exceptions import gevent import logging from gevent import monkey monkey.patch_all() # 这是一个错误的示例 class ClassName(models.Model): _name = 'model.name field_name= fields.Char() def func(self): monkey.patch_all() #猴子补丁需要在该位置调用
相关推荐
efeve 2020-09-14
jacktangj 2020-04-17
wyqwilliam 2020-02-10
zuiaiqun 2020-01-23
shengge0 2019-12-26
hamutailang 2019-11-03
wklken的笔记 2019-11-01
georgeandgeorge 2019-10-31
dashoumeixi 2020-07-20
SDUTACM 2020-05-03
dashoumeixi 2019-12-22
zuiaiqun 2019-12-12
chunjiekid 2019-07-01
talkincode 2019-06-30
solarLan 2019-06-28
mayflowers 2019-06-28