相关源码如下

    COMPANY_KEY = "self.env.context.get('force_company') or self.env['res.company']._company_default_get(model).id"

我们写代码时需要做的就是将force_company这个上下文的值传入,

self.with_context(force_company=2).env['model'].search(...)

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-16
  • 2021-08-02
  • 2021-10-28
  • 2022-12-23
  • 2021-06-15
猜你喜欢
  • 2021-10-16
  • 2021-10-16
  • 2021-05-03
  • 2021-08-03
  • 2022-01-28
  • 2021-08-22
  • 2021-10-12
相关资源
相似解决方案