odoo field 设置匿名函数domain

示例如下:


    transfer_account_id = fields.Many2one('account.account',
        domain=lambda self: [('reconcile', '=', True), ('user_type_id.id', '=', self.env.ref('account.data_account_type_current_assets').id), ('deprecated', '=', False)], string="Inter-Banks Transfer Account", help="Intermediary account used when moving money from a liquidity account to another")

posted @ 2020-04-23 09:18  那时一个人  阅读(553)  评论(0编辑  收藏  举报