Odoo中文社区可以通过以下两个域名访问:shine-it.net , odoo.net.cn

由于系统升迁的原因,本论坛部分较早期的内容存在格式和链接损坏失效的问题,并非本论坛系统本身的缺陷,望谅解

本社区没有维护任何QQ群讨论组,任何与本社区同名的QQ群讨论组的言论与本社区无关!

开发人员可以登录gitter讨论组: http://gitter.im/odoo-china/Talk, 需要github账号

如果您登录系统碰到问题,请在微信公众号留言:

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



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



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



  • 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参数的范围内


Log in to reply