Loading

Odoo ir value 分析

源代码位置:openerp/addons/base/ir/ir_values.py

 1 _columns = {
 2         'name': fields.char('Name', required=True),
 3         'model': fields.char('Model Name', select=True, required=True,
 4                              help="Model to which this entry applies"),
 5 
 6         # TODO: model_id and action_id should be read-write function fields
 7         'model_id': fields.many2one('ir.model', 'Model (change only)', size=128,
 8                                     help="Model to which this entry applies - "
 9                                          "helper field for setting a model, will "
10                                          "automatically set the correct model name"),
11         'action_id': fields.many2one('ir.actions.actions', 'Action (change only)',
12                                      help="Action bound to this entry - "
13                                          "helper field for binding an action, will "
14                                          "automatically set the correct reference"),
15 
16         'value': fields.text('Value', help="Default value (pickled) or reference to an action"),
17         'value_unpickle': fields.function(_value_unpickle, fnct_inv=_value_pickle,
18                                           type='text',
19                                           string='Default value or action reference'),
20         'key': fields.selection([('action','Action'),('default','Default')],
21                                 'Type', select=True, required=True,
22                                 help="- Action: an action attached to one slot of the given model\n"
23                                      "- Default: a default value for a model field"),
24         'key2' : fields.char('Qualifier', select=True,
25                              help="For actions, one of the possible action slots: \n"
26                                   "  - client_action_relate\n"
27                                 'Type', select=True, required=True,
28                                 help="- Action: an action attached to one slot of the given model\n"
29                                      "- Default: a default value for a model field"),
30         'key2' : fields.char('Qualifier', select=True,
31                              help="For actions, one of the possible action slots: \n"
32                                   "  - client_action_multi\n"
33                                   "  - client_print_multi\n"
34                                   "  - client_action_relate\n"
35                                   "  - tree_but_open\n"
36                                   "For defaults, an optional condition"
37                              ,),
38         'res_id': fields.integer('Record ID', select=True,
39                                  help="Database identifier of the record to which this applies. "
40                                       "0 = for all records"),
41         'user_id': fields.many2one('res.users', 'User', ondelete='cascade', select=True,
42                                    help="If set, action binding only applies for this user."),
43         'company_id': fields.many2one('res.company', 'Company', ondelete='cascade', select=True,
44                                       help="If set, action binding only applies for this company")
45     }
46     _defaults = {
47         'key': 'action',
48         'key2': 'tree_but_open',
49     }

 

一,可用的动作:

1.client_action_multi :wizard 动作

2.client_print_multi : 打印报表动作

3.client_acton_related: 相关链接

4.tree_but_open:双击树形视图动作

5.tree_but_action:同tree_but_open

 

posted @ 2015-03-14 19:47  青岛欧姆网络科技  阅读(1421)  评论(0编辑  收藏  举报