如何在odoo 10中更改选择字段的值

时间:2017-06-07 10:09:36

标签: python odoo-10

如何更新选择字段的值?我正在处理模块购买文章,我想更改文章类型的值,例如,文章是消耗品,服务或库存,我想要它" beton",&# 34; NETTOYAGE"或者" d' entretien"。

1 个答案:

答案 0 :(得分:2)

有两种方法可以为现有选择字段添加值:

  1. 复制/粘贴现有​​字段并添加虚线:

    _columns = {
    'type': fields.selection([('new_type', 'New type'),('consu', 'Consumable'),('service','Service')], 'Product Type', required=True, help="Consumable are product where you don't manage stock, a service is a non-material product provided by a company or an individual."),        
    }
    
  2. 使用selection_add:

    type = fields.Selection(selection_add=[('new_type', 'New type')])