跳转至内容
  • 版块
  • 标签
  • 热门
  • 用户
  • 群组
皮肤
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • 默认(Flatly)
  • 不使用皮肤
折叠

Odoo 中文社区

  1. 主页
  2. 版块
  3. Odoo 新手求助
  4. 请问<field name="implied_ids" eval="[(4, ref('group_sale_salesman'))]"/>做何解释?

请问<field name="implied_ids" eval="[(4, ref('group_sale_salesman'))]"/>做何解释?

已定时 已固定 已锁定 已移动 Odoo 新手求助
4 帖子 3 发布者 7.0k 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • Z 离线
    Z 离线
    zopewind
    写于 最后由 编辑
    #1

    在base_security.xml文件中有一行<field name="implied_ids" eval="[(4, ref('group_sale_salesman'))]"/>做何理解,搔破了头皮现在也没找到答案,请求帮助!

    1 条回复 最后回复
    0
    • mrshellyM 离线
      mrshellyM 离线
      mrshelly
      写于 最后由 编辑
      #2

      向对象的 implied_ids 添加一个 group_sale_salesman 组...

      1 条回复 最后回复
      0
      • wjfonhandW 离线
        wjfonhandW 离线
        wjfonhand
        写于 最后由 编辑
        #3

        create

        根据给定值创建记录 (cr, user, vals, context=None) 参数:

            * cr —— 数据库游标
            * user —— 当前用户id
            * vals —— 字段:值的字典

        关系型字段的值用如下方式表示
        * many2many 字段 : [(6, 0, list of ids)] (example: [(6, 0, [8, 5, 6, 4])])
        * one2many 字段 : [(0, 0, dictionary of values)] (example: [(0, 0, {‘field_name’:field_value, ...})])
        * many2one 字段 : 关联记录的ID
        * reference 字段 : model name, id (例: ‘product.product, 5’)

        many2many 字段 :

                        (0, 0,  { values })    link to a new record that needs to be created with the given values dictionary
                        (1, ID, { values })    update the linked record with id = ID (write values on it)
                        (2, ID)                remove and delete the linked record with id = ID (calls unlink on ID, that will delete the object completely, and the link to it as well)
                        (3, ID)                cut the link to the linked record with id = ID (delete the relationship between the two objects but does not delete the target object itself)
        [size=24pt][color=red]                (4, ID)                link to existing record with id = ID (adds a relationship)[/color][/size]
                        (5)                    unlink all (like using (3,ID) for all linked records)
                        (6, 0, [IDs])          replace the list of linked IDs (like using (5) then (4,ID) for each ID in the list of IDs)


        one2many 字段:

                        (0, 0,  { values })    link to a new record that needs to be created with the given values dictionary
                        (1, ID, { values })    update the linked record with id = ID (write values on it)
                        (2, ID)                remove and delete the linked record with id = ID (calls unlink on ID, that will delete the object completely, and the link to it as well)


            * context —— 上下文,如语言、时区等

        返回值: 新记录的id 异常: AccessError —— 如果用户没有创建这个对象的权限

        ValidateError —— 如果用户在字段中输入的值不在该字段的selection参数的范围内

        GoodERP -- Odoo China fork

        1 条回复 最后回复
        0

        • 登录

        • 没有帐号? 注册

        • 登录或注册以进行搜索。
        • 第一个帖子
          最后一个帖子
        0
        • 版块
        • 标签
        • 热门
        • 用户
        • 群组