如何更改odoo10中选择字段的值

2024-09-28 01:33:49 发布

您现在位置:Python中文网/ 问答频道 /正文

如何更新选择字段的值?我正在处理模块购买文章,我想更改物品类型的值,例如,物品是消耗品、服务或可储存物品,我希望它是“beton”、“nettoyage”或“d'entertien”。在


Tags: 模块类型文章物品可储存beton消耗品entertien
1条回答
网友
1楼 · 发布于 2024-09-28 01:33:49

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

  1. 复制/粘贴现有字段并添加vlue:

    _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. 使用所选内容添加:

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

相关问题 更多 >

    热门问题