close

Master view
<field name="book_dtl_ids" colspan="4" context="{ 'default_submit_deptmst_id': submit_deptmst_id}"/>

Detail python code:
hre_empbas_id = fields.Many2one('hre.empbas', string='The member', domain=_get_app_domain)

def _get_app_domain(self):
    domain = [('company_id','=',1)]
    if not self.user_has_groups('infc.group_manager'):
        default_submit_deptmst_id = self._context.get('default_submit_deptmst_id', False)
        if default_submit_deptmst_id:
            domain.append(('hre_orgbas_id', '=', default_submit_deptmst_id))
         
    return domain
arrow
arrow
    文章標籤
    odoo教學
    全站熱搜
    創作者介紹
    創作者 Akira Chen 的頭像
    Akira Chen

    akira32 編程之家 pixnet

    Akira Chen 發表在 痞客邦 留言(0) 人氣()