'Test many2one field Create and Edit option visibility based on access rights of relation field'

def test_m2o_field_create_edit_invisibility(self):

    methods = ['create', 'write']
    company = self.env['res.company'].sudo(self.demo_user)
    company_view = company.fields_view_get(False, 'form')
    view_arch = etree.fromstring(company_view['arch'])
    field_node = view_arch.xpath("//field[@name='currency_id']")
    self.assertTrue(len(field_node), 'currency_id    field    should    be    in    company    from    view')
    for method in methods:
        self.assertEqual(field_node[0].get(('can_' + method)), 'false')
