I have model:
current_dep = fields.One2many('hr.department', compute="_current_dep", string="Managed departments of current user")
@api.multi
def _current_dep(self):
self.current_dep = self.env['hr.department'].search([('manager_id', '=', self.env.user.id)])
And view:
<record id="action_my_income_transfers" model="ir.actions.act_window">
<field name="name">Transfers</field>
<field name="res_model">employee.transfer</field>
<field name="view_mode">tree,form</field>
<field name="transfer_form_id" ref="create_transfer"/>
<field name="transfer_tree_id" ref="transfer_tree_view"/>
<field name="domain">[('stage', '=', 'confirmed_cur'),('department_new', '=', current_dep)]</field>
</record>
But i got the error "NameError: name 'current_dep' is not defined"
Odoo 10