1 <field name="user_ids" 2 mode="kanban" 3 nolabel="1" 4 options="{‘no_create_edit‘: True}" 5 context="{ 6 ‘many2many_res_id‘:id,//这里设置上下文参数 7 ‘form_view_ref‘:‘ship_manage.res_company_user_view_form‘, 8 ‘kanban_view_ref‘:‘ship_manage.res_company_user_view_kanban_del‘}"> 9 </field>
1 //这里触发python remove_group_id函数 2 <div class="oe_edit_only"> 3 <a name="remove_group_id" type="object" role="button"> 4 <i class="fa fa-times" role="img" aria-label="Delete" title="Delete"/> 5 </a> 6 </div> 7 <div class="oe_read_only"> 8 <i class="fa fa-circle" role="img" aria-label="Ok" title="Ok"/> 9 </div>
1 #这里就可以查看你传递过来的参数了 2 def remove_group_id(self): 3 _logger = logging.getLogger(__name__) 4 _logger.info(‘Users_logger+++++++++++++++++++++========================:%s‘ % (self._context))
1 //这是运行后的结果 2 {‘lang‘: ‘en_US‘, ‘tz‘: ‘Europe/Brussels‘, ‘uid‘: 1, ‘allowed_company_ids‘: [1], ‘form_view_ref‘: ‘ship_manage.res_company_user_view_form‘, ‘tree_view_ref‘: ‘ship_manage.ship_manage_user_groups_view_tree‘, ‘many2many_res_id‘: 1, ‘kanban_view_ref‘: ‘ship_manage.res_company_user_view_kanban_del‘}